📄 ct_zdjs.frm
字号:
zdjs_MC = "*"
zdjs_JSMC = "*"
zdjs_FKMC = "*"
zdjs_ZH = ""
zdjs_ZHK = "*"
zdjs_GDK = "*"
zdjs_HZK = "*"
zdjs_ZHXZ = "*"
t_czlsh = Pub_czls(PUB_data, "CT_ZDJS", Time(), pub_code)
tx_th.Text = CS_th
Dim ctrl_rec As Recordset
Set ctrl_rec = PUB_data.OpenRecordset("SELECT * FROM SYS_CTRL WHERE TRIM(GWDM)='" & Trim(SYS_GWDM) & "'", 4, 0, 2)
If Not ctrl_rec.BOF Then
ctrl_rec.MoveLast
zdjs_R1 = Trim(ctrl_rec!BMJSDM)
zdjs_MC = Trim(ctrl_rec!XFXM_ZW)
End If
ctrl_rec.Close
zdjs_NAME = SYS_GWMC & "客帐结算-放弃退出"
'设置早餐卡标准
Dim t_rec As Recordset
Set t_rec = PUB_data.OpenRecordset("SELECT * FROM DT_ZCKBZ ORDER BY ZCK_BZ", 4, 0, 2)
If Not t_rec.BOF Then
t_rec.MoveLast
t_rec.MoveFirst
End If
LOCAL_data.Execute "DELETE FROM DT_ZCK"
Dim zck_rec As Recordset
Set zck_rec = LOCAL_data.OpenRecordset("SELECT * FROM DT_ZCK ORDER BY ZCK_BZ", 2, 0, 2)
If Not zck_rec.BOF Then
zck_rec.MoveLast
End If
'把早餐卡标准记录插入临时表中
Do While Not t_rec.EOF
zck_rec.AddNew
zck_rec.Fields("ZCK_BZ") = t_rec.Fields("ZCK_BZ")
zck_rec.Fields("FSSL") = 0
zck_rec.Fields("FSBZ") = "*"
zck_rec.Update
t_rec.MoveNext
Loop
t_rec.Close
t_fields = Array("ZCK_BZ", "FSSL", "FSBZ") '设置显示字段
t_fdxs = Array(2, 0, 0) '设置显示字段
t_bt = ">标准 |>发放数量|<发放备注 " '设置显示表头格式
t_fdcounts = 3
Call tPFlex_XSfull(gd1, t_bt, zck_rec, t_fields, t_fdcounts - 1, t_fdxs)
zck_rec.Close
End Sub
'**************************************************************************************************
Private Sub gd1_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft
If gd1.Col <> 0 Then
gd1.Col = gd1.Col - 1
End If
Case vbKeyRight
If gd1.Col <> gd1.Cols - 1 Then
gd1.Col = gd1.Col + 1
End If
Case vbKeyUp
If gd1.Row - 1 <> 0 Then
gd1.Row = gd1.Row - 1
End If
Case vbKeyDown
If gd1.Row <> gd1.Rows - 1 Then
gd1.Row = gd1.Row + 1
End If
Case vbKeyReturn
If fm_yhq.Enabled Then
If op_yhq(0).Value Then
op_yhq(0).SetFocus
Else
op_yhq(1).SetFocus
End If
Else
CMD_JS.SetFocus
End If
End Select
End Sub
Private Sub gd1_LostFocus()
'把GD1中免费早餐卡数量写入DT_ZCK(本地)中
tx_sl.Visible = False
tx_bz.Visible = False
Dim temp_i As Integer
For temp_i = 1 To gd1.Rows - 1
LOCAL_data.Execute "UPDATE DT_ZCK SET FSSL=" & gd1.TextArray(temp_i * t_fdcounts + 1) & ",FSBZ='" & Trim(gd1.TextArray(temp_i * t_fdcounts + 2)) & "' WHERE ZCK_BZ=" & Format(gd1.TextArray(temp_i * t_fdcounts))
Next
End Sub
'**************************************************************************************************
Private Sub m_dfzh_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If gd1.Enabled Then
gd1.SetFocus
Else
If fm_yhq.Enabled Then
If op_yhq(0).Value Then
op_yhq(0).SetFocus
Else
op_yhq(1).SetFocus
End If
Else
CMD_JS.SetFocus
End If
End If
End If
End Sub
'**************************************************************************************************
'* 功 能 : 判断对方帐号的合法性
'* 作 者 : 梁卫
'* 作成日期 : 1999.03.16
'* 修改日期 : 1999.03.16
'**************************************************************************************************
Private Sub m_dfzh_LostFocus()
Dim temp_ft As Boolean
Dim temp_tbname As String '表名
Dim temp_gdtbname As String '归档表名
Dim temp_gdqz As String '归档前缀
Dim temp_tb As Recordset
Dim temp_gd1 As Recordset
Dim temp_gd2 As Recordset
Dim temp_mfzc As Boolean
Dim temp_yn As Boolean
frm_msg.Visible = False
frm_msg.Caption = ""
temp_ft = True
If Trim(m_dfzh.Text) = "" Then
m_dfzh.SetFocus
Exit Sub
End If
If Len(Trim(m_dfzh.Text)) < 4 Then
frm_msg.Visible = True
frm_msg.Caption = "帐号不能为空"
m_dfzh.SetFocus
Exit Sub
End If
If InStr(1, SYS_SK, Left(m_dfzh.Text, 1)) <> 0 Or InStr(1, SYS_TD, Left(m_dfzh.Text, 1)) <> 0 Then
If InStr(1, SYS_SK, Left(m_dfzh.Text, 1)) <> 0 Then
temp_tbname = "DT_KRQD"
temp_gdqz = "KR"
Else
temp_tbname = "DT_TDQD"
temp_gdqz = "TD"
End If
Else
frm_msg.Visible = True
frm_msg.Caption = "不适当的帐号"
m_dfzh.SetFocus
Exit Sub
End If
temp_yn = True
'判断该帐号是否为在店客人或在店团队客人
Set temp_tb = PUB_data.OpenRecordset("SELECT * FROM " & temp_tbname & " WHERE TRIM(ZH)='" & Trim(m_dfzh.Text) & "'", 4, 0, 2)
If Not temp_tb.BOF Then '在店
temp_tb.MoveLast
temp_mfzc = temp_tb.Fields("MFZC_FT")
temp_yn = t_tools.pub_zhpd(PUB_data, SYS_GWDM, LoadResString(SYS_GW_ZW), SYS_TZYSK, SYS_SK, SYS_TD, temp_tbname, m_dfzh.Text)
If Not temp_yn Then
frm_msg.Visible = True
frm_msg.Caption = "帐号输入错误"
m_dfzh.SetFocus
Exit Sub
Else
If Not temp_mfzc Then
MsgBox "该客人没有免费早餐卡, 请与前台联系!!", vbOKOnly, "免费早餐卡回收"
End If
End If
Else '不在店
'** 客人离店, 可能跨月, 要判断两次
temp_gdtbname = temp_gdqz + Trim(Str(year(Date)))
Set temp_gd1 = PUB_data.OpenRecordset("SELECT * FROM " & temp_gdtbname & " WHERE TRIM(ZH) = '" & Trim(m_dfzh.Text) & "' AND LDRQ>=DATE-1", 4, 0, 2)
If Not temp_gd1.BOF Then
temp_gd1.MoveLast
temp_mfzc = temp_gd1.Fields("MFZC_FT")
Else
temp_gdtbname = temp_gdqz + Trim(Str(year(Date - 1)))
Set temp_gd2 = PUB_data.OpenRecordset("SELECT * FROM " & temp_gdtbname & " WHERE TRIM(ZH) = '" & Trim(m_dfzh.Text) & "' AND LDRQ>=DATE-1", 4, 0, 2)
If Not temp_gd2.BOF Then
temp_gd2.MoveLast
temp_mfzc = temp_gd2.Fields("MFZC_FT")
Else
frm_msg.Visible = True
frm_msg.Caption = "帐号没有找到!"
m_dfzh.SetFocus
Exit Sub
End If
temp_gd2.Close
End If
temp_gd1.Close
temp_yn = t_tools.pub_zhpd(PUB_data, SYS_GWDM, LoadResString(SYS_GW_ZW), SYS_TZYSK, SYS_SK, SYS_TD, temp_tbname, m_dfzh.Text)
If Not temp_yn Then
frm_msg.Visible = True
frm_msg.Caption = "帐号输入错误!"
m_dfzh.SetFocus
Exit Sub
Else
If Not temp_mfzc Then
frm_msg.Visible = True
frm_msg.Caption = "该客人已经办理离店手续, 但该客人没有免费早餐卡, 请与前台联系!!"
Else
frm_msg.Visible = True
frm_msg.Caption = "该客人已经办理离店手续...."
End If
End If
End If
temp_tb.Close
gd1.Enabled = True
gd1.SetFocus
End Sub
'**************************************************************************************************
Private Sub op_mfck_Click(Index As Integer)
Select Case Index
Case 0 '没有
m_dfzh.Text = ""
LOCAL_data.Execute "UPDATE DT_ZCK SET FSSL=0"
fm_zckbz.Enabled = False
Case 1 '有
'回收免费早餐卡
fm_zckbz.Enabled = True
gd1.Enabled = False
End Select
Dim zck_rec As Recordset
Set zck_rec = LOCAL_data.OpenRecordset("SELECT * FROM DT_ZCK ORDER BY ZCK_BZ", 4, 0, 2)
If Not zck_rec.BOF Then
zck_rec.MoveLast
End If
Call tPFlex_XSfull(gd1, t_bt, zck_rec, t_fields, t_fdcounts - 1, t_fdxs)
zck_rec.Close
End Sub
'**************************************************************************************************
Private Sub op_mfck_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If Index = 0 Then
fm_zckbz.Enabled = False
If fm_yhq.Enabled Then
If op_yhq(0).Value Then
op_yhq(0).SetFocus
Else
op_yhq(1).SetFocus
End If
Else
CMD_JS.SetFocus
End If
Else
fm_zckbz.Enabled = True
gd1.Enabled = False
m_dfzh.Enabled = True
m_dfzh.SetFocus
End If
End Sub
'**************************************************************************************************
Private Sub op_yhq_Click(Index As Integer)
If Index = 1 Then
fm_yhqsl.Enabled = True
tx_yhqsl.Enabled = True
Else
fm_yhqsl.Enabled = False
tx_yhqsl.Enabled = False
End If
End Sub
'**************************************************************************************************
Private Sub op_yhq_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If op_yhq(1).Value Then
tx_yhqsl.SetFocus
Else
CMD_JS.SetFocus
End If
End If
End Sub
'**************************************************************************************************
Private Sub tx_bz_GotFocus()
tx_bz.SelStart = 0
tx_bz.SelLength = Len(Trim(tx_bz.Text))
End Sub
'**************************************************************************************************
Private Sub tx_dfzh_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If fm_zck.Enabled Then
If op_mfck(0).Value Then
op_mfck(0).SetFocus
Else
op_mfck(1).SetFocus
End If
Else
If op_yhq(0).Value Then
op_yhq(0).SetFocus
Else
op_yhq(1).SetFocus
End If
End If
End If
End Sub
'**************************************************************************************************
'* 挂帐结算时使用
Private Sub tx_dfzh_LostFocus()
Dim ctrl_rec As Recordset
Dim temp_zhsw As String '街帐帐号首位
'调用 ZW_ZHQR 函数时使用的变量
Dim temp_qr As Boolean
Dim temp_yn As Boolean
Dim temp_ft As Boolean
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -