#include #include #include #include #include #include Func changeForm($showForm) Switch $showForm Case "main" showMain() Case "newvendor" showNewVendor() Case "reactivate" showReactivateVendor() Case "namechage" showVendorNameChange() Case "updateinfo" showUpdateVendorInfo() Case "addcode" showAddVendorCode() EndSwitch EndFunc ;==>changeForm Func showMain() Global $activeForm = "main" Global $newvendor = GUICtrlCreateButton("New Vondor", 56, 48, 169, 65) Global $reactivatevendor = GUICtrlCreateButton("Reactivate Vendor", 56, 120, 169, 65) Global $vendornamechange = GUICtrlCreateButton("Vendor Name Change", 56, 192, 169, 65) Global $updatevendorinfo = GUICtrlCreateButton("Update Vendor Info", 56, 264, 169, 65) Global $addcode = GUICtrlCreateButton("Add Code", 56, 336, 169, 65) EndFunc ;==>showMain Func showNewVendor() $activeForm = "newvendor" $ssa = getNames() $userName = "Choose your name" $eNames = "Choose your name" $fRequestor = GUICtrlCreateCombo("", 144, 64, 145, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_VSCROLL)) For $u In $ssa $a = StringSplit($u, " ") If StringInStr(@UserName, $a[2]) <> 0 Then $userName = $u EndIf $eNames = $eNames & "|" & $u Next ;$eNames = StringTrimRight($eNames,1) ;ConsoleWrite($eNames) GUICtrlSetData($fRequestor, $eNames, $userName) $fCompanyName = GUICtrlCreateInput("", 144, 96, 145, 21) $fFirstName = GUICtrlCreateInput("First Name", 145, 156, 65, 21) $fLastName = GUICtrlCreateInput("Last Name", 222, 157, 65, 21) $fVendorAddress1 = GUICtrlCreateInput("", 145, 184, 145, 21) $fVendorAddress2 = GUICtrlCreateInput("", 145, 215, 145, 21) $fZipCode = GUICtrlCreateInput("", 145, 242, 65, 21) $fVendorEmail = GUICtrlCreateInput("", 145, 272, 145, 21) $fVendorPhone = GUICtrlCreateInput("", 144, 305, 73, 21) GUICtrlSetLimit($fVendorPhone, 20) $fVendorExt = GUICtrlCreateInput("", 247, 305, 41, 21) $fVendorFax = GUICtrlCreateInput("", 144, 335, 73, 21) GUICtrlSetLimit($fVendorFax, 16) $fVendorCity = GUICtrlCreateInput("", 144, 368, 100, 21) $fVendorState = GUICtrlCreateCombo("Select a state", 145, 401, 145, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_VSCROLL)) GUICtrlSetData($fVendorState, "AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY") $fVendorType = GUICtrlCreateCombo("Select a vendor type", 145, 432, 145, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $WS_VSCROLL)) $fVendorCodes = GUICtrlCreateEdit("", 144, 464, 97, 113) ;GUICtrlSetData(-1, "") $bSubmit = GUICtrlCreateButton("SUBMIT", 112, 584, 73, 33) $lOr = GUICtrlCreateLabel("Or", 32, 128, 100, 17, $SS_CENTER) $lVendorAddress1 = GUICtrlCreateLabel("Vendor Address 1", 32, 184, 100, 17, $SS_RIGHT) $lVendorAddress2 = GUICtrlCreateLabel("Vendor Address 2", 32, 215, 100, 17, $SS_RIGHT) $lZipCode = GUICtrlCreateLabel("Zip Code", 32, 240, 100, 17, $SS_RIGHT) $lVendorEmail = GUICtrlCreateLabel("Vendor E-mail", 32, 272, 100, 17, $SS_RIGHT) $lVendorCity = GUICtrlCreateLabel("Vendor City", 32, 368, 100, 17, $SS_RIGHT) $lVendorState = GUICtrlCreateLabel("Vendor State", 32, 401, 100, 17, $SS_RIGHT) $lVendorType = GUICtrlCreateLabel("Vendor Type", 32, 432, 100, 17, $SS_RIGHT) $lVendorCodes = GUICtrlCreateLabel("Vendor", 32, 457, 100, 17, $SS_RIGHT) $lVendorcodes2 = GUICtrlCreateLabel("( 1 per line )", 33, 475, 100, 17, $SS_RIGHT) $lHeader = GUICtrlCreateLabel("Add New Vendor", 105, 8, 519, 49, $SS_CENTER) $bBack = GUICtrlCreateButton("GO BACK", 32, 20, 73, 33) $lRequestor = GUICtrlCreateLabel("Requstor", 32, 64, 100, 17, $SS_RIGHT) $lIndividualname = GUICtrlCreateLabel("Individual's Name", 32, 158, 100, 17, $SS_RIGHT) $lCompanyName = GUICtrlCreateLabel("Company Name", 32, 96, 100, 17, $SS_RIGHT) $lVendorPhone = GUICtrlCreateLabel("Vendor Phone", 32, 305, 100, 17, $SS_RIGHT) $lVendorFax = GUICtrlCreateLabel("Vendor Fax", 32, 335, 100, 17, $SS_RIGHT) $lVendorExt = GUICtrlCreateLabel("Ext.", 222, 305, 22, 17, $SS_RIGHT) EndFunc ;==>showNewVendor Func showReactivateVendor() $activeForm = "reactivatevendor" EndFunc ;==>showReactivateVendor Func showVendorNameChange() $activeForm = "vendornamechange" EndFunc ;==>showVendorNameChange Func showUpdateVendorInfo() $activeForm = "updatevendorinfo" EndFunc ;==>showUpdateVendorInfo Func showAddVendorCode() $activeForm = "addvendorcode" EndFunc ;==>showAddVendorCode