📄 u_web_vno.pas
字号:
case j of
3, 8:
begin
if round(strtodate(cells[j, i]) - strtodate(m_adate)) < 0 then
begin
MessageDlg(iif(j = 3, cells[0, i], cells[5, i]) + ' ' + cells[j, 0] + pre_msg + iif(m_lang = 1, '抵达日期[', 'ARR DATE [') + m_adate + ']', mtinformation, [mbok], 0);
row := i;
col := j;
setfocus;
abort;
end;
if round(strtodate(cells[j, i]) - strtodate(gstr_pubdate)) < 0 then
begin
MessageDlg(iif(j = 3, cells[0, i], cells[5, i]) + ' ' + cells[j, 0] + pre_msg + sys_day, mtinformation, [mbok], 0);
cells[j, i] := gstr_pubdate;
row := i;
col := j;
setfocus;
abort;
end;
end;
4, 9:
begin
if round(strtodate(cells[j, i]) - strtodate(gstr_pubdate)) < 0 then
begin
MessageDlg(iif(j = 3, cells[0, i], cells[5, i]) + ' ' + cells[j, 0] + pre_msg + sys_day, mtinformation, [mbok], 0);
cells[j, i] := gstr_pubdate;
row := i;
col := j;
setfocus;
abort;
end;
if round(strtodate(cells[j, i]) - strtodate(m_ddate)) > 0 then
begin
MessageDlg(iif(j = 3, cells[0, i], cells[5, i]) + ' ' + cells[j, 0] + late_msg + iif(m_lang = 1, '离店日期[', 'DEPA DATE [') + m_ddate + ']', mtinformation, [mbok], 0);
row := i;
col := j;
setfocus;
abort;
end;
if round(strtodate(cells[j, i]) - strtodate(cells[j - 1, i])) < 0 then
begin
MessageDlg(iif(j = 3, cells[0, i], cells[5, i]) + ' ' + cells[j, 0] + pre_msg + iif(m_lang = 1, '生效日期!', 'BEG DATE'), mtinformation, [mbok], 0);
col := j;
setfocus;
abort;
end;
end;
end;
end;
end;
procedure TF_WEB_VNO.BN_OKClick(Sender: TObject);
var
i, j, k: integer;
s, s1, g_stf: string;
m_state: boolean;
begin
g_diff := 0;
case m_diff of
13:
begin
tran_str := '';
s := '';
with sg_jl do
for i := 1 to rowcount - 1 do
for j := 0 to colcount - 1 do
begin
getcheckboxstate(j, i, m_state);
if m_state then
begin
s := s + cells[j + colcount * 2, i] + ':';
//g_stf := g_stf + ',' + cells[j, i];
end;
end;
if length(s) > 0 then
begin
g_diff := 1;
tran_str := s;
end;
close;
end;
else
begin
tran_str := '';
//g_stf := '';
s := '';
check_sg_date;
with sg_jl do
for i := 1 to rowcount - 1 do
for j := 0 to colcount - 1 do
case j of
0, 5:
begin
getcheckboxstate(j, i, m_state);
if m_state then
begin
s := s + cells[j + colcount * 2, i] + '*';
//g_stf := g_stf + ',' + cells[j, i] + iif(cells[j + 1, i] = '', '', '*' + getstr(cells[j + 1, i], ''));
end;
end;
end;
if savetodb then
begin
if length(s) > 0 then
begin
g_diff := 1;
//g_stf := copy(g_stf, 2, 120);
end;
close;
end;
end;
end;
end;
procedure TF_WEB_VNO.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
action := cafree;
end;
procedure TF_WEB_VNO.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case key of
VK_RETURN:
if (ActiveControl.Tag = 0) then
Perform(WM_NEXTDLGCTL, 0, 0)
else
DealTag(sender, 1, ActiveControl.Tag, key);
VK_DOWN:
if not (Activecontrol.name = 'SG_JL') then
Perform(WM_NEXTDLGCTL, 0, 0);
VK_UP:
if not (Activecontrol.name = 'SG_JL') then
Perform(WM_NEXTDLGCTL, 1, 0);
VK_F2:
if bn_ok.Enabled then
bn_okclick(sender);
VK_F5:
if bn_tsfw.Enabled and bn_tsfw.Visible then
bn_tsfwclick(sender);
VK_ESCAPE:
if bn_back.Enabled then
bn_backclick(sender);
end;
end;
procedure TF_WEB_VNO.BN_BACKClick(Sender: TObject);
begin
tran_str := '';
g_diff := 2;
close;
end;
procedure TF_WEB_VNO.BN_TSFWClick(Sender: TObject);
begin
case m_diff of
20:
begin
g_diff := 224;
//tran_str := 'room:' + ed_room.text + '*folio_m:' + analy_str('folio_m', m_str) + '*';
F_web_NO := TF_web_NO.create(self);
F_web_NO.ShowModal;
end;
22:
begin
g_diff := 31;
with sg_jl do
begin
if row < 1 then
exit;
if not check_sg(sg_jl, row, true) then
exit;
updrow := row;
tran_str := 'folio:' + cells[0, row] + '*adate:' + cells[1, row] + '*ddate:' + cells[2, row] + '*m_no:' + analy_str('m_no', m_str) + '*';
{F_web_DYQZRQ := TF_web_DYQZRQ.create(self);
F_web_DYQZRQ.ShowModal;
if g_bsel then
begin
end;}
end;
end;
else
begin
g_diff := 169;
tran_str := 'room:' + '*';
F_web_NO := TF_web_NO.create(self);
F_web_NO.ShowModal;
end;
end;
end;
procedure TF_WEB_VNO.SG_JLKeyPress(Sender: TObject; var Key: Char);
var
s: string;
b_state: boolean;
begin
with sg_jl do
case m_diff of
5:
case col of
1, 2, 6, 7:
begin
getcheckboxstate((col div 5) * 5, row, b_state);
s := getstr(cells[col + colcount, row]);
if b_state and (s = '1') and (length(cells[col, row]) < 2) then
key := only_num(key)
else
if key <> #8 then
key := #0;
end;
3, 4, 8, 9:
begin
getcheckboxstate((col div 5) * 5, row, b_state);
if b_state and (length(cells[col, row]) < 11) then
key := only_dat(key)
else
if key <> #8 then
key := #0;
end;
else
key := #0;
end;
15:
case col of
0, 3, 6, 9:
key := #0;
else
begin
getcheckboxstate((col div 3) * 3, row, b_state);
s := getstr(cells[col + colcount, row]);
if b_state and (s = '1') and (length(cells[col, row]) < 2) then
key := only_num(key)
else
if key <> #8 then
key := #0;
end;
end;
16:
case col of
0, 2, 4, 6:
key := #0;
else
begin
getcheckboxstate((col div 2) * 2, row, b_state);
s := getstr(cells[col + colcount, row]);
if b_state and (s = '1') and (length(cells[col, row]) < 2) then
key := only_num(key)
else
if key <> #8 then
key := #0;
end;
end;
20:
case col of
1, 5:
begin
getcheckboxstate((col div 4) * 4, row, b_state);
if b_state and (length(cells[col, row]) < 5) then
key := only_mon(key)
else
if key <> #8 then
key := #0;
end;
2, 3, 6, 7:
begin
getcheckboxstate((col div 4) * 4, row, b_state);
if b_state and (length(cells[col, row]) < 11) then
key := only_dat(key)
else
if key <> #8 then
key := #0;
end;
else
key := #0;
end;
21, 22:
case col of
1, 2:
begin
getcheckboxstate(0, row, b_state);
if b_state and (length(cells[col, row]) < 11) then
key := only_dat(key)
else
if key <> #8 then
key := #0;
end;
else
key := #0;
end;
23:
case col of
0, 2, 4, 6, 8:
key := #0;
else
begin
getcheckboxstate((col div 2) * 2, row, b_state);
s := getstr(cells[col + colcount, row]);
if b_state and (s = '1') and (length(cells[col, row]) < 2) then
key := only_num(key)
else
if key <> #8 then
key := #0;
end;
end;
end;
end;
procedure TF_WEB_VNO.SG_JLCheckBoxClick(Sender: TObject; ACol,
ARow: Integer; State: Boolean);
var
s: string;
begin
case m_diff of
2, 5, 10, 12, 17..18:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -