|
@@ -127,6 +127,7 @@ type
|
|
|
procedure UpdateBGLExecutionRate(ABGLID: Integer);
|
|
|
procedure ApplyBGL(ABGLInfo: TBGLSelectInfo); overload;
|
|
|
|
|
|
+ function DeleteWeb(AWebID: Integer): Boolean;
|
|
|
procedure DeleteBGBills(ABGID: Integer);
|
|
|
|
|
|
function CheckSameB_Code(ABGID: Integer; const AB_Code: string): Boolean;
|
|
@@ -161,7 +162,8 @@ type
|
|
|
implementation
|
|
|
|
|
|
uses
|
|
|
- ZhAPI, Math, ProjectData, BillsDm, Variants, UtilMethods, superobject;
|
|
|
+ ZhAPI, Math, ProjectData, BillsDm, Variants, UtilMethods, superobject,
|
|
|
+ PHPWebDm, Forms, Controls;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
@@ -508,8 +510,10 @@ procedure TBGLData.cdsBGLViewBeforeDelete(DataSet: TDataSet);
|
|
|
begin
|
|
|
if CheckBGLUsed(cdsBGLViewID.AsInteger) then
|
|
|
raise Exception.Create('变更令下变更清单已被应用到清单,不可删除!');
|
|
|
- if cdsBGLViewIsCloud.AsBoolean then
|
|
|
- raise Exception.Create('云端获取的变更令不允许删除!');
|
|
|
+ //if cdsBGLViewIsCloud.AsBoolean then
|
|
|
+ //raise Exception.Create('云端获取的变更令不允许删除!');
|
|
|
+ if cdsBGLViewIsCloud.AsBoolean and not DeleteWeb(cdsBGLViewWebID.AsInteger) then
|
|
|
+ raise Exception.Create('同步删除云端数据失败,请重试');
|
|
|
DeleteBGBills(cdsBGLViewID.AsInteger);
|
|
|
end;
|
|
|
|
|
@@ -786,4 +790,21 @@ begin
|
|
|
FAfterCurrentBGLChanged;
|
|
|
end;
|
|
|
|
|
|
+function TBGLData.DeleteWeb(AWebID: Integer): Boolean;
|
|
|
+var
|
|
|
+ sgs: TStrings;
|
|
|
+ sUrl, sInfo: string;
|
|
|
+begin
|
|
|
+ Screen.Cursor := crHourGlass;
|
|
|
+ sgs := TStringList.Create;
|
|
|
+ try
|
|
|
+ sgs.Add(Format('cid=%d', [AWebID]));
|
|
|
+ sUrl := PHPWeb.MeasureURL + 'change/delete';
|
|
|
+ Result := PHPWeb.UrlGet(sUrl, sgs, sInfo) = 1;
|
|
|
+ finally
|
|
|
+ sgs.Free;
|
|
|
+ Screen.Cursor := crDefault;
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
end.
|