version 6.01 3 centdata Custdata Custlist Main 5 1 0 0 1 1 1 0 2 0 0 0 10 0 0 0 0 0 0 1 238 268 2 ControlsEx.dll SQLDesktop.dll 2 SQLDevice.dll ControlsEx.dll 4 tbc:TabControl cmd:Command reader:DataReader con:Connection Sub designer addform(centdata,"Central Information","",194,196,189)@ addform(Custdata,"Cust. Info.","",220,220,220)@ addform(Custlist,"Customer Listing","",220,220,220)@ addbutton(custlist,Custdispb,15,235,210,23,"Display Today's Route Only",212,208,200,0,0,0,True,True,9)@ addtable(custlist,Custtable,4,5,230,205,"",255,255,255,0,0,64,True,True,9)@ addform(Main,"Acctmgr Mobile","",249,254,186)@ addmenuitem(main,Menu1,"Exit",True,False)@r addmenuitem(main,Menu2,"Applications",True,False)@r addmenuitem(menu2,Menu4,"Sales Order Menu",True,False)@r addmenuitem(menu2,Menu5,"Customer Menu",True,False)@r addmenuitem(menu2,Menu6,"Inventory Menu",True,False)@r addmenuitem(menu2,Menu7,"Communication Menu",True,False)@r addmenuitem(menu7,Menu9,"Send Data",True,False)@r addmenuitem(menu7,Menu10,"Receive Data",True,False)@r addmenuitem(menu2,Menu8,"Central Information",True,False)@r addmenuitem(main,Menu3,"About",True,False)@ End Sub @EndOfDesignText@Sub Globals 'Declare the global variables here. todays = "" switch = 0 custsel = "" recnum = 0 End Sub Sub App_Start ' program startup WaitCursor(true) Main.Show Con.New1 reader.New1 Cmd.New1("",con.Value) con.Open("Data Source = " & AppPath & "\acctmgr.db") cmd.CommandText = "Select * from Centraldata" Reader.Value = cmd.ExecuteReader Main.Text = "ACCTMGR MOBILE "&Reader.GetValue(10) reader.Close ' setup central information panels AddTextBox (centdata,"TextBox1",10,20,215,25,"") 'company name AddTextBox (centdata,"TextBox2",10,20,215,25,"") 'address AddTextBox (centdata,"TextBox3",10,20,215,25,"") 'city AddTextBox (centdata,"TextBox4",10,20,35,25,"") 'state AddTextBox (centdata,"TextBox5",10,20,80,25,"") 'zip code AddTextBox (centdata,"TextBox6",10,20,80,25,"") 'Phone AddTextBox (centdata,"TextBox7",10,20,80,25,"") 'Fax AddTextBox (centdata,"TextBox8",10,20,80,25,"") 'Route AddTextBox (centdata,"TextBox9",10,20,100,25,"") 'FTPIP Address AddNumUpDown ("centdata","Num1",30,30,70) 'invoice number AddLabel ("centdata","Label1",80,10,90,15,"Company Name") AddLabel ("centdata","Label2",80,30,50,15,"Address") AddLabel ("centdata","Label3",80,30,35,15,"City") AddLabel ("centdata","Label4",80,30,40,15,"State") AddLabel ("centdata","Label5",80,30,50,15,"Zip Code") AddLabel ("centdata","Label6",80,30,40,15,"Phone") AddLabel ("centdata","Label7",80,30,30,15,"Fax") AddLabel ("centdata","Label8",80,30,125,15,"Next Invoice Number") AddLabel ("centdata","Label9",80,30,90,15,"Route Number") AddLabel ("centdata","Label10",80,30,100,15,"FTP I/P Address") tbc.New1 ("centdata",0,2,235,270) tbc.AddTabPage("General Info.") ' tab headers tbc.AddTabPage("Invoice/Comm. Info.") tbc.AddControl("Label1",0,70,2) tbc.AddControl("Label2",0,85,38) tbc.AddControl("Label3",0,95,74) tbc.AddControl("Label4",0,25,112) tbc.AddControl("Label5",0,130,112) tbc.AddControl("Label6",0,25,150) tbc.AddControl("Label7",0,140,150) tbc.AddControl("Label8",1,5,10) tbc.AddControl("Label9",0,5,200) tbc.AddControl("Label10",1,5,35) tbc.AddControl("TextBox1",0,5,18) tbc.AddControl("TextBox2",0,5,54) tbc.AddControl("TextBox3",0,5,90) tbc.AddControl("TextBox4",0,25,128) tbc.AddControl("TextBox5",0,120,128) tbc.AddControl("TextBox6",0,10,166) tbc.AddControl("TextBox7",0,120,166) tbc.AddControl("TextBox8",0,120,195) tbc.AddControl("Num1",1,150,5) tbc.AddControl("TextBox9",1,120,30) Control("TextBox1").Enabled = False ' disable textbox on first panel not user changeable Control("TextBox2").Enabled = False ' second panel will have user changeable items Control("TextBox3").Enabled = False Control("TextBox4").Enabled = False Control("TextBox5").Enabled = False Control("TextBox6").Enabled = False Control("TextBox7").Enabled = False Control("TextBox8").Enabled = False 'setup customer information panels tbc.New1 ("Custdata",0,2,235,270) tbc.AddTabPage("General Info.") ' tab headers tbc.AddTabPage("Del/Invoice/Sales") AddTextBox (Custdata,"TextBoxc1",10,20,80,35,"") 'Cust Code AddTextBox (Custdata,"TextBoxc2",10,20,215,25,"") 'company name AddTextBox (Custdata,"TextBoxc3",10,20,215,25,"") 'address AddTextBox (Custdata,"TextBoxc4",10,20,170,25,"") 'city AddTextBox (Custdata,"TextBoxc5",10,20,30,25,"") 'state AddTextBox (Custdata,"TextBoxc6",10,20,80,45,"") 'zip code AddTextBox (Custdata,"TextBoxc7",10,20,80,25,"") 'Phone AddTextBox (Custdata,"TextBoxc8",10,20,215,25,"") 'Contact AddTextBox (Custdata,"TextBoxc9",10,20,28,50,"") 'SUN AddTextBox (Custdata,"TextBoxc10",10,20,28,30,"") 'MON AddTextBox (Custdata,"TextBoxc11",10,20,28,30,"") 'TUE AddTextBox (Custdata,"TextBoxc12",10,20,28,30,"") 'WED AddTextBox (Custdata,"TextBoxc13",10,20,28,30,"") 'THU AddTextBox (Custdata,"TextBoxc14",10,20,28,30,"") 'FRI AddTextBox (Custdata,"TextBoxc15",10,20,28,30,"") 'SAT AddLabel ("Custdata","Labelc1",80,10,85,15,"Customer Code") AddLabel ("Custdata","Labelc2",80,30,90,15,"Customer Name") AddLabel ("Custdata","Labelc3",80,30,48,15,"Address") AddLabel ("Custdata","Labelc4",80,30,25,15,"City") AddLabel ("Custdata","Labelc5",80,30,33,15,"State") AddLabel ("Custdata","Labelc6",80,30,50,15,"Zip Code") AddLabel ("Custdata","Labelc7",80,30,40,15,"Phone") AddLabel ("Custdata","Labelc8",80,30,96,15,"Customer Contact") AddLabel ("Custdata","Labelc9",80,30,130,15,"Customer Delivery Days") AddLabel ("Custdata","Labelc10",80,30,200,15,"Sun Mon Tue Wed Thu Fri Sat") tbc.AddControl("Labelc1",0,5,8) tbc.AddControl("Labelc2",0,60,26) tbc.AddControl("Labelc3",0,80,65) tbc.AddControl("Labelc4",0,70,105) tbc.AddControl("Labelc5",0,190,105) tbc.AddControl("Labelc6",0,20,150) tbc.AddControl("Labelc7",0,160,150) tbc.AddControl("Labelc8",0,70,190) tbc.AddControl("Labelc9",1,50,5) tbc.AddControl("Labelc10",1,15,20) tbc.AddControl("TextBoxc1",0,100,5) tbc.AddControl("TextBoxc2",0,5,45) tbc.AddControl("TextBoxc3",0,5,85) tbc.AddControl("TextBoxc4",0,5,125) tbc.AddControl("TextBoxc5",0,190,125) tbc.AddControl("TextBoxc6",0,5,166) tbc.AddControl("TextBoxc7",0,140,166) tbc.AddControl("TextBoxc8",0,5,205) tbc.AddControl("TextBoxc9",1,10,40) 'sun tbc.AddControl("TextBoxc10",1,40,40) 'mon tbc.AddControl("TextBoxc11",1,70,40) 'tue tbc.AddControl("TextBoxc12",1,100,40) 'wed tbc.AddControl("TextBoxc13",1,130,40) 'thu tbc.AddControl("TextBoxc14",1,160,40) 'fri tbc.AddControl("TextBoxc15",1,190,40) 'sat Control("TextBoxc1").Enabled = False ' disable textbox on first panel not user changeable Control("TextBoxc2").Enabled = False ' second panel will have user changeable items Control("TextBoxc3").Enabled = False Control("TextBoxc4").Enabled = False Control("TextBoxc5").Enabled = False Control("TextBoxc6").Enabled = False Control("TextBoxc7").Enabled = False 'Control("TextBoxc8").Enabled = False WaitCursor(false) End Sub Sub Menu8_Click ' central information WaitCursor(true) cmd.CommandText = "Select * from Centraldata" Reader.Value = cmd.ExecuteReader centdata.Show Control("textbox1").Text = Reader.GetValue(0) ' data base field references Control("textbox2").Text = Reader.GetValue(1) Control("textbox3").Text = Reader.GetValue(2) Control("textbox4").Text = Reader.GetValue(3) Control("textbox5").Text = Reader.GetValue(4) Control("textbox6").Text = Reader.GetValue(5) Control("textbox7").Text = Reader.GetValue(6) Control("Num1",numupdown).Minimum = Reader.GetValue(7) 'beg invoice range Control("Num1",numupdown).Maximum = Reader.GetValue(8) 'ending invoice range Control("Num1",numupdown).value = Reader.GetValue(9) 'next invoice/sales order Control("textbox8").Text = Reader.GetValue(10) Control("textbox9").Text = Reader.GetValue(11) reader.Close WaitCursor(false) End Sub Sub Menu1_Click ' close the program Main.Close End Sub Sub Main_Close ' close the program Con.Close End Sub Sub Menu5_Click ' Customer Menu WaitCursor(true) Custlist.Show cmd.CommandText = "Select ROWID,ccode,cname,cadd,ccity from Customer Order by ccode" Custdispb.Text= "Display "&DateDayOfweek (Now)&"'s Route Only" cmd.ExecuteTable("Custtable",0) Custtable.ColWidth("Rowid") = 0 Custtable.ColWidth("ccode") = 80 Custtable.ColWidth("cname") = 150 Custtable.ColWidth("cadd") = 150 Custtable.ColWidth("ccity") = 100 Custtable.Focus WaitCursor(false) End Sub Sub Custtable_SelectionChanged (ColName, Row) custsel = Custtable.Cell ("ccode", Custtable.SelectedRow) recnum = Custtable.Cell ("rowid", Custtable.SelectedRow) 'Msgbox (recnum) 'Msgbox (custsel) cmd.CommandText = "Select * from Customer where ccode = '"&custsel & "'" Reader.Value = cmd.ExecuteReader 'Control("textbox1c").Text = Reader.GetValue(2) TextBoxc1.Text = Reader.GetValue(0) 'cust code TextBoxc2.Text = Reader.GetValue(1) 'cust name TextBoxc3.Text = Reader.GetValue(2) 'cust address TextBoxc4.Text = Reader.GetValue(3) 'cust city TextBoxc5.Text = Reader.GetValue(4) 'cust state TextBoxc6.Text = Reader.GetValue(5) 'cust zip TextBoxc7.Text = Reader.GetValue(6) 'cust phone TextBoxc8.Text = Reader.GetValue(7) 'contact name TextBoxc9.Text = Reader.GetValue(14) 'sun TextBoxc10.Text = Reader.GetValue(15) 'mon TextBoxc11.Text = Reader.GetValue(16) 'tue TextBoxc12.Text = Reader.GetValue(17) 'wed TextBoxc13.Text = Reader.GetValue(18) 'thu TextBoxc14.Text = Reader.GetValue(19) 'fri TextBoxc15.Text = Reader.GetValue(20) 'sat 'TextBoxc2.Text = Custtable.Cell ("cname", Custtable.SelectedRow) 'TextBoxc3.Text = Custtable.Cell ("cadd", Custtable.SelectedRow) 'TextBoxc4.Text = Custtable.Cell ("ccity", Custtable.SelectedRow) 'TextBoxc5.Text = Custtable.Cell ("cstate", Custtable.SelectedRow) Custdata.Show reader.Close End Sub Sub Custdispb_Click WaitCursor(true) Custlist.Show todays = SubString (DateDayOfweek (Now),0,3) If switch = 1 Then cmd.CommandText = "Select ROWID,ccode,cname,cadd,ccity,cstate from Customer Order by ccode" switch = 0 Custdispb.Text= "Display "&DateDayOfweek (Now)&"'s Route Only" Else cmd.CommandText = "Select ROWID,ccode,cname,cadd,ccity from Customer where "&todays&" <> '' Order by ccode" switch = 1 Custdispb.Text= "Display All Customers" End If cmd.ExecuteTable("Custtable",0) Custtable.ColWidth("Rowid") = 0 Custtable.ColWidth("ccode") = 80 Custtable.ColWidth("cname") = 150 Custtable.ColWidth("cadd") = 150 Custtable.ColWidth("ccity") = 100 WaitCursor(false) End Sub Sub Custdata_Close i = Msgbox ("Do You want to Save the Data?","Save Data",cMsgboxYesNo,cMsgBoxExclamation) If i = cYes Then text = "update Customer set ccontact = '" &TextBoxc8.Text&"' where ROWID = "&recnum Msgbox(text) cmd.CommandText = text cmd.ExecuteNonQuery End If ' reader.Close End Sub