'----------------把宾客支付填入到手牌管理的实收款中-------------------------
Dim tgh As WinForm.TextBox = e.Form.Controls("TextBox02") '团购号
Dim ysje As WinForm.TextBox = e.Form.Controls("TextBox12") '应收金额
Dim hyk As WinForm.TextBox = e.Form.Controls("TextBox1") '会员卡
Dim zf As WinForm.ComboBox = e.Form.Controls("ComboBox1") '支付方式
Dim gdzh As WinForm.ComboBox = e.Form.Controls("ComboBox2") '挂单账户
Dim xfje As WinForm.TextBox = e.Form.Controls("TextBox04") '消费合计
Dim yejs As WinForm.RadioButton = e.Form.Controls("余额结算") '余额结算逻辑列
Dim gd As WinForm.CheckBox = e.Form.Controls("CheckBox1") '挂单
Dim knye As WinForm.TextBox = e.Form.Controls("TextBox03") '卡内余额
Dim bz As WinForm.TextBox = e.Form.Controls("TextBox06") '备注
Dim shje As WinForm.TextBox = e.Form.Controls("TextBox08") '实收金额
Dim yhje As WinForm.TextBox = e.Form.Controls("TextBox01") '优惠金额
Dim gdje As WinForm.TextBox = e.Form.Controls("TextBox09") '挂单金额
Dim dr As Row = Tables("结账_table1").Current
If dr IsNot Nothing Then
Dim de As DataRow
de = DataTables("总表_手牌管理").Find("[手牌号] = '" & dr("手牌号") & "'")
If de IsNot Nothing Then
If zf.Value = "团购" Then
If gdzh.Value = Nothing Then
MessageBox.Show("必须输入挂单账户", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If zf.Value = "团购" Then
If tgh.Value = Nothing Then
MessageBox.Show("请在支付备注内登记团购券号", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If zf.Value = "充值卡" Then
If yejs.Checked = False Then
'MessageBox.Show("使用充值卡结算的话,必须勾选余额结算", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If zf.Value = "现金" Then
If shje.Value = Nothing Then
MessageBox.Show("请输入宾客支付的金额", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If zf.Value = "POS刷卡" Then
If gdje.Value = Nothing Then
MessageBox.Show("请在签单金额中输入刷卡的金额", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If zf.Value = "POS刷卡+团购" Then
shje.value =Nothing
If gdje.Value = Nothing Then
MessageBox.Show("请在签单金额中输入金额", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If zf.Value = "现金+团购" Then
If shje.Value = Nothing Then
MessageBox.Show("请在现金中输入金额", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
If gdje.Value = Nothing Then
MessageBox.Show("请在签单金额中输入金额", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
End If
If gd.Checked = True Then '如果勾选了余额结算的话,必须填写会员卡号
If gdzh.Value = Nothing Then
MessageBox.Show("请选择挂单账户", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If shje.Value > 0 Then
If zf.Value = Nothing Then
MessageBox.Show("请选择支付方式", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If hyk.Value IsNot Nothing Then
If yejs.Checked = False Then
MessageBox.Show("如充值卡会员,请勾选余额结算", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
End If
End If
If gd.Checked = True Then '如果勾选了挂单的话
If gdje.Value = Nothing Then
MessageBox.Show("请输入挂单金额", "错误", MessageBoxButtons.ok, MessageBoxIcon.Error)
Return
Else
de("签单金额") = gdje.Value
End If
End If
de("支付方式") = zf.Value
de("挂单账户") = gdzh.Value
de("会员卡号") = hyk.Value
de("支付备注") = bz.Value
de("实收款") = shje.Value
de("优惠") = yhje.Value
de("签单金额") = gdje.Value
de("应收") = ysje.Value
de("状态") = "离店"
Dim fj As Row = Tables("春园店_房间管理").Current
If fj IsNot Nothing Then
fj("状态") = Nothing
fj("登记时间") = Nothing
fj("当前手牌") = Nothing
fj("状态") = "空"
End If
For Each jz As Row In Tables("结账_table1").Rows '遍历消费表的所有行
jz("会员卡号") = hyk.Value
jz("会员姓名") = e.Form.Controls("label09").text
jz("结账") = True
jz("结束服务时间") = Functions.Execute("服务器时间")
Next
End If
''--------------------------------------------
Dim cz As DataRow
cz = DataTables("总表_手牌管理").Find("[手牌号] = '" & dr("手牌号") & "'")
If cz("支付方式") = "充值卡" Then
'With Forms("结账").Controls("TextBox1")
'If .Value IsNot Nothing Then
Dim qdr As DataRow
qdr = DataTables("总表_会员信息").Find("[会员卡号] = '" & dr("会员卡号") & "'","[_Identify]") '找出第一行
If qdr IsNot Nothing Then
'模拟第一行的支出发生变化, 刷新已加载行的余额.
DataTables("总表_手牌管理").Save
DataTables("总表_手牌消费").Save
DataTables("总表_会员信息").DataCols("会员卡号").RaiseDataColChanged(qdr)
DataTables("总表_会员信息").Save()
End If
Dim wdr As Row = Tables("总表_手牌管理").Current
Dim vv1 As String
vv1= "尊贵的: " & wdr("会员卡号") & " 号会员,"
'----------------消费时间------------------
Dim vv2 As String
Dim Vall As Date = wdr("登记时间")
vv2 = "消费时间: " & vall & ","
'----------------消费金额------------------
Dim vv3 As String
Dim je As Integer = wdr("应收")
vv3 = "消费: " & je & "元"
'----------------余额------------------
Dim vv4 As String
Dim ye As DataRow = DataTables("总表_会员信息").Find("会员卡号 = '" & wdr("会员卡号") & "'")
If ye IsNot Nothing Then '如果找到了符合条件的行
vv4 = "余额: " & ye("总余额") & ",感谢光临"
End If
'---------------分界线-------------------
Dim tel As String = ye("手机号") '接收手机号
'---------------分界线-------------------
Dim zh As String = "隐藏"
Dim mm As String = "隐藏"
Dim url ,s As String
Dim wdrr As Row = Tables("总表_短信猫").AddNew
wdrr("账号") = "---隐藏----"
wdrr("密码") = "---隐藏---"
wdrr("发送时间") = Date.Now
wdrr("接收手机") = tel
Dim http As Object
url = "http://service.winic.org:8009/sys_port/gateway/?id="& zh &"&pwd="& mm &"&To=" & tel & "&c&time="
http = CreateObject("MSXML2.XMLHTTP")
http.Open("get", url, False)
http.send()
s = http.responseText
Dim Value As String = Left(s,3)
Dim Result As String
Select Case Value
Case "000"
Result = "发送成功!"
Case "-01"
Result = "当前账号余额不足!"
Case "-02"
Result = "当前用户ID错误!"
Case "-03"
Result = "当前密码错误!"
Case "-04"
Result = "参数不够或参数内容的类型错误!"
Case "-05"
Result = "手机号码格式不对!"
Case "-06"
Result = "短信内容编码不对!"
Case "-07"
Result = "短信内容含有敏感字符!"
Case "-08"
Result = "无接收数据!"
Case "-09"
Result = "系统维护中.."
Case "-10"
Result = "手机号码数量超长!(100个/次)"
Case "-11"
Result = "短信内容超长!(70个字符)"
Case "-12"
Result = "其它错误!"
End Select
wdrr("提示信息")= Replace(Replace(Replace(Replace(Replace(s,Value,Result),"Send","本次发送量"),"Consumption","当次消费金额"),"Tmoney","总余额"),"sid","短信编号")
wdrr("短信内容") = "&c&time="
DataTables("总表_短信猫").Save()
MessageBox.Show("结账成功", "提示", MessageBoxButtons.ok, MessageBoxIcon.Information)
Functions.Execute("结账小piao",e.form.Name & "_Table1")
e.Form.Close
Else
DataTables("总表_手牌管理").Save
DataTables("总表_手牌消费").Save
DataTables("春园店_房间管理").Save()
MessageBox.Show("结账成功", "提示", MessageBoxButtons.ok, MessageBoxIcon.Information)
Functions.Execute("结账小piao",e.form.Name & "_Table1")
e.Form.Close
Return
End If
End If
'End With
'-------------------------------------
'---------------------------------------------------------