这个是保存按键事件
Dim txt_inv_number As WinForm.TextBox = e.Form.Controls("txt_inv_number")
Dim txt_customer_cname As WinForm.TextBox = e.Form.Controls("txt_customer_cname")
Dim txt_customer_fax As WinForm.TextBox = e.Form.Controls("txt_customer_fax")
Dim txt_customer_no As WinForm.TextBox = e.Form.Controls("txt_customer_no")
Dim txt_customer_tel As WinForm.TextBox = e.Form.Controls("txt_customer_tel")
Dim txt_hdd_info As WinForm.TextBox = e.Form.Controls("txt_hdd_info")
Dim txt_item_desc As WinForm.TextBox = e.Form.Controls("txt_item_desc")
Dim txt_item_barcode As WinForm.TextBox = e.Form.Controls("txt_item_barcode")
Dim txt_lan_ip As WinForm.TextBox = e.Form.Controls("txt_lan_ip")
Dim txt_monitor As WinForm.TextBox = e.Form.Controls("txt_monitor")
Dim txt_motherboard As WinForm.TextBox = e.Form.Controls("txt_motherboard")
Dim txt_pc_cpu As WinForm.TextBox = e.Form.Controls("txt_pc_cpu")
Dim txt_pc_remark As WinForm.TextBox = e.Form.Controls("txt_pc_remark")
Dim txt_photo_path1 As WinForm.TextBox = e.Form.Controls("txt_photo_path1")
Dim txt_photo_path2 As WinForm.TextBox = e.Form.Controls("txt_photo_path2")
Dim txt_photo_path3 As WinForm.TextBox = e.Form.Controls("txt_photo_path3")
Dim txt_photo_path4 As WinForm.TextBox = e.Form.Controls("txt_photo_path4")
Dim txt_photo_path5 As WinForm.TextBox = e.Form.Controls("txt_photo_path5")
Dim txt_wifi_ip As WinForm.TextBox = e.Form.Controls("txt_wifi_ip")
Dim pc_index As String
Dim com_cat As WinForm.ComboBox = e.Form.Controls("com_cat")
Dim str(10) As String
Dim str_date As String
Dim str_pc_serial As String
P_selected_formname="PC_Master"
If len(txt_pc_cpu.text)=0 Then
str(1)=vars("msg_not_input")
str(2)=vars("msg_data")
str(0)=str(1) & str(2)
messagebox.Show (str(0))
Exit Sub
End If
str_date=Format(Date.now,("yyyyMMddHHmmss"))
If len(txt_inv_number.Text)=0 Then
txt_inv_number.Text= DataTables("pc_master") .Compute("Max(invoice_number)") + 1
messagebox.Show (" txt_inv_number.Text " & txt_inv_number.Text )
End If
If len(str_pc_serial )=0 Then
p_primary_key = DataTables("pc_master") .Compute("Max(primary_key)") + 1
Functions.execute("Sub_GetSerial")
str_pc_serial=P_primary_key &"_" & P_pc_serial
'messagebox.Show (" str_pc_serial " & str_pc_serial )
End If
P_Row_pc_master("primary_key")=p_primary_key
P_Row_pc_master("pc_serial")=str_pc_serial
P_Row_pc_master("invoice_number")=txt_inv_number.Text
P_Row_pc_master("pc_cpu")=txt_pc_cpu.text
p_Row_pc_master("customer_cname")=txt_customer_cname.text
P_Row_pc_master("customer_fax")=txt_customer_fax.Text
P_Row_pc_master("customer_tel")=txt_customer_tel.Text
P_Row_pc_master("pc_hdd_info")=txt_hdd_info.Text
If len(com_cat.Text)>0 Then
p_Row_pc_master("cat_code")=com_cat.Text
Else
p_Row_pc_master("cat_code")="cat_code"
End If
p_Row_pc_master("item_no")="item_no"
p_Row_pc_master("item_cdesc")=txt_item_desc.Text
p_Row_pc_master("item_barcode")=txt_item_barcode.Text
p_Row_pc_master("pc_cpu")=txt_pc_cpu.Text
p_Row_pc_master("pc_wifi_ip")=txt_wifi_ip.Text
p_Row_pc_master("pc_lan_ip")=txt_lan_ip.Text
p_Row_pc_master("pc_hdd_info")=txt_hdd_info.Text
p_Row_pc_master("pc_monitor")=txt_monitor.Text
p_Row_pc_master("pc_motherboard")=txt_motherboard.Text
p_Row_pc_master("customer_no")=P_Customer_No
p_Row_pc_master("customer_tel")=txt_customer_tel.Text
pc_index=P_computer_name & "_" & P_Sales_Code &"_" & P_Customer_Card_No &"_" & txt_customer_cname.Text &"_" & txt_inv_number.Text
MessageBox.Show ("pc_index " & pc_index )
p_Row_pc_master("pc_index")=pc_index
p_Row_pc_master("shopcode")=p_company_shopcode
p_Row_pc_master("updated_on")=Date.now
If len(P_Sales_Code)>0 Then
p_Row_pc_master("updated_by")=P_Sales_Code
Else
p_Row_pc_master("updated_by")="admin"
End If
P_Row_pc_master.Save
'Tables("pc_master").current.save()
'DataTables("pc_master").Save()
messagebox.Show (vars("msg_saved_records") )
'DataTables("pc_master").load()
P_Row_status=""
P_DataRow_status=""