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

📄 frm_dbmain.pas

📁 用Delhpi和mapx开发的警务管理系统
💻 PAS
字号:
unit frm_DBMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, frm_MainBase, Menus, ImgList, ActnList, ComCtrls, Base_ListView,
  OleCtrls, MapXLib_TLB, ExtCtrls, Base_Panel, Buttons, ToolWin, StdCtrls,
  Base_BitBtn, Base_ComboBox, Base_StaticText,adodb, Base_LabeledEdit,
  Base_DateTimePicker, MPlayer;

type
  TForm_DBMain = class(TForm_MainBase)
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    N6: TMenuItem;
    N7: TMenuItem;
    N36: TMenuItem;
    N37: TMenuItem;
    N38: TMenuItem;
    N39: TMenuItem;
    N40: TMenuItem;
    N41: TMenuItem;
    N42: TMenuItem;
    N43: TMenuItem;
    N44: TMenuItem;
    N45: TMenuItem;
    N46: TMenuItem;
    N47: TMenuItem;
    N48: TMenuItem;
    N49: TMenuItem;
    N50: TMenuItem;
    N51: TMenuItem;
    N52: TMenuItem;
    N53: TMenuItem;
    N54: TMenuItem;
    N55: TMenuItem;
    N56: TMenuItem;
    N57: TMenuItem;
    N58: TMenuItem;
    N21: TMenuItem;
    N23: TMenuItem;
    N25: TMenuItem;
    N63: TMenuItem;
    Action_DoorADD: TAction;
    N68: TMenuItem;
    N22: TMenuItem;
    N24: TMenuItem;
    Action_PermanentPopuAdd: TAction;
    Action_StayPopuAdd: TAction;
    Action_CompanyAdd: TAction;
    Action_CaseAdd: TAction;
    Action_WorkObjectAdd: TAction;
    N26: TMenuItem;
    N27: TMenuItem;
    N28: TMenuItem;
    N29: TMenuItem;
    N31: TMenuItem;
    N32: TMenuItem;
    Action_DoorSelect: TAction;
    Action_PermanentPopuSelect: TAction;
    Action_StayPopuSelect: TAction;
    Action_CompanySelect: TAction;
    Action_CaseSelect: TAction;
    Action_WorkObjectSelect: TAction;
    Action_PoliceDoorPlate: TAction;
    Action_PoliceCompany: TAction;
    Action_PolicePerPopu: TAction;
    Action_PoliceStayPopu: TAction;
    Action_PoliceCase: TAction;
    Action_PoliceObject: TAction;
    N64: TMenuItem;
    Action_PoliceAdd: TAction;
    Action_PoliceSelect: TAction;
    N65: TMenuItem;
    N66: TMenuItem;
    N69: TMenuItem;
    N70: TMenuItem;
    N71: TMenuItem;
    N72: TMenuItem;
    N73: TMenuItem;
    Action_Exit: TAction;
    N74: TMenuItem;
    Action_Criminal: TAction;
    N33: TMenuItem;
    N221: TMenuItem;
    N331: TMenuItem;
    N441: TMenuItem;
    N551: TMenuItem;
    N661: TMenuItem;
    N771: TMenuItem;
    MPlay: TMediaPlayer;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    ToolButton5: TToolButton;
    ToolButton6: TToolButton;
    ToolButton7: TToolButton;
    ToolButton8: TToolButton;
    ToolButton9: TToolButton;
    ToolButton10: TToolButton;
    ToolButton11: TToolButton;
    ToolButton12: TToolButton;
    ToolButton13: TToolButton;
    ToolButton14: TToolButton;
    ToolButton15: TToolButton;
    ToolButton16: TToolButton;
    ToolButton17: TToolButton;
    ToolButton18: TToolButton;
    ToolButton19: TToolButton;
    ToolButton20: TToolButton;
    ToolButton21: TToolButton;
    ToolButton22: TToolButton;
    ToolButton23: TToolButton;
    ToolButton24: TToolButton;
    ToolButton25: TToolButton;
    ToolButton26: TToolButton;
    ToolButton27: TToolButton;
    ToolButton28: TToolButton;
    ToolButton29: TToolButton;
    ToolButton30: TToolButton;
    ToolButton31: TToolButton;
    ToolButton32: TToolButton;
    ToolButton33: TToolButton;
    ToolButton34: TToolButton;
    ToolButton35: TToolButton;
    ToolButton36: TToolButton;
    ToolButton37: TToolButton;
    ToolButton38: TToolButton;
    ToolButton39: TToolButton;
    ToolButton40: TToolButton;
    ToolButton41: TToolButton;
    ToolButton42: TToolButton;
    ToolButton43: TToolButton;
    procedure Action_DoorADDExecute(Sender: TObject);
    procedure Action_PermanentPopuAddExecute(Sender: TObject);
    procedure Action_StayPopuAddExecute(Sender: TObject);
    procedure Action_WorkObjectAddExecute(Sender: TObject);
    procedure Action_CaseAddExecute(Sender: TObject);
    procedure Action_CompanyAddExecute(Sender: TObject);
    procedure Action_CaseSelectExecute(Sender: TObject);
    procedure Action_DoorSelectExecute(Sender: TObject);
    procedure Action_PermanentPopuSelectExecute(Sender: TObject);
    procedure Action_StayPopuSelectExecute(Sender: TObject);
    procedure Action_CompanySelectExecute(Sender: TObject);
    procedure Action_WorkObjectSelectExecute(Sender: TObject);
    procedure Action_PoliceDoorPlateExecute(Sender: TObject);
    procedure Action_PoliceCompanyExecute(Sender: TObject);
    procedure Action_PoliceCaseExecute(Sender: TObject);
    procedure Action_PoliceObjectExecute(Sender: TObject);
    procedure Action_PolicePerPopuExecute(Sender: TObject);
    procedure Action_PoliceStayPopuExecute(Sender: TObject);
    procedure Action_PoliceAddExecute(Sender: TObject);
    procedure Action_PoliceSelectExecute(Sender: TObject);
    procedure Action_ExitExecute(Sender: TObject);
    procedure Action_CriminalExecute(Sender: TObject);
    procedure Timer2Timer(Sender: TObject);
  private
    { Private declarations }
    blnFlash:boolean;
    procedure Policetheme(sLayerName:string;sFieldName:string;sThemeName:string;sSubTitle:string;iStyle:integer;Sender: TObject);

  public
    { Public declarations }
  end;

var
  Form_DBMain: TForm_DBMain;

implementation

uses frm_Basic, frmSystemDM, cls_LayerControl, frm_EscapeCriminal;

{$R *.dfm}

procedure TForm_DBMain.Action_DoorADDExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'DOORPLATE','',0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_PermanentPopuAddExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'PermanentPopu','',0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_StayPopuAddExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'StayPopu','',0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_WorkObjectAddExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'WorkObject','',0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_CaseAddExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'CASERecord','',0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_CompanyAddExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'COMPANY','',0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_CaseSelectExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'CASERecord','',3,'CASE_S',Map_main,1) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_DoorSelectExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'DOORPLATE','',3,'DOORPLATE_S',Map_main,0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_PermanentPopuSelectExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'PermanentPopu','',3,'PermanentPopu',Map_main,0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_StayPopuSelectExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'StayPopu','',3,'StayPopu',Map_main,0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_CompanySelectExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'COMPANY','',3,'',Map_main,0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_WorkObjectSelectExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'WorkObject','',3,'',Map_main,0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Policetheme(sLayerName:string;sFieldName:string;sThemeName:string;sSubTitle:string;iStyle:integer;Sender: TObject);
var
  iLoop:integer;
  strSql:string;
  adoQue:TADOQuery;
  firstString,lastString:string;
  ipos:integer;
begin
  inherited;
  if TMenuItem(Sender).Checked = true then
  begin
    Map_main.DataSets.Item[sLayerName].Themes.Remove(sThemeName);
    TMenuItem(Sender).Checked:=false;
  end
  else
  begin
    Map_main.DataSets.Item[sLayerName].Themes.Add(iStyle,sFieldName,sThemeName,EmptyParam);
    Map_main.DataSets.Item[sLayerName].Themes.Item[sThemeName].Legend.Title:= '专题图';
    Map_main.DataSets.Item[sLayerName].Themes.Item[sThemeName].Legend.SubTitle:= sSubTitle;
    if iStyle<>miThemePieChart then
    begin
      with Map_main.DataSets.Item[sLayerName].Themes.Item[sThemeName].Legend.LegendTexts do
      begin
        for iLoop:=1 to Map_main.DataSets.Item[sLayerName].Themes.Item[sThemeName].Legend.LegendTexts.Count do
        begin
          ipos:=pos(',',item[iLoop].Text);
          while ipos <>0 do
          begin
            firstString:= copy(item[iLoop].Text,1,ipos-1);
            lastString:=copy(item[iLoop].Text,ipos+1,length(item[iLoop].Text) - iPos);
            Item[iLoop].Text:=firstString + lastString;
            ipos:=pos(',',item[iLoop].Text);
          end;
          strSql:='select * from POLICEHOUSE where ID=' + inttostr(strtoint(Item[iLoop].Text));
          adoQue:=systemDM.Glb_BasicDataOperate.adoGetAdoQuery(strSql);
          try
            Item[iLoop].Text:=adoQue.fieldbyname('NAME').AsString;
          except on e:Exception do
          begin
            ShowMessage(e.Message);
            exit;
          end;
          end;
        end;
      end;
    end;
    TMenuItem(Sender).Checked:=True;
  end;
end;
procedure TForm_DBMain.Action_PoliceDoorPlateExecute(Sender: TObject);
begin
  inherited;
  Policetheme('DOORPLATE_S','POLICEHOUSE','Police_Door','派出所-门牌', miThemeIndividualValue, Sender);
end;



procedure TForm_DBMain.Action_PoliceCompanyExecute(Sender: TObject);
begin
  inherited;
  Policetheme('COMPANYDATASET','NUMCOUNT','Police_Company','派出所-单位',miThemePieChart,Sender);
end;

procedure TForm_DBMain.Action_PoliceCaseExecute(Sender: TObject);
begin
  inherited;
  Policetheme('CaseRecordDataSet','NUMCOUNT','Police_Case','派出所-发案纪录',miThemePieChart,Sender);
end;

procedure TForm_DBMain.Action_PoliceObjectExecute(Sender: TObject);
begin
  inherited;
  Policetheme('WORKOBJECTDATASET','NUMCOUNT','Police_Object','派出所-工作对象',miThemePieChart,Sender);

end;

procedure TForm_DBMain.Action_PolicePerPopuExecute(Sender: TObject);
begin
  inherited;
  Policetheme('PEOPLEDOORPLATEDATASET','NUMCOUNT','Police_PerPopu','门牌-常住人口',miThemePieChart,Sender);
end;

procedure TForm_DBMain.Action_PoliceStayPopuExecute(Sender: TObject);
begin
  inherited;
  Policetheme('StayPEOPLEDOORPLATEDATASET','NUMCOUNT','Police_PerPopu','门牌-暂住人口',miThemePieChart,Sender);
end;

procedure TForm_DBMain.Action_PoliceAddExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'PoliceHouse','',0) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_PoliceSelectExecute(Sender: TObject);
begin
  inherited;
  With TForm_Basic.create(systemDM.Glb_BasicDataOperate,'PoliceHouse','',3,'POLICEHOUSE_S',Map_main,1) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Action_ExitExecute(Sender: TObject);
begin
  inherited;
  self.Close;
  self.Free;
end;

procedure TForm_DBMain.Action_CriminalExecute(Sender: TObject);
begin
  inherited;
  with TForm_EscapeCriminal.Create(application,Map_main,adoCriminalQue) do
  begin
    try
      ShowModal;
    finally
      free;
    end;
  end;
end;

procedure TForm_DBMain.Timer2Timer(Sender: TObject);
var
  tempName:string;
begin
  inherited;
  {if Map_main.Layers['DOORPLATE_S'].Selection.Count<>0 then
  begin
    if tempFtrs<>nil then
    begin
      Map_main.Layers['DOORPLATE_S'].Selection.Remove(tempFtrs);
      ToolButton22.ImageIndex:=-1;
    end;
  end
  else
  begin
    if tempFtrs<>nil then
    begin
      Map_main.Layers['DOORPLATE_S'].Selection.Add(tempFtrs);
      ToolButton22.ImageIndex:=12;
    end;
  end;}

  if (tempFtrs<>nil) and (blnFlash=False) and (Map_main.CurrentTool<>miSelectTool) and (Map_main.CurrentTool<>miRadiusSelectTool) and
  (Map_main.CurrentTool<>miRectSelectTool) and (Map_main.CurrentTool<>miPolygonSelectTool) then
  begin
      Map_main.Layers['DOORPLATE_S'].Selection.Add(tempFtrs);
      ToolButton22.ImageIndex:=12;
      blnFlash:=true;
      tempName:=ExtractFilePath(Application.ExeName) + '\Media' +'\ding.wav';
      MPlay.FileName:=tempName;
      MPlay.Open;
      MPlay.Play;
  end
  else if (tempFtrs<>nil) and (blnFlash=true) and (Map_main.CurrentTool<>miSelectTool) and (Map_main.CurrentTool<>miRadiusSelectTool) and
  (Map_main.CurrentTool<>miRectSelectTool) and (Map_main.CurrentTool<>miPolygonSelectTool) then
  begin
      Map_main.Layers['DOORPLATE_S'].Selection.Remove(tempFtrs);
      ToolButton22.ImageIndex:=-1;
      blnFlash:=false;
  end;
end;

end.

⌨️ 快捷键说明

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