procedure TBM_BENMENF.N_editClick(Sender: TObject);
begin
b_pd := false;
Node_Child := Treeview.selected;
if Node_Child.level = 0 then
begin
Application.messagebox('最顶层不能编辑,请在下层编辑', '物资管理系统', mb_iconinformation + mb_defbutton1);
exit;
end;
//设置按扭有效性
button_valid;
Node_Parent := Node_Child.parent;
if Node_Parent.level = 0 then
begin
DM.BUMEN.edit;
DM.BUMEN.FieldByName('部门编码').editmask := '99;1;_';
pagecontrol1.ActivePageIndex := 0;
//DBEdt_Bmbm.setfocus;
end;
if Node_Parent.level = 1 then
begin
DM.BUMEN.edit;
DM.BUMEN.FieldByName('部门编码').editmask := '99-99;1;_';
pagecontrol1.ActivePageIndex := 0;
//DBEdt_Bmbm.setfocus;
end;
end;
procedure TBM_BENMENF.N_cancelClick(Sender: TObject);
begin
DM.BUMEN.cancel;
button_valid;
end;
procedure TBM_BENMENF.N_saveClick(Sender: TObject);
var
s_bm, s_mc: string;
begin
if Node_Parent.level = 0 then
begin
if length(trim(DBEdt_Bmbm.text)) <> 2 then
begin
Application.messagebox('编码应为两位', '北明办公管理系统', mb_iconinformation + mb_defbutton1);
exit;
end;
end;
if Node_Parent.level = 1 then
begin
if copy(DBEdt_Bmbm.text, 1, 2) <> copy(Node_Parent.text, 2, 2) then
begin
Application.messagebox('前面两位不能变,请确认!', '北明办公管理系统', mb_iconinformation + mb_defbutton1);
DBEdt_Bmbm.text := copy(Node_Parent.text, 2, 2);
exit;
end;
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] ... 下一页 >>