Ver código fonte

Merge branch 'master' of http://192.168.1.12:3000/MaiXinRong/Measure

CSL 9 anos atrás
pai
commit
2c4cae5a07

+ 19 - 21
DataModules/BGLDm.pas

@@ -400,7 +400,7 @@ procedure TBGLData.cdsBGBillsViewBeforePost(DataSet: TDataSet);
     cdsBGBillsViewUnits.Tag := 0;
     cdsBGBillsViewPrice.Tag := 0;
     cdsBGBillsViewQuantity.Tag := 0;
-    ShowErrorMessage(AHint);
+    ErrorMessage(AHint);
     Abort;
   end;
 
@@ -428,9 +428,7 @@ begin
   if cdsBGBillsViewB_Code.Tag = 1 then
     if CheckSameB_Code(cdsBGBillsViewBGID.AsInteger, cdsBGBillsViewB_Code.AsString) then
     begin
-      cdsBGBillsViewB_Code.Tag := 0;
-      ShowErrorMessage('不允许存在同编号变更清单!');
-      Abort;
+      DisplayErrorMessage('不允许存在同编号变更清单!');
     end;
 end;
 
@@ -444,31 +442,31 @@ begin
     cdsBGLViewCode.Tag := 0;
     if cdsBGLViewLocked.AsBoolean then
     begin
-      ShowErrorMessage('当前变更令已锁定,不可修改');
+      ErrorMessage('当前变更令已锁定,不可修改');
       Abort;
     end;
     if CheckBGLUsed(cdsBGLViewID.AsInteger) then
     begin
-      ShowErrorMessage('当前变更令下变更清单已被应用到清单,不可修改');
+      ErrorMessage('当前变更令下变更清单已被应用到清单,不可修改');
       Abort;
     end;
-  end;
 
-  sNewCode := cdsBGLViewCode.AsString;
-  if Pos(';', sNewCode) > 0 then
-  begin
-    ShowErrorMessage('变更令号不可输入'';'',请使用其他符号代替!');
-    Abort;
-  end;
-  
-  // 相同变更令号应递增[1],[2]...
-  iIncrement := 1;
-  while LocateBGL(sNewCode) and (cdsBGLID.AsInteger <> cdsBGLViewID.AsInteger) do
-  begin
-    sNewCode := Format('%s[%d]', [cdsBGLViewCode.AsString, iIncrement]);
-    Inc(iIncrement);
+    sNewCode := cdsBGLViewCode.AsString;
+    if Pos(';', sNewCode) > 0 then
+    begin
+      ErrorMessage('变更令号不可输入'';'',请使用其他符号代替!');
+      Abort;
+    end;
+
+    // 相同变更令号应递增[1],[2]...
+    iIncrement := 1;
+    while LocateBGL(sNewCode) and (cdsBGLID.AsInteger <> cdsBGLViewID.AsInteger) do
+    begin
+      sNewCode := Format('%s[%d]', [cdsBGLViewCode.AsString, iIncrement]);
+      Inc(iIncrement);
+    end;
+    cdsBGLViewCode.AsString := sNewCode;
   end;
-  cdsBGLViewCode.AsString := sNewCode;
 end;
 
 procedure TBGLData.DeleteBGBills(ABGID: Integer);

+ 27 - 11
DataModules/ReportMemoryDm/rmBillsGatherDm.pas

@@ -492,10 +492,20 @@ end;
 
 procedure TrmBillsGatherData.FilterBillsNode(ANode: TsdIDTreeNode;
   AProjectIndex: Integer);
+
+  function CanGatherNode: Boolean;
+  begin
+    case GatherType of
+      bgtFinal11: Result := ANode.Rec.ValueByName('TotalPrice').AsFloat <> 0;
+      else Result := True;
+    end;
+  end;
+
 var
   GclNode: TGclGatherNode;
 begin
-  if not Assigned(ANode) then Exit;
+  if not Assigned(ANode) or not CanGatherNode then Exit;
+
   GclNode := FGclList.GetGclGatherNode(ANode.Rec);
   with ANode.Rec do
   begin
@@ -535,7 +545,7 @@ begin
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FindNode(2).FirstChild, nil, AProjectIndex, AProject);
       bgtFinal09: // 09表 取第三部分及其后所有项目节
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FindNode(3), nil, AProjectIndex, AProject);
-      bgtGcl, bgtFinal07, bgtFinal11, bgtFinal19:
+      bgtGcl, bgtFinal07, bgtFinal11, bgtFinal19: // 汇总工程量清单
         FilterBills(FProjectData.BillsCompileData.BillsCompileTree.FirstNode, AProjectIndex);
       bgtFinal12: // 不做数据汇总,直接流水式写入数据
         WriteFlowData(FProjectData);
@@ -547,7 +557,7 @@ begin
         AddBillsList(FProjectData.BillsCompileData.BillsCompileTree.FindNode(48), nil, AProjectIndex, AProject);
       bgtG_Final06_1: // 粤竣06-1表 仅汇总土地及其子节点
         AddBillsList(FProjectData.BillsCompileData.BillsCompileTree.FindNode(21), nil, AProjectIndex, AProject);
-      else
+      else // 标准汇总方式,分项清单
         AddBills(FProjectData.BillsCompileData.BillsCompileTree.FirstNode, nil, AProjectIndex, AProject)
     end;
 
@@ -752,6 +762,12 @@ begin
     stnNode := ATree.Items[iIndex];
     if stnNode.ID >= 100 then Continue;
     FixedIDNode := FFixedIDList.GetFixedIDBillsNode(stnNode.ID);
+
+    FixedIDNode.TotalPrice := FixedIDNode.TotalPrice
+      + stnNode.Rec.ValueByName('TotalPrice').AsFloat;
+    FixedIDNode.TotalPrice :=
+      + stnNode.Rec.ValueByName('TotalPrice').AsFloat;
+
     FixedIDNode.AddGatherTotalPrice := FixedIDNode.AddGatherTotalPrice
       + stnNode.Rec.ValueByName('AddGatherTotalPrice').AsFloat;
     FixedIDNode.P_AddGatherTotalPrice[AProjectIndex] :=
@@ -835,7 +851,7 @@ procedure TrmBillsGatherData.WriteProjectsGclData;
   procedure WriteFixedIDBillsData07(AProjectIndex: Integer);
   var
     fTotalPrice, fP_TotalPrice, fAddGatherTotalPrice, fP_AddGatherTotalPrice: Double;
-    Node17, Node45, Node40, Node51: TFixedIDBillsNode;
+    Node54, Node45, Node40, Node51: TFixedIDBillsNode;
   begin
     fTotalPrice := FGclList.GatherNode.TotalPrice;
     fP_TotalPrice := FGclList.GatherNode.P_TotalPrice[AProjectIndex];
@@ -851,14 +867,14 @@ procedure TrmBillsGatherData.WriteProjectsGclData;
     cdsProjectGclBills.Post;
     Inc(FSerialNo);
     // 工程项目调价合计
-    Node17 := FFixedIDList.FixedIDBillsNode(17);
-    WriteFixedIDData(AProjectIndex, Node17, '工程项目调价合计');
-    if Assigned(Node17) then
+    Node54 := FFixedIDList.FixedIDBillsNode(54);
+    WriteFixedIDData(AProjectIndex, Node54, '工程项目调价合计');
+    if Assigned(Node54) then
     begin
-      fTotalPrice := fTotalPrice + Node17.TotalPrice;
-      fP_TotalPrice := fP_TotalPrice + Node17.P_TotalPrice[AProjectIndex];
-      fAddGatherTotalPrice := fAddGatherTotalPrice + Node17.AddGatherTotalPrice;
-      fP_AddGatherTotalPrice := fP_AddGatherTotalPrice + Node17.P_AddGatherTotalPrice[AProjectIndex];
+      fTotalPrice := fTotalPrice + Node54.TotalPrice;
+      fP_TotalPrice := fP_TotalPrice + Node54.P_TotalPrice[AProjectIndex];
+      fAddGatherTotalPrice := fAddGatherTotalPrice + Node54.AddGatherTotalPrice;
+      fP_AddGatherTotalPrice := fP_AddGatherTotalPrice + Node54.P_AddGatherTotalPrice[AProjectIndex];
     end;
     // 工程项目索赔合计
     Node45 := FFixedIDList.FixedIDBillsNode(45);

+ 7 - 16
Forms/AboutFrm.dfm

@@ -150,22 +150,6 @@ object AboutForm: TAboutForm
     OnMouseEnter = lblWebSite2MouseEnter
     OnMouseLeave = lblWebSite2MouseLeave
   end
-  object lblEmail2: TLabel
-    Left = 240
-    Top = 235
-    Width = 54
-    Height = 12
-    Caption = '800003850'
-    Font.Charset = DEFAULT_CHARSET
-    Font.Color = clWindowText
-    Font.Height = -12
-    Font.Name = 'smartSimSun'
-    Font.Style = []
-    ParentFont = False
-    OnClick = lblEmail2Click
-    OnMouseEnter = lblEmail2MouseEnter
-    OnMouseLeave = lblEmail2MouseLeave
-  end
   object lblCompany: TLabel
     Left = 224
     Top = 129
@@ -186,6 +170,13 @@ object AboutForm: TAboutForm
     Height = 12
     Caption = #36719#20214#21517#31216#65306
   end
+  object lblQQ: TLabel
+    Left = 240
+    Top = 237
+    Width = 54
+    Height = 12
+    Caption = '800003850'
+  end
   object Panel1: TPanel
     Left = 8
     Top = 8

+ 1 - 1
Forms/AboutFrm.pas

@@ -21,7 +21,6 @@ type
     lblPhone: TLabel;
     Label15: TLabel;
     lblWebSite2: TLabel;
-    lblEmail2: TLabel;
     lblCompany: TLabel;
     Panel1: TPanel;
     Image1: TImage;
@@ -29,6 +28,7 @@ type
     Button1: TButton;
     Panel3: TPanel;
     lblSoftware: TLabel;
+    lblQQ: TLabel;
     procedure lblWebSite2Click(Sender: TObject);
     procedure lblWebSite2MouseEnter(Sender: TObject);
     procedure lblWebSite2MouseLeave(Sender: TObject);

+ 2 - 0
Forms/BGLSelectFrm.dfm

@@ -60,6 +60,8 @@ object BGLSelectForm: TBGLSelectForm
     DefaultFixedColWidth = 25
     Selection.AlphaBlend = False
     Selection.TransparentColor = False
+    FrozenCol = 0
+    FrozenRow = 0
     OnCellValueChanged = zgBGLCellValueChanged
     OnCellTextChanging = zgBGLCellTextChanging
     OnCellCanEdit = zgBGLCellCanEdit

+ 1 - 1
Forms/BGLSelectFrm.pas

@@ -317,7 +317,7 @@ begin
         zgBGL.Cells[5, zgBGL.CurRow].Text := FloatToStr(fCur)
       else
       begin
-        ShowErrorMessage('当前输入的变更数量大于可变更数量,请重新输入!');
+        ErrorMessage('当前输入的变更数量大于可变更数量,请重新输入!');
         zgBGL.Cells[5, zgBGL.CurRow].Text := '';
       end;
     end;

+ 4 - 0
Forms/BatchReplaceBillsFrm.dfm

@@ -46,6 +46,8 @@ object BatchReplaceBillsForm: TBatchReplaceBillsForm
       DefaultFixedColWidth = 25
       Selection.AlphaBlend = False
       Selection.TransparentColor = False
+      FrozenCol = 0
+      FrozenRow = 0
       OnCellTextChanged = zgBillsCellTextChanged
     end
     object pnlBillsSpr: TPanel
@@ -118,6 +120,8 @@ object BatchReplaceBillsForm: TBatchReplaceBillsForm
       DefaultFixedColWidth = 25
       Selection.AlphaBlend = False
       Selection.TransparentColor = False
+      FrozenCol = 0
+      FrozenRow = 0
       OnCellCanEdit = zgOrgBillsCellCanEdit
     end
     object pnlOrgBillsSpr: TPanel

+ 1 - 1
Forms/BatchReplaceBillsFrm.pas

@@ -153,7 +153,7 @@ begin
   begin
     if (zgBills.Cells[Col, Row].Text <> '') and not TryStrToFloat(zgBills.Cells[Col, Row].Text, fPrice) then
     begin
-      ShowErrorMessage('单价只允许输入数字');
+      ErrorMessage('单价只允许输入数字');
       zgBills.Cells[Col, Row].Text := '';
     end
     else

+ 5 - 5
Forms/BillsPasteSelectFrm.dfm

@@ -5,19 +5,19 @@ object BillsPasteSelectForm: TBillsPasteSelectForm
   Height = 124
   Caption = #20301#32622#36873#25321
   Color = clBtnFace
-  Font.Charset = DEFAULT_CHARSET
+  Font.Charset = GB2312_CHARSET
   Font.Color = clWindowText
-  Font.Height = -11
-  Font.Name = 'MS Sans Serif'
+  Font.Height = -12
+  Font.Name = #23435#20307
   Font.Style = []
   OldCreateOrder = False
   PixelsPerInch = 96
-  TextHeight = 13
+  TextHeight = 12
   object Label1: TLabel
     Left = 6
     Top = 5
     Width = 132
-    Height = 13
+    Height = 12
     Caption = #35831#36873#25321#25554#20837#33410#28857#30340#31867#22411#65306
   end
   object btnOk: TButton

+ 5 - 1
Forms/MainFrm.pas

@@ -540,8 +540,10 @@ begin
     dxBarManager.Bars[2].Visible := False;
 end;
 
-procedure TMainForm.actnReplyExecute(Sender: TObject);
+procedure TMainForm.actnReplyExecute(Sender: TObject); // Åú¸´
 begin
+  if not CurProjectFrame.CheckCanReport then Exit;
+
   Screen.Cursor := crHourGlass;
   try
     CurProjectFrame.ProjectData.Save;
@@ -555,6 +557,8 @@ end;
 
 procedure TMainForm.actnSubmitExecute(Sender: TObject);   // Éϱ¨
 begin
+  if not CurProjectFrame.CheckCanReport then Exit;
+
   Screen.Cursor := crHourGlass;
   try
     CurProjectFrame.ProjectData.Save;

+ 2 - 2
Forms/ProjectPropertiesFrm.pas

@@ -454,9 +454,9 @@ begin
   if leUnlockPassword.Text = FProjProperties.UnlockInfoPassword then
     if leNewUnLockPassword.Text = leNewUnlockPasswordAgain.Text then
       FProjProperties.UnlockInfoPassword := leNewUnLockPassword.Text
-    else ShowErrorMessage('两次密码输入不一致,密码修改不成功!')
+    else ErrorMessage('两次密码输入不一致,密码修改不成功!')
   else if leUnlockPassword.Text <> '' then
-    ShowErrorMessage('原密码输入错误,密码修改不成功!');
+    ErrorMessage('原密码输入错误,密码修改不成功!');
 end;
 
 procedure TProjectPropertiesForm.leUnlockPasswordKeyPress(Sender: TObject;

+ 1 - 1
Forms/ReportsFrm.dfm

@@ -61,7 +61,7 @@ object ReportsForm: TReportsForm
     Width = 223
     Height = 25
     BevelInner = bvLowered
-    TabOrder = 5
+    TabOrder = 4
     object chkExcelMode: TCheckBox
       Left = 6
       Top = 4

+ 4 - 4
Forms/ReportsFrm.pas

@@ -452,7 +452,7 @@ begin
   if _IsEncrypt then
     PreviewComXML.Print(CurPage, 1)
   else
-    ShowTipMessage(GetHintStr);
+    TipMessage(GetHintStr);
 end;
 
 procedure TReportsForm.xcbStartPageChange(Sender: TObject);
@@ -474,7 +474,7 @@ begin
       PreviewComXML.PrintMultiPages(PrintStartPage, PrintEndPage);
   end
   else
-    ShowTipMessage(GetHintStr);
+    TipMessage(GetHintStr);
 end;
 
 procedure TReportsForm.PrintAllSelectedReports;
@@ -505,7 +505,7 @@ begin
       PreviewComXML.PrintPDF(PrintStartPage, PrintEndPage);
   end
   else
-    ShowTipMessage(GetHintStr);
+    TipMessage(GetHintStr);
 end;
 
 procedure TReportsForm.ExportAllSelectedPDFReports;
@@ -535,7 +535,7 @@ begin
       ExportCurXlsReport;
   end
   else
-    ShowTipMessage(GetHintStr);
+    TipMessage(GetHintStr);
 end;
 
 procedure TReportsForm.ExportAllSelectedXlsReports;

+ 4 - 0
Frames/BillsMeasureFme.dfm

@@ -61,6 +61,8 @@ object BillsMeasureFrame: TBillsMeasureFrame
       DefaultFixedColWidth = 30
       Selection.AlphaBlend = False
       Selection.TransparentColor = False
+      FrozenCol = 0
+      FrozenRow = 0
       OnCurrentChanged = zgBillsMeasureCurrentChanged
       OnCellButtonClick = zgBillsMeasureCellButtonClick
       OnCustomPaste = zgBillsMeasureCustomPaste
@@ -116,6 +118,8 @@ object BillsMeasureFrame: TBillsMeasureFrame
         DefaultColWidth = 73
         Selection.AlphaBlend = False
         Selection.TransparentColor = False
+        FrozenCol = 0
+        FrozenRow = 0
         OnCellTextChanged = zgDealPropertyCellTextChanged
         OnCellCanEdit = zgDealPropertyCellCanEdit
         OnCellGetFont = zgDealPropertyCellGetFont

+ 1 - 1
Frames/BillsMeasureFme.pas

@@ -506,7 +506,7 @@ procedure TBillsMeasureFrame.zgDealPropertyCellTextChanged(Sender: TObject;
     end
     else
     begin
-      ShowErrorMessage('只允许输入数字!!');
+      ErrorMessage('只允许输入数字!!');
       ACell.Text := ARec.ValueByName(AField).AsString;
     end;
   end;

+ 24 - 2
Frames/ProjectFme.pas

@@ -155,6 +155,8 @@ type
 
     procedure RefreshColumnDisplay;
 
+    function CheckCanReport: Boolean;
+
     procedure UnLockData;
     procedure ReLockData;
 
@@ -532,7 +534,7 @@ procedure TProjectFrame.dxsbViewControlItemClick(Sender: TObject;
   begin
     if FProjectData.ProjProperties.PhaseCount = 0 then
     begin
-      ShowErrorMessage('当前项目未开始计量,暂无审核比较数据!');
+      ErrorMessage('当前项目未开始计量,暂无审核比较数据!');
       dxsbViewControl.SelectedItem := dxsbViewControl.ActiveGroup.Items[jpsMain.ActivePageIndex];
       Abort;
     end;
@@ -690,6 +692,8 @@ end;
 
 procedure TProjectFrame.btnSubmitClick(Sender: TObject);
 begin
+  if not CheckCanReport then Exit;
+
   Screen.Cursor := crHourGlass;
   try
     UpToWeb(True);
@@ -718,7 +722,10 @@ begin
   // 当前显示的期是最新期,分两种情况判断,如果第一审核人已有状态,则上传过了
   else if ProjectData.PhaseIndex = ProjectData.ProjProperties.PhaseCount then
   begin
-    if not CheckerFrame.HasChecker then
+    // 当用户点击新增一期计量后,会调用该方法,此时,有一期数据,却为上传过
+    if not Assigned(CheckerFrame) then
+      Result := False
+    else if not CheckerFrame.HasChecker then
       Result := False
     else if CheckerFrame.FirstChecker.CheckStatus = csNotBegin then
       Result := False
@@ -1317,4 +1324,19 @@ begin
   end;
 end;
 
+function TProjectFrame.CheckCanReport: Boolean;
+begin
+  Result := QuestMessageYesNo('请确定已生成中间计量数据?');
+  // 使用控件点击进行定位,重新定义方法太复杂
+  if not Result then
+  begin
+    // 先定位至计量台账界面
+    dxsbViewControl.SelectedItem := dxsbViewControl.ActiveGroup.Items[1];
+    dxsbViewControlItemClick(dxsbViewControl, dxsbViewControl.ActiveGroup.Items[1]);
+    // 再定位至中间计量界面
+    tobtnZJJL.Down := True;
+    tobtnZJJL.Click;
+  end;
+end;
+
 end.

+ 1 - 1
Frames/ProjectManagerFme.pas

@@ -1389,7 +1389,7 @@ var
 begin
   stnNode := stdProjects.IDTree.Selected;
   if stnNode.Rec.ValueByName('BackupFolder').AsString = '' then
-    ShowTipMessage('该项目暂无备份数据!')
+    TipMessage('该项目暂无备份数据!')
   else
     ShellExecute(Handle, 'open', 'Explorer.exe',
       PChar(FProjectManagerData.BackupPath(stnNode.ID)), nil, 1);

+ 2 - 2
Units/ExportExcel.pas

@@ -152,7 +152,7 @@ begin
   try
     ExportToXlsPage(AGrid, FXlsOutPut.AddPage);
     FXlsOutPut.SaveToFile(FTempFile);
-    if not FileExists(FFileName) or ShowQuestMessage('存在同名文件,是否替换?') then
+    if not FileExists(FFileName) or QuestMessage('存在同名文件,是否替换?') then
       CopyFile(PChar(FTempFile), PChar(FFileName), False);
   finally
     EndExport;
@@ -292,7 +292,7 @@ begin
     ExportToXlsPage(ATree, FXlsOutPut.AddPage);
     UpdateProgressHint('保存0号台账Excel数据');
     FXlsOutPut.SaveToFile(FTempFile);
-    if not FileExists(AFileName) or ShowQuestMessage('存在同名文件,是否替换?') then
+    if not FileExists(AFileName) or QuestMessage('存在同名文件,是否替换?') then
       CopyFile(PChar(FTempFile), PChar(AFileName), False);
   finally
     EndExport;

+ 10 - 4
Units/ProjectData.pas

@@ -109,7 +109,7 @@ type
     {SimpleOpen: 仅打开数据库[项目+最后一期],不打开除属性以外的任何数据表(项目属性都是通过Sql语句修改)}
     procedure SimpleOpen(const AFileName: string);
     procedure SimpleSaveAs(const AFileName: string);
-    {OpenForReport: BillsData, BillsCompileData, DealPaymentData 报表仅读取数据不做任何修改}
+    {OpenForReport: BillsData, BillsCompileData, DealPaymentData, BGLData 报表仅读取数据不做任何修改}
     procedure OpenForReport(const AFileName: string);
     {OpenForReport2: OpenForReport的基础上打开最后一期数据}
     procedure OpenForReport2(const AFileName: string);
@@ -1175,10 +1175,14 @@ var
 begin
   if ProjProperties.UnlockInfoPassword = '' then
     Result := True
-  else if InputPassword(sPassword) then
+  else
   begin
-    Result := sPassword = ProjProperties.UnlockInfoPassword;
-    if not Result then ShowErrorMessage('您输入的密码不正确!');
+    Result := InputPassword(sPassword);
+    if Result then
+    begin
+      Result := sPassword = ProjProperties.UnlockInfoPassword;
+      if not Result then ErrorMessage('您输入的密码不正确!');
+    end;
   end;
 end;
 
@@ -1242,6 +1246,7 @@ begin
   FBillsData.Open(FConnection.Connection);
   FBillsCompileData.Open;
   FDealPaymentData.Open(FConnection.Connection);
+  FBGLData.Open(FConnection.Connection);  
 end;
 
 procedure TProjectData.OpenForReply(const AFileName: string);
@@ -1474,6 +1479,7 @@ begin
   FBillsData.Open(FConnection.Connection);
   FBillsCompileData.Open;
   FDealPaymentData.Open(FConnection.Connection);
+  FBGLData.Open(FConnection.Connection);
   if ProjProperties.PhaseCount > 0 then
   begin
     FPhaseIndex := ProjProperties.PhaseCount;

+ 1 - 1
Units/ReportManager.pas

@@ -322,7 +322,7 @@ begin
   except
     on E: Exception do
     begin
-      ShowTipMessage(Format('报表文件[%s]无法打开,错误信息:'#13#10'%s.'#13#10 +
+      TipMessage(Format('报表文件[%s]无法打开,错误信息:'#13#10'%s.'#13#10 +
         '请与纵横软件客服中心联系:(0756)3850888。', [FFileName, E.Message]));
     end;
   end;

+ 13 - 4
Units/UtilMethods.pas

@@ -22,6 +22,8 @@ type
   procedure WarningMessage(const AMsg: string);
   procedure ErrorMessage(const AMsg: string);
   function QuestMessage(const AMsg: string): Boolean;
+  function QuestMessageYesNo(const AMsg: string): Boolean;
+  procedure TipMessage(const AMsg: string);
   procedure DataSetErrorMessage(var Allow: Boolean; const AMsg: string);
 
   {Get Common Path}
@@ -159,20 +161,27 @@ end;
 {Message}
 procedure WarningMessage(const AMsg: string);
 begin
-  MessageBox(Application.Handle, PChar(AMsg), PChar('¾¯¸æ'), MB_OK or MB_ICONWARNING);
-  Application.ProcessMessages;
+   MessageBox(Application.Handle, PChar(AMsg), PChar('¾¯¸æ'), MB_OK or MB_ICONWARNING);
 end;
 
 procedure ErrorMessage(const AMsg: string);
 begin
   MessageBox(Application.Handle, PChar(AMsg), PChar('´íÎó'), MB_OK or MB_ICONERROR);
-  Application.ProcessMessages;
 end;
 
 function QuestMessage(const AMsg: string): Boolean;
 begin
   Result := MessageBox(Application.Handle, PChar(AMsg), PChar('ѯÎÊ'), MB_OKCANCEL or MB_ICONQUESTION) = IDOK;
-  Application.ProcessMessages;
+end;
+
+function QuestMessageYesNo(const AMsg: string): Boolean;
+begin
+  Result := MessageBox(Application.Handle, PChar(AMsg), PChar('ѯÎÊ'), MB_YESNO or MB_ICONQUESTION) = IDYes;
+end;
+
+procedure TipMessage(const AMsg: string);
+begin
+  MessageBox(Application.Handle, PChar(AMsg), PChar('Ìáʾ'), MB_OK or MB_ICONINFORMATION);
 end;
 
 procedure DataSetErrorMessage(var Allow: Boolean; const AMsg: string);

+ 4 - 4
Units/ZhAPI.pas

@@ -4,10 +4,10 @@ interface
 
 uses Classes, DB, Controls;
 
-  procedure ShowWarningMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowWarningMessage';
-  procedure ShowTipMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowTipMessage';
-  procedure ShowErrorMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowErrorMessage';
-  function ShowQuestMessage(const AMsg: string): Boolean; stdcall; external 'ZhAPI.dll' name 'ShowQuestMessage';
+  //procedure ShowWarningMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowWarningMessage';
+  //procedure ShowTipMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowTipMessage';
+  //procedure ShowErrorMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowErrorMessage';
+  //function ShowQuestMessage(const AMsg: string): Boolean; stdcall; external 'ZhAPI.dll' name 'ShowQuestMessage';
   function ShowInputQuery(const ACaption, APrompt: string; var Value: string; ANeedMark: Boolean = False): Boolean; stdcall; external 'ZhAPI.dll' name 'ShowInputQuery';
   function ShowInputBox(const ACaption, APrompt, ADefault: string): string; stdcall; external 'ZhAPI.dll' name 'ShowInputBox';