home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / postit / postit.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-10-26  |  10.6 KB  |  312 lines

  1. VERSION 4.00
  2. Begin VB.Form POSTIT 
  3.    Appearance      =   0  'Flat
  4.    AutoRedraw      =   -1  'True
  5.    BackColor       =   &H80000005&
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Numatic International 'Post-Note'"
  8.    ClientHeight    =   5640
  9.    ClientLeft      =   876
  10.    ClientTop       =   1020
  11.    ClientWidth     =   6828
  12.    ControlBox      =   0   'False
  13.    BeginProperty Font 
  14.       name            =   "MS Sans Serif"
  15.       charset         =   0
  16.       weight          =   700
  17.       size            =   7.8
  18.       underline       =   0   'False
  19.       italic          =   0   'False
  20.       strikethrough   =   0   'False
  21.    EndProperty
  22.    ForeColor       =   &H80000008&
  23.    Height          =   6024
  24.    Icon            =   "POSTIT.frx":0000
  25.    Left            =   828
  26.    LinkTopic       =   "Form1"
  27.    MaxButton       =   0   'False
  28.    MinButton       =   0   'False
  29.    ScaleHeight     =   5640
  30.    ScaleWidth      =   6828
  31.    Top             =   684
  32.    Width           =   6924
  33.    Begin VB.TextBox NAMER 
  34.       Appearance      =   0  'Flat
  35.       Height          =   288
  36.       Left            =   4560
  37.       TabIndex        =   7
  38.       Text            =   "0"
  39.       Top             =   840
  40.       Visible         =   0   'False
  41.       Width           =   492
  42.    End
  43.    Begin Threed.SSPanel STATUSPANEL 
  44.       Align           =   2  'Align Bottom
  45.       Height          =   492
  46.       Left            =   0
  47.       TabIndex        =   3
  48.       Top             =   5148
  49.       Width           =   6828
  50.       _Version        =   65536
  51.       _ExtentX        =   12044
  52.       _ExtentY        =   868
  53.       _StockProps     =   15
  54.       BackColor       =   -2147483633
  55.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  56.          name            =   "Arial"
  57.          charset         =   0
  58.          weight          =   700
  59.          size            =   12
  60.          underline       =   0   'False
  61.          italic          =   0   'False
  62.          strikethrough   =   0   'False
  63.       EndProperty
  64.       BevelWidth      =   2
  65.       Alignment       =   4
  66.       Begin Threed.SSPanel messagenumber 
  67.          Height          =   336
  68.          Left            =   3264
  69.          TabIndex        =   9
  70.          Top             =   84
  71.          Width           =   3468
  72.          _Version        =   65536
  73.          _ExtentX        =   6117
  74.          _ExtentY        =   593
  75.          _StockProps     =   15
  76.          Caption         =   "Message #102"
  77.          BackColor       =   -2147483633
  78.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  79.             name            =   "Arial"
  80.             charset         =   0
  81.             weight          =   700
  82.             size            =   12
  83.             underline       =   0   'False
  84.             italic          =   0   'False
  85.             strikethrough   =   0   'False
  86.          EndProperty
  87.          BevelWidth      =   2
  88.       End
  89.       Begin Threed.SSCommand Command3D1 
  90.          Height          =   350
  91.          Left            =   2112
  92.          TabIndex        =   6
  93.          Top             =   96
  94.          Width           =   972
  95.          _Version        =   65536
  96.          _ExtentX        =   1715
  97.          _ExtentY        =   614
  98.          _StockProps     =   78
  99.          Caption         =   "Reply"
  100.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  101.             name            =   "Arial"
  102.             charset         =   0
  103.             weight          =   700
  104.             size            =   12
  105.             underline       =   0   'False
  106.             italic          =   0   'False
  107.             strikethrough   =   0   'False
  108.          EndProperty
  109.       End
  110.       Begin Threed.SSCommand printbutton 
  111.          Height          =   348
  112.          Left            =   1152
  113.          TabIndex        =   5
  114.          Top             =   96
  115.          Width           =   852
  116.          _Version        =   65536
  117.          _ExtentX        =   1503
  118.          _ExtentY        =   614
  119.          _StockProps     =   78
  120.          Caption         =   "Print"
  121.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  122.             name            =   "Arial"
  123.             charset         =   0
  124.             weight          =   700
  125.             size            =   12
  126.             underline       =   0   'False
  127.             italic          =   0   'False
  128.             strikethrough   =   0   'False
  129.          EndProperty
  130.       End
  131.       Begin Threed.SSCommand closebutton 
  132.          Height          =   348
  133.          Left            =   192
  134.          TabIndex        =   4
  135.          Top             =   96
  136.          Width           =   852
  137.          _Version        =   65536
  138.          _ExtentX        =   1503
  139.          _ExtentY        =   614
  140.          _StockProps     =   78
  141.          Caption         =   "Close"
  142.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  143.             name            =   "Arial"
  144.             charset         =   0
  145.             weight          =   700
  146.             size            =   12
  147.             underline       =   0   'False
  148.             italic          =   0   'False
  149.             strikethrough   =   0   'False
  150.          EndProperty
  151.       End
  152.    End
  153.    Begin Threed.SSPanel Panel3D2 
  154.       Align           =   1  'Align Top
  155.       Height          =   4692
  156.       Left            =   0
  157.       TabIndex        =   1
  158.       Top             =   492
  159.       Width           =   6828
  160.       _Version        =   65536
  161.       _ExtentX        =   12044
  162.       _ExtentY        =   8276
  163.       _StockProps     =   15
  164.       Caption         =   "Panel3D2"
  165.       BackColor       =   -2147483633
  166.       BevelInner      =   1
  167.       Autosize        =   3
  168.       Begin VB.TextBox recordid 
  169.          Appearance      =   0  'Flat
  170.          Height          =   300
  171.          Left            =   2976
  172.          TabIndex        =   8
  173.          Top             =   1536
  174.          Visible         =   0   'False
  175.          Width           =   3084
  176.       End
  177.       Begin VB.TextBox DATUM 
  178.          Appearance      =   0  'Flat
  179.          BackColor       =   &H0000FFFF&
  180.          BeginProperty Font 
  181.             name            =   "Arial"
  182.             charset         =   0
  183.             weight          =   700
  184.             size            =   13.8
  185.             underline       =   0   'False
  186.             italic          =   0   'False
  187.             strikethrough   =   0   'False
  188.          EndProperty
  189.          Height          =   4572
  190.          Left            =   60
  191.          MultiLine       =   -1  'True
  192.          ScrollBars      =   2  'Vertical
  193.          TabIndex        =   2
  194.          Text            =   "POSTIT.frx":030A
  195.          Top             =   60
  196.          Width           =   6708
  197.       End
  198.    End
  199.    Begin Threed.SSPanel status 
  200.       Align           =   1  'Align Top
  201.       Height          =   492
  202.       Left            =   0
  203.       TabIndex        =   0
  204.       Top             =   0
  205.       Width           =   6828
  206.       _Version        =   65536
  207.       _ExtentX        =   12044
  208.       _ExtentY        =   868
  209.       _StockProps     =   15
  210.       Caption         =   "Message From :"
  211.       BackColor       =   -2147483633
  212.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  213.          name            =   "Arial"
  214.          charset         =   0
  215.          weight          =   700
  216.          size            =   12
  217.          underline       =   0   'False
  218.          italic          =   0   'False
  219.          strikethrough   =   0   'False
  220.       EndProperty
  221.       BevelWidth      =   2
  222.       BevelInner      =   1
  223.    End
  224. Attribute VB_Name = "POSTIT"
  225. Attribute VB_Creatable = False
  226. Attribute VB_Exposed = False
  227. Private Sub closebutton_Click()
  228.     Dim NoteDB As Database
  229.     Dim NoteDS As Recordset
  230.     ' get the relevant record
  231.     Set NoteDB = OpenDatabase(PN_DATABASE, False)
  232.     SQL$ = "SELECT * FROM NOTELOG WHERE RECORD_ID = " + Trim$(RECORDID.Text)
  233.     Set NoteDS = NoteDB.OpenRecordset(SQL$, dbOpenDynaset)
  234.     REP = 0
  235.     ' if we got the record, check if we must reply
  236.     If NoteDS.RecordCount <> 0 Then
  237.         If NoteDS.Fields("REPLY_REQUIRED") = -1 Then REP = 1
  238.         
  239.         ' mark this message as being read (and when it was read)
  240.         NoteDS.Edit
  241.         NoteDS.Fields("READ") = -1
  242.         NoteDS.Fields("READ_ON") = Now
  243.         NoteDS.Update
  244.     End If
  245.     NoteDS.Close
  246.     NoteDB.Close
  247.     DoEvents
  248.     serverform.Data1.Refresh
  249.     ' we must reply to the message
  250.     If REP = 1 Then
  251.         A = MsgBox("The sender requested that you reply to this message.", 64, "For Your Information")
  252.         
  253.         Set NoteDB = OpenDatabase(PN_DATABASE, False)
  254.         SQL$ = "SELECT * FROM NOTELOG WHERE RECORD_ID = " + Trim$(RECORDID.Text)
  255.         Set NoteDS = NoteDB.OpenRecordset(SQL$, dbOpenDynaset)
  256.         
  257.         ' as long as we got the record...
  258.         If NoteDS.RecordCount <> 0 Then
  259.             NoteDS.Edit
  260.             ' mark as read, and replied
  261.             NoteDS.Fields("READ") = -1
  262.             NoteDS.Fields("READ_ON") = Now
  263.             NoteDS.Fields("REPLIED") = -1
  264.             NoteDS.Fields("REPLIED_ON") = Now
  265.             NoteDS.Update
  266.         End If
  267.         
  268.         NoteDS.Close
  269.         NoteDB.Close
  270.         DoEvents
  271.         SENDER = status.Caption
  272.         ' shell the post-sender program, with the originator's name (reply mode)
  273.         X% = Shell(PN_POSTSEND_PATH + " " + NAMER.Text, 1)
  274.         DoEvents
  275.     End If
  276.     Unload Me
  277. End Sub
  278. Private Sub Command3D1_Click()
  279.     Dim NoteDB As Database
  280.     Dim NoteDS As Recordset
  281.     Set NoteDB = OpenDatabase(PN_DATABASE, False)
  282.     SQL$ = "SELECT * FROM NOTELOG WHERE RECORD_ID = " + Trim$(serverform.RECORDID.Text)
  283.    Set NoteDS = NoteDB.OpenRecordset(SQL$, dbOpenDynaset)
  284.     If NoteDS.RecordCount <> 0 Then
  285.         ' mark as read, and relied
  286.         NoteDS.Edit
  287.         NoteDS.Fields("READ") = -1
  288.         NoteDS.Fields("READ_ON") = Now
  289.         NoteDS.Fields("REPLIED") = -1
  290.         NoteDS.Fields("REPLIED_ON") = Now
  291.         NoteDS.Update
  292.     End If
  293.     NoteDS.Close
  294.     NoteDB.Close
  295.     DoEvents
  296.     serverform.Data1.Refresh
  297.     SENDER = status.Caption
  298.     ' shell the post send program, with originator's name (reply mode)
  299.     X% = Shell(PN_POSTSEND_PATH + " " + NAMER.Text, 1)
  300.     DoEvents
  301.     Unload Me
  302. End Sub
  303. Private Sub printbutton_Click()
  304.     ' print the message - note, no word-wrap here, but could be installed.
  305.     Printer.Print
  306.     Printer.Print status.Caption
  307.     Printer.Print
  308.     Printer.Print datum.Text
  309.     Printer.EndDoc
  310.     A = MsgBox("Printed Your Post-IT Note", 64, "For Your Information")
  311. End Sub
  312.