⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainform.pas

📁 主要是介绍DELPHI三层应用以及分布式数据库的应用
💻 PAS
📖 第 1 页 / 共 2 页
字号:
            end;

            for j:=0 to mainmenu.items.items[i].count-1 do
            begin
                mainmenu.items.items[i].items[j].enabled:=true;
            end;
        end;
       end
       else
       begin
       for i:=0 to mainmenu.items.count-1 do
        begin
            if (mainmenu.Items[i].Caption='帮助')  then
            begin
                continue;
            end;

            if (mainmenu.Items[i].Caption='佣金管理') then
            begin
               mainmenu.Items[i].Visible :=false;
               continue;
            end;

            if (mainmenu.Items[i].Caption='机构管理') then
            begin
                 mainmenu.Items[i].Visible :=false;
                 continue;
            end;

            for j:=0 to mainmenu.items.items[i].count-1 do
            begin
                mainmenu.items.items[i].items[j].enabled:=false;

                //showmessage(mainmenu.items.items[i].items[j].caption);

                if muserright.values[mainmenu.items.items[i].items[j].caption]='1' then
                begin
                    mainmenu.items.items[i].items[j].Enabled:=true;
                end;
                if (mainmenu.items.items[i].items[j].caption='退出') or
                (mainmenu.items.items[i].items[j].caption='重新登录') or
                (mainmenu.items.items[i].items[j].caption='修改密码') then
                begin
                    mainmenu.items.items[i].items[j].Enabled:=true;
                end;
            end;
        end;
       end;
        
       end; 

   end
   else
   begin
        menu:=mainmenu1;
   end;
   fm_fdlogin.free;
   self.Caption :='震雄机械管理信息系统-'+unit_wxp.myOffice ;
end;

procedure Tmain_form.N26Click(Sender: TObject);
begin
   if not assigned(fm_rightset) then
   Application.CreateForm(tfm_rightset, fm_rightset);
     fm_rightset.Show;
end;

procedure Tmain_form.FormCreate(Sender: TObject);
begin
     menu:=mainmenu1;

end;

procedure Tmain_form.N30Click(Sender: TObject);
begin
     unit_wxp.datastyle :='up';
     Application.CreateForm(Tfm_databack, fm_databack);
     fm_databack.BitBtn2.Enabled :=false;
     fm_databack.Button2.Visible :=false;
     fm_databack.BitBtn2.Visible :=false;
     fm_databack.Edit1.Text  :='backdata';
     fm_databack.Caption :='数据上报';


     fm_databack.showmodal;
end;

procedure Tmain_form.N31Click(Sender: TObject);
begin
     unit_wxp.datastyle :='down';
     Application.CreateForm(Tfm_databack, fm_databack);
     fm_databack.BitBtn1.Enabled :=false;
     fm_databack.BitBtn2.Enabled :=false;
     fm_databack.RadioGroup1.Visible  :=false;
     fm_databack.GroupBox2.Visible :=false;
     fm_databack.Button1.Visible :=false;
     fm_databack.BitBtn1.Visible :=false;     
     fm_databack.Caption :='数据接收';

     fm_databack.showmodal;
end;

procedure Tmain_form.N32Click(Sender: TObject);
begin
     Application.CreateForm(tfm_changepass, fm_changepass);
     fm_changepass.Showmodal;
     fm_changepass.free;

end;

procedure Tmain_form.N34Click(Sender: TObject);
begin
     Application.CreateForm(Tform_databack, form_databack);
     form_databack.showmodal;
end;

procedure Tmain_form.N35Click(Sender: TObject);
begin
     showmessage('注意:初始化可能删除所有记录,请先备份所有数据');
        Application.CreateForm(Tfm_fdlogin, fm_fdlogin);
        if fm_fdlogin.ShowModal =idok then
                Application.CreateForm(TForm_initial, Form_initial)
        else
                exit;

     Form_initial.showmodal;
end;

procedure Tmain_form.N39Click(Sender: TObject);
begin
   unit_wxp.SearchSql := 'select * from  pub_z_client where ' ;
   unit_wxp.FinalSql :=  'select * from  pub_z_client ' ;

   if not assigned(frm_cstm) then
         application.createform(Tfrm_cstm,frm_cstm);
         frm_cstm.show    ;
   end;

procedure Tmain_form.N40Click(Sender: TObject);
begin
 if not assigned(frm_visitold) then
    application.createform(Tfrm_visitold,frm_visitold);
    frm_visitold.show;
 end;

procedure Tmain_form.N41Click(Sender: TObject);
begin
  if not assigned(frm_complaint) then
    application.createform(Tfrm_complaint,frm_complaint);
    frm_complaint.show
  end;

procedure Tmain_form.N36Click(Sender: TObject);
begin
 if not assigned(frm_office) then
    application.createform(Tfrm_office,frm_office);
    frm_office.show
  end;



procedure Tmain_form.N42Click(Sender: TObject);
begin
  if not assigned(frm_stuff) then
    application.createform(Tfrm_stuff,frm_stuff);
    frm_stuff.show
  end;



procedure Tmain_form.N43Click(Sender: TObject);
begin
  if not assigned(Frm_basepay_base) then
    application.createform(TFrm_basepay_base,Frm_basepay_base);
    Frm_basepay_base.show
  end;


procedure Tmain_form.N45Click(Sender: TObject);
begin
 application.createform(Tfrm_stdtable,frm_stdtable);
end;

procedure Tmain_form.N47Click(Sender: TObject);
begin
 if not assigned(Frm_yearratio) then
     application.createform(TFrm_yearratio,Frm_yearratio);
     Frm_yearratio.show
  end;



procedure Tmain_form.N48Click(Sender: TObject);
begin
    if not assigned(frm_bonusratio) then
     application.createform(Tfrm_bonusratio,frm_bonusratio);
     frm_bonusratio.show
  end;



procedure Tmain_form.N49Click(Sender: TObject);
begin
 if not assigned(frm_bonusratio1) then
     application.createform(Tfrm_bonusratio1,frm_bonusratio1);
     frm_bonusratio1.show
  end;



procedure Tmain_form.N50Click(Sender: TObject);
begin
  if not assigned(Frm_saleratio) then
     application.createform(TFrm_saleratio,Frm_saleratio);
     Frm_saleratio.show
  end;



procedure Tmain_form.N52Click(Sender: TObject);
begin
     if not assigned(frm_mainpay) then
     application.createform(Tfrm_mainpay,frm_mainpay);
     frm_mainpay.show
    end;



procedure Tmain_form.N53Click(Sender: TObject);
begin
 if not assigned(frm_officepay) then
     application.createform(Tfrm_officepay,frm_officepay);
    frm_officepay.show
  end;



procedure Tmain_form.N54Click(Sender: TObject);
begin
    if not assigned(frm_monthdeliver) then
     application.createform(Tfrm_monthdeliver,frm_monthdeliver);
    frm_monthdeliver.show
  end;



procedure Tmain_form.N55Click(Sender: TObject);
begin
  if not assigned(frm_foryearbonus) then
    application.createform(Tfrm_foryearbonus,frm_foryearbonus);
    frm_foryearbonus.show
  end;



procedure Tmain_form.N56Click(Sender: TObject);
begin
  if not assigned(frm_ybnsdeliver) then
    application.createform(Tfrm_ybnsdeliver,frm_ybnsdeliver);
    frm_ybnsdeliver.show
  end;



procedure Tmain_form.N57Click(Sender: TObject);
begin
  if not assigned(frm_ybnsdeliver1) then
    application.createform(Tfrm_ybnsdeliver1,frm_ybnsdeliver1);
    frm_ybnsdeliver1.show
  end;



procedure Tmain_form.N59Click(Sender: TObject);
begin
  if not assigned(frm_salededuct) then
    application.createform(Tfrm_salededuct,frm_salededuct);
    frm_salededuct.show
  end;


procedure Tmain_form.N60Click(Sender: TObject);
begin
  if not assigned(frm_saledistribute) then
    application.createform(Tfrm_saledistribute,frm_saledistribute);
    frm_saledistribute.show
  end;



procedure Tmain_form.N61Click(Sender: TObject);
begin
  if not assigned(frm_fare) then
    application.createform(Tfrm_fare,frm_fare);
    frm_fare.show
  end;



procedure Tmain_form.N63Click(Sender: TObject);
begin
 unit_wxp.SearchSql := 'select * from pub_z_machine_in where ' ;
 unit_wxp.FinalSql :=  'select * from pub_z_machine_in' ;
 if not assigned(Form_machine_innew) then
 Application.CreateForm(TForm_machine_innew, Form_machine_innew);
 Form_machine_innew.Show;

end;

procedure Tmain_form.N64Click(Sender: TObject);
begin

unit_wxp.SearchSql := 'select pub_z_machine_out.* from  pub_z_machine_out where ' ;
unit_wxp.FinalSql :=  'select pub_z_machine_out.* from  pub_z_machine_out' ;
 if not assigned(Form_machine_out) then
Application.CreateForm(TForm_machine_out, Form_machine_out);
Form_machine_out.Show;
end;

procedure Tmain_form.N65Click(Sender: TObject);
begin
 if not assigned(Form_contract_order) then
 Application.CreateForm(TForm_contract_order, Form_contract_order);
 unit_wxp.FinalSql :='select * from pub_z_contract';
 unit_wxp.SearchSql :='select * from pub_z_contract where ';
 Form_contract_order.show;
end;

procedure Tmain_form.N66Click(Sender: TObject);
begin
  if not assigned(Form_zx_cjd) then
  application.CreateForm(TForm_zx_cjd,Form_zx_cjd );
  unit_wxp.FinalSql :='SELECT * FROM pub_z_contract_machine_requisition';
  unit_wxp.SearchSql :='SELECT * FROM pub_z_contract_machine_requisition where ';
  Form_zx_cjd.Show;  //TForm_zx_cjd 震雄的出机单
end;

procedure Tmain_form.N67Click(Sender: TObject);
begin
unit_wxp.FinalSql := 'SELECT * FROM pub_z_contract_machine_requisition_ys ';
unit_wxp.SearchSql := 'SELECT * FROM pub_z_contract_machine_requisition_ys where ';
if not assigned(Form_ys_cjd) then
application.CreateForm(TForm_ys_cjd,Form_ys_cjd );
Form_ys_cjd.Show;  //TForm_zx_cjd 震雄的出机单
end;

procedure Tmain_form.N69Click(Sender: TObject);
begin
 unit_wxp.FinalSql :='select * from pub_z_contract';
 unit_wxp.SearchSql :='select * from pub_z_contract where ';
 if not assigned(Form_contract_tract) then
 Application.CreateForm(TForm_contract_tract, Form_contract_tract);
 Form_contract_tract.show;
end;

procedure Tmain_form.N72Click(Sender: TObject);
begin
 unit_wxp.FinalSql :='select * from pub_z_transit_proxy';
 unit_wxp.SearchSql :='select * from pub_z_transit_proxy where ';
 if not assigned(Form_transit_proxy) then
 Application.CreateForm(TForm_transit_proxy, Form_transit_proxy);
 Form_transit_proxy.show;
end;

procedure Tmain_form.N73Click(Sender: TObject);
begin
Application.CreateForm(TForm_std_machine, Form_std_machine);
Form_std_machine.show;
end;

procedure Tmain_form.N38Click(Sender: TObject);
begin
     Application.CreateForm(TForm_officemanage, Form_officemanage);
     Form_officemanage.ADOQuery1.Active:=false ;
     Form_officemanage.ADOQuery1.SQL.Clear ;
     Form_officemanage.ADOQuery1.SQL.Add('select * from PartLeft where 办事处='''+
     unit_wxp.myOffice +'''');
     Form_officemanage.ADOQuery1.active:=true;
     Form_officemanage.showmodal;

end;

procedure Tmain_form.N79Click(Sender: TObject);
begin
//   Application.CreateForm(Tfm_fdlogin, fm_fdlogin);
//   if fm_fdlogin.showmodal=idok then
//   begin
        showmessage('注意:重新注册办事处可能删除所有记录,请先备份所有数据');
        Application.CreateForm(Tfm_fdlogin, fm_fdlogin);
        if fm_fdlogin.ShowModal =idok then
                Application.CreateForm(Tform_register, form_register)
        else
                exit;
        form_register.Caption :='初始化所有数据然后重新注册';
        if form_register.showmodal=idok then
           menu:=mainmenu1;
//   end;

end;

procedure Tmain_form.N76Click(Sender: TObject);
begin
unit_wxp.FinalSql :='select * from pub_z_cjqk';
unit_wxp.SearchSql :='select * from pub_z_cjqk where ';
if not assigned(Form_cjqk) then
Application.CreateForm(TForm_cjqk, Form_cjqk);
Form_cjqk.show;
end;

procedure Tmain_form.N77Click(Sender: TObject);
begin

unit_wxp.FinalSql :='select * from pub_z_thqk';
unit_wxp.SearchSql :='select * from pub_z_thqk where ';
if not assigned(Form_thqk) then
Application.CreateForm(TForm_thqk, Form_thqk);
Form_thqk.show;
end;

procedure Tmain_form.N74Click(Sender: TObject);
begin

 unit_wxp.FinalSql :='select * from pub_z_machine_outpay';
 unit_wxp.SearchSql :='select * from pub_z_machine_outpay where ';
 if not assigned(Form_cjyfk) then
 Application.CreateForm(TForm_cjyfk, Form_cjyfk);
 Form_cjyfk.show    ;

end;

procedure Tmain_form.N75Click(Sender: TObject);
begin
 unit_wxp.FinalSql :='select * from pub_z_hk_in';
  unit_wxp.SearchSql :='select * from pub_z_hk_in where ';
  if not assigned(Form_hkhs) then
  Application.CreateForm(TForm_hkhs, Form_hkhs);
  Form_hkhs.show;
end;

procedure Tmain_form.N82Click(Sender: TObject);
begin
     Application.CreateForm(TForm_datacover, Form_datacover);
     Form_datacover.showmodal;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -