ProjectProperty.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. unit ProjectProperty;
  2. interface
  3. uses
  4. Classes, SysUtils, Variants, DB, ADODB, ZhAPI, CalcDecimal;
  5. type
  6. TPropertyInquiry = class
  7. private
  8. FInquriyQuery: TADOQuery;
  9. FConnection: TADOConnection;
  10. FTableName: string;
  11. FSql: string;
  12. function GetValue(const AName: string): Variant;
  13. procedure SetValue(const AName: string; const Value: Variant);
  14. function GetNewID: Integer;
  15. procedure ExecuteSql(AIsSelect: Boolean = True);
  16. function CheckPropertyExist(const AName: string): Boolean;
  17. public
  18. constructor Create(AConnection: TADOConnection);
  19. destructor Destroy; override;
  20. property TableName: string read FTableName write FTableName;
  21. property Value[const AName: string]: Variant read GetValue write SetValue; default;
  22. end;
  23. TProjProperties = class
  24. private
  25. FProjectData: TObject;
  26. FPropertyInqurity: TPropertyInquiry;
  27. FShowPriceChange: Boolean;
  28. FPhaseCount: Integer;
  29. FLockedLedgerData: Boolean;
  30. FStartedSubsist: Double;
  31. FContractPrice: Double;
  32. FMaterialSubsist: Double;
  33. FBLegal: string;
  34. FDealName: string;
  35. FDealIndex: string;
  36. FCLegal: string;
  37. FCDate: string;
  38. FBName: string;
  39. FProjectName: string;
  40. FBDate: string;
  41. FCName: string;
  42. FSDate: string;
  43. FSName: string;
  44. FSLegal: string;
  45. FLoadLength: Double;
  46. FLaneCount: Integer;
  47. FLoadLevel: Integer;
  48. FEndPeg: string;
  49. FStartPeg: string;
  50. FShowBGLCode: Boolean;
  51. FZJJLPreText: string;
  52. FUnlockInfoPassword: string;
  53. FPhaseIndex: Integer;
  54. FShowDesignQuantity: Boolean;
  55. FDealType: string;
  56. FShowAlias: Boolean;
  57. FDecimalManager: TDecimalManager;
  58. FTotalPriceDigit: Integer;
  59. FTotalPriceFormat: string;
  60. FQuantityDigit: Integer;
  61. FQuantityFormat: string;
  62. FPriceDigit: Integer;
  63. FPriceFormat: string;
  64. FUpdateFlag: Integer;
  65. FPriceMarginStartPhaseID: Integer;
  66. FShowReportShading: Boolean;
  67. FReportShading: string;
  68. FBaseline: string;
  69. FDeadline: string;
  70. FDealPayAloneDigit: Boolean;
  71. FReportShowState: Boolean;
  72. FReportShowStateWithoutReply: Boolean;
  73. FReportShowStateText: string;
  74. FDealPhase: string;
  75. FSLegal_2: string;
  76. FCName_2: string;
  77. FCDate_2: string;
  78. FCLegal_2: string;
  79. FSName_2: string;
  80. FSDate_2: string;
  81. function GetDisplayFormat(ADigit: Integer): string;
  82. procedure LoadBaseProperties;
  83. procedure LoadViewProperties;
  84. procedure LoadDealInfo;
  85. procedure LoadTechParameters;
  86. procedure LoadCalcParameters;
  87. procedure LoadDateTime;
  88. procedure SaveDealInfo;
  89. procedure SaveTechParameters;
  90. procedure SaveCalcParameters;
  91. procedure SetShowPriceChange(const Value: Boolean);
  92. procedure SetPhaseCount(const Value: Integer);
  93. procedure SetLockedLedgerData(const Value: Boolean);
  94. function GetFinalAuditCount: Integer;
  95. procedure SetFinalAuditCount(const Value: Integer);
  96. function GetAuditStatus: Integer;
  97. procedure SetAuditStatus(const Value: Integer);
  98. function GetAuditStatusStr: string;
  99. procedure SetContractPrice(const Value: Double);
  100. procedure SetMaterialSubsist(const Value: Double);
  101. procedure SetStartedSubsist(const Value: Double);
  102. function GetAuditCompany: string;
  103. procedure SetAuditCompany(const Value: string);
  104. procedure SetShowBGLCode(const Value: Boolean);
  105. procedure SetZJJLPreText(const Value: string);
  106. procedure SetUnlockInfoPassword(const Value: string);
  107. procedure SetPhaseIndex(const Value: Integer);
  108. procedure SetShowDesignQuantity(const Value: Boolean);
  109. procedure SetShowAlias(const Value: Boolean);
  110. procedure SetQuantityDigit(const Value: Integer);
  111. procedure SetTotalPriceDigit(const Value: Integer);
  112. procedure SetUpdateFlag(const Value: Integer);
  113. procedure SetReportShading(const Value: string);
  114. procedure SetShowReportShading(const Value: Boolean);
  115. procedure SetBaseline(const Value: string);
  116. procedure SetDeadline(const Value: string);
  117. procedure SetDealPayAloneDigit(const Value: Boolean);
  118. procedure SetReportShowState(const Value: Boolean);
  119. procedure SetReportShowStateText(const Value: string);
  120. procedure SetReportShowStateWithoutReply(const Value: Boolean);
  121. public
  122. constructor Create(AProjectData: TObject);
  123. destructor Destroy; override;
  124. procedure Open(AConnection: TADOConnection);
  125. procedure Save;
  126. procedure Reload;
  127. function GetBoolPropertyDef(const AName: string; ADef: Boolean): Boolean;
  128. function GetIntPropertyDef(const AName: string; ADef: Integer): Integer;
  129. function GetStrPropertyDef(const AName, ADef: string): string;
  130. function GetFloatPropertyDef(const AName: string; ADef: Double): Double;
  131. {Submit-Audit-Reply}
  132. // 共计终审计量期数
  133. property FinalAuditCount: Integer read GetFinalAuditCount write SetFinalAuditCount;
  134. // 当前审核状态
  135. property AuditStatus: Integer read GetAuditStatus write SetAuditStatus;
  136. property AuditStatusStr: string read GetAuditStatusStr;
  137. property AuditCompany: string read GetAuditCompany write SetAuditCompany;
  138. {合同信息}
  139. // 建设项目名称
  140. property ProjectName: string read FProjectName write FProjectName;
  141. // 合同名称
  142. property DealName: string read FDealName write FDealName;
  143. // 合同编号
  144. property DealIndex: string read FDealIndex write FDealIndex;
  145. // 合同类别
  146. property DealType: string read FDealType write FDealType;
  147. // 建设单位
  148. // 名称
  149. property BName: string read FBName write FBName;
  150. // 法人代表
  151. property BLegal: string read FBLegal write FBLegal;
  152. // 签订日期
  153. property BDate: string read FBDate write FBDate;
  154. // 施工单位: 后改为承包单位1
  155. // 名称
  156. property CName: string read FCName write FCName;
  157. // 法人代表
  158. property CLegal: string read FCLegal write FCLegal;
  159. // 签订日期
  160. property CDate: string read FCDate write FCDate;
  161. // 承包单位2
  162. // 名称
  163. property CName_2: string read FCName_2 write FCName_2;
  164. // 法人代表
  165. property CLegal_2: string read FCLegal_2 write FCLegal_2;
  166. // 签订日期
  167. property CDate_2: string read FCDate_2 write FCDate_2;
  168. // 监理单位:改为监理单位1
  169. // 名称
  170. property SName: string read FSName write FSName;
  171. // 法人代表
  172. property SLegal: string read FSLegal write FSLegal;
  173. // 签订日期
  174. property SDate: string read FSDate write FSDate;
  175. // 监理单位2
  176. // 名称
  177. property SName_2: string read FSName_2 write FSName_2;
  178. // 法人代表
  179. property SLegal_2: string read FSLegal_2 write FSLegal_2;
  180. // 签订日期
  181. property SDate_2: string read FSDate_2 write FSDate_2;
  182. {技术参数}
  183. // 公路等级
  184. property LoadLevel: Integer read FLoadLevel write FLoadLevel;
  185. // 起点桩号
  186. property StartPeg: string read FStartPeg write FStartPeg;
  187. // 终点桩号
  188. property EndPeg: string read FEndPeg write FEndPeg;
  189. // 长度
  190. property LoadLength: Double read FLoadLength write FLoadLength;
  191. // 车道数
  192. property LaneCount: Integer read FLaneCount write FLaneCount;
  193. // 合同工期
  194. property DealPhase: string read FDealPhase write FDealPhase;
  195. {合同支付}
  196. property ContractPrice: Double read FContractPrice write SetContractPrice;
  197. property MaterialSubsist: Double read FMaterialSubsist write SetMaterialSubsist;
  198. property StartedSubsisit: Double read FStartedSubsist write SetStartedSubsist;
  199. {密码}
  200. // 解锁台账编辑节点密码
  201. property UnlockInfoPassword: string read FUnlockInfoPassword write SetUnlockInfoPassword;
  202. {小数位数}
  203. // 是否单独设置合同支付小数位数
  204. property DealPayAloneDigit: Boolean read FDealPayAloneDigit write SetDealPayAloneDigit;
  205. property DecimalManager: TDecimalManager read FDecimalManager;
  206. // 数量
  207. property QuantityDigit: Integer read FQuantityDigit write SetQuantityDigit;
  208. property QuantityFormat: string read FQuantityFormat;
  209. // 金额
  210. property TotalPriceDigit: Integer read FTotalPriceDigit write SetTotalPriceDigit;
  211. property TotalPriceFormat: string read FTotalPriceFormat;
  212. // 单价
  213. property PriceDigit: Integer read FPriceDigit;
  214. property PriceFormat: string read FPriceFormat;
  215. {时间}
  216. // 起始时间
  217. property Baseline: string read FBaseline write SetBaseline;
  218. // 结束时间
  219. property Deadline: string read FDeadline write SetDeadline;
  220. {升级标记}
  221. property UpdateFlag: Integer read FUpdateFlag write SetUpdateFlag;
  222. {Base}
  223. // 计量期数
  224. property PhaseIndex: Integer read FPhaseIndex write SetPhaseIndex;
  225. property PhaseCount: Integer read FPhaseCount write SetPhaseCount;
  226. property ZJJLPreText: string read FZJJLPreText write SetZJJLPreText;
  227. {View}
  228. // Can Modify In ProjectPropertiesFrm
  229. property ShowPriceChange: Boolean read FShowPriceChange write SetShowPriceChange;
  230. property ShowBGLCode: Boolean read FShowBGLCode write SetShowBGLCode;
  231. property ShowDesignQuantity: Boolean read FShowDesignQuantity write SetShowDesignQuantity;
  232. property ShowAlias: Boolean read FShowAlias write SetShowAlias;
  233. property ShowReportShading: Boolean read FShowReportShading write SetShowReportShading;
  234. property ReportShading: string read FReportShading write SetReportShading;
  235. property ReportShowState: Boolean read FReportShowState write SetReportShowState;
  236. property ReportShowStateText: string read FReportShowStateText write SetReportShowStateText;
  237. property ReportShowStateWithoutReply: Boolean read FReportShowStateWithoutReply write SetReportShowStateWithoutReply;
  238. end;
  239. implementation
  240. { TPropertyInquiry }
  241. function TPropertyInquiry.CheckPropertyExist(const AName: string): Boolean;
  242. begin
  243. Result := False;
  244. FSql := Format('Select * From %s Where Name = ''%s''', [TableName, UpperCase(AName)]);
  245. ExecuteSql;
  246. Result := FInquriyQuery.RecordCount > 0;
  247. FInquriyQuery.Close;
  248. end;
  249. constructor TPropertyInquiry.Create(AConnection: TADOConnection);
  250. begin
  251. FConnection := AConnection;
  252. FInquriyQuery := TADOQuery.Create(nil);
  253. FInquriyQuery.Connection := FConnection;
  254. end;
  255. destructor TPropertyInquiry.Destroy;
  256. begin
  257. FInquriyQuery.Free;
  258. inherited;
  259. end;
  260. procedure TPropertyInquiry.ExecuteSql(AIsSelect: Boolean);
  261. begin
  262. FInquriyQuery.Close;
  263. FInquriyQuery.SQL.Clear;
  264. FInquriyQuery.SQL.Add(FSql);
  265. if AIsSelect then
  266. FInquriyQuery.Open
  267. else
  268. FInquriyQuery.ExecSQL;
  269. end;
  270. function TPropertyInquiry.GetNewID: Integer;
  271. begin
  272. FSql := Format('Select Max(ID) As MaxID From %s', [TableName]);
  273. ExecuteSql;
  274. if FInquriyQuery.RecordCount > 0 then
  275. Result := FInquriyQuery.FieldByName('MaxID').AsInteger + 1
  276. else
  277. Result := 0;
  278. FInquriyQuery.Close;
  279. end;
  280. function TPropertyInquiry.GetValue(const AName: string): Variant;
  281. begin
  282. FSql := Format('Select * From %s Where Name = ''%s''', [TableName, UpperCase(AName)]);
  283. ExecuteSql;
  284. if FInquriyQuery.RecordCount > 0 then
  285. Result := FInquriyQuery.FieldByName('PropValue').AsVariant
  286. else
  287. Result := Null;
  288. FInquriyQuery.Close;
  289. end;
  290. procedure TPropertyInquiry.SetValue(const AName: string;
  291. const Value: Variant);
  292. function GetUpdateSql: string;
  293. begin
  294. if VarIsNull(Value) then
  295. Result := Format('Delete From %s Where Name = ''%s''', [TableName, UpperCase(AName)])
  296. else
  297. begin
  298. if CheckPropertyExist(AName) then
  299. Result := Format('Update %s Set PropValue = ''%s'' Where Name = ''%s''',
  300. [TableName, VarToStr(Value), UpperCase(AName)])
  301. else
  302. Result := Format('Insert Into %s (ID, Name, PropValue) Values (%d, ''%s'', ''%s'')',
  303. [TableName, GetNewID, UpperCase(AName), VarToStr(Value)]);
  304. end;
  305. end;
  306. begin
  307. FSql := GetUpdateSql;
  308. ExecuteSql(False);
  309. FInquriyQuery.Close;
  310. end;
  311. { TProjProperties }
  312. constructor TProjProperties.Create(AProjectData: TObject);
  313. begin
  314. FProjectData := AProjectData;
  315. FDecimalManager := TDecimalManager.Create(AProjectData);
  316. end;
  317. destructor TProjProperties.Destroy;
  318. begin
  319. FPropertyInqurity.Free;
  320. FDecimalManager.Free;
  321. inherited;
  322. end;
  323. function TProjProperties.GetAuditCompany: string;
  324. begin
  325. Result := GetStrPropertyDef('AuditCompany', '');
  326. end;
  327. function TProjProperties.GetAuditStatus: Integer;
  328. begin
  329. Result := GetIntPropertyDef('AuditStatus', -1);
  330. end;
  331. function TProjProperties.GetAuditStatusStr: string;
  332. begin
  333. case AuditStatus of
  334. -1:
  335. if PhaseCount = 0 then
  336. Result := '原报'
  337. else
  338. Result := '批复';
  339. 0:
  340. Result := '原报';
  341. else
  342. Result := Format('%d 审', [AuditStatus]);
  343. end;
  344. end;
  345. function TProjProperties.GetBoolPropertyDef(const AName: string;
  346. ADef: Boolean): Boolean;
  347. var
  348. vProperty: Variant;
  349. begin
  350. vProperty := FPropertyInqurity.Value[AName];
  351. if VarIsNull(vProperty) then
  352. Result := ADef
  353. else
  354. Result := Boolean(vProperty);
  355. end;
  356. function TProjProperties.GetDisplayFormat(ADigit: Integer): string;
  357. begin
  358. case ADigit of
  359. 0: Result := '0';
  360. 1: Result := '0.#';
  361. 2: Result := '0.##';
  362. 3: Result := '0.###';
  363. 4: Result := '0.####';
  364. 5: Result := '0.#####';
  365. 6: Result := '0.######';
  366. 7: Result := '0.#######';
  367. 8: Result := '0.########';
  368. 9: Result := '0.#########';
  369. else
  370. Result := '0.##########';
  371. end;
  372. end;
  373. function TProjProperties.GetFinalAuditCount: Integer;
  374. begin
  375. Result := GetIntPropertyDef('FinalAuditCount', 0);
  376. end;
  377. function TProjProperties.GetFloatPropertyDef(const AName: string;
  378. ADef: Double): Double;
  379. var
  380. sValue: Variant;
  381. begin
  382. sValue := GetStrPropertyDef(AName, FloatToStr(ADef));
  383. Result := StrToFloatDef(sValue, ADef);
  384. end;
  385. function TProjProperties.GetIntPropertyDef(const AName: string;
  386. ADef: Integer): Integer;
  387. var
  388. sValue: Variant;
  389. begin
  390. sValue := GetStrPropertyDef(AName, IntToStr(ADef));
  391. Result := StrToIntDef(sValue, ADef);
  392. end;
  393. function TProjProperties.GetStrPropertyDef(const AName,
  394. ADef: string): string;
  395. var
  396. vProperty: Variant;
  397. begin
  398. vProperty := FPropertyInqurity.Value[AName];
  399. Result := VarToStrDef(vProperty, ADef);
  400. end;
  401. procedure TProjProperties.LoadBaseProperties;
  402. begin
  403. FPhaseCount := GetIntPropertyDef('PhaseCount', 0);
  404. FLockedLedgerData := GetBoolPropertyDef('LockedLedgerData', False);
  405. FContractPrice := GetFloatPropertyDef('ContractPrice', 0);
  406. FStartedSubsist := GetFloatPropertyDef('StartedSubsist', 0);
  407. FMaterialSubsist := GetFloatPropertyDef('MaterialSubsist', 0);
  408. FZJJLPreText := GetStrPropertyDef('ZJJLPreText', '');
  409. end;
  410. procedure TProjProperties.LoadCalcParameters;
  411. begin
  412. FDealPayAloneDigit := GetBoolPropertyDef('DealPayAloneDigit', False);
  413. FQuantityDigit := GetIntPropertyDef('QuantityDigit', 3);
  414. FQuantityFormat := GetDisplayFormat(FQuantityDigit);
  415. FTotalPriceDigit := GetIntPropertyDef('TotalPriceDigit', 0);
  416. FTotalPriceFormat := GetDisplayFormat(FTotalPriceDigit);
  417. FPriceDigit := 2;
  418. FPriceFormat := GetDisplayFormat(FPriceDigit);
  419. with FDecimalManager.Common do
  420. begin
  421. Quantity.Digit := GetIntPropertyDef('QuantityDigit', 3);
  422. TotalPrice.Digit := GetIntPropertyDef('TotalPriceDigit', 0);
  423. Price.Digit := 2;
  424. end;
  425. with FDecimalManager do
  426. begin
  427. Compile.Quantity.Digit := GetIntPropertyDef('QuantityDigit1', Common.Quantity.Digit);
  428. Compile.TotalPrice.Digit := GetIntPropertyDef('TotalPriceDigit1', Common.TotalPrice.Digit);
  429. Compile.Price.Digit := 2;
  430. end;
  431. with FDecimalManager do
  432. begin
  433. PriceMargin.Quantity.Digit := Common.Quantity.Digit;
  434. PriceMargin.TotalPrice.Digit := Common.TotalPrice.Digit;
  435. PriceMargin.Price.Digit := 3;//GetIntPropertyDef('PM_PriceDigit', Common.Price.Digit);
  436. end;
  437. with FDecimalManager do
  438. begin
  439. DealPay.TotalPrice.Digit := GetIntPropertyDef('DealPayTPDigit', Common.TotalPrice.Digit);
  440. if FDealPayAloneDigit then
  441. DealPay.RelaCalcDecimal := nil
  442. else
  443. DealPay.RelaCalcDecimal := Common;
  444. end;
  445. end;
  446. procedure TProjProperties.LoadDateTime;
  447. begin
  448. FBaseline := GetStrPropertyDef('Baseline', '');
  449. FDeadline := GetStrPropertyDef('Deadline', '');
  450. end;
  451. procedure TProjProperties.LoadDealInfo;
  452. begin
  453. FProjectName := GetStrPropertyDef('ProjectName', '');
  454. FDealName := GetStrPropertyDef('DealName', '');
  455. FDealIndex := GetStrPropertyDef('DealIndex', '');
  456. FDealType := GetStrPropertyDef('DealType', '');
  457. FBName := GetStrPropertyDef('BName', '');
  458. FBLegal := GetStrPropertyDef('BLegal', '');
  459. FBDate := GetStrPropertyDef('BDate', '');
  460. FCName := GetStrPropertyDef('CName', '');
  461. FCLegal := GetStrPropertyDef('CLegal', '');
  462. FCDate := GetStrPropertyDef('CDate', '');
  463. FCName_2 := GetStrPropertyDef('CName_2', '');
  464. FCLegal_2 := GetStrPropertyDef('CLegal_2', '');
  465. FCDate_2 := GetStrPropertyDef('CDate_2', '');
  466. FSName := GetStrPropertyDef('SName', '');
  467. FSLegal := GetStrPropertyDef('SLegal', '');
  468. FSDate := GetStrPropertyDef('SDate', '');
  469. FSName_2 := GetStrPropertyDef('SName_2', '');
  470. FSLegal_2 := GetStrPropertyDef('SLegal_2', '');
  471. FSDate_2 := GetStrPropertyDef('SDate_2', '');
  472. end;
  473. procedure TProjProperties.LoadTechParameters;
  474. begin
  475. FLoadLevel := GetIntPropertyDef('LoadLevel', 0);
  476. FStartPeg := GetStrPropertyDef('StartPeg', '');
  477. FEndPeg := GetStrPropertyDef('EndPeg', '');
  478. FLoadLength := GetFloatPropertyDef('LoadLength', 0);
  479. FLaneCount := GetIntPropertyDef('LaneCount', 0);
  480. FDealPhase := GetStrPropertyDef('DealPhase', '');
  481. end;
  482. procedure TProjProperties.LoadViewProperties;
  483. begin
  484. FShowPriceChange := GetBoolPropertyDef('ShowPriceChange', False);
  485. FShowBGLCode := GetBoolPropertyDef('ShowBGLCode', True);
  486. FShowDesignQuantity := GetBoolPropertyDef('ShowDesignQuantity', False);
  487. FShowAlias := GetBoolPropertyDef('ShowAlias', False);
  488. FShowReportShading := GetBoolPropertyDef('ShowReportShading', False);
  489. FReportShading := GetStrPropertyDef('ReportShading', '');
  490. FReportShowState := GetBoolPropertyDef('ReportShowState', True);
  491. FReportShowStateText := GetStrPropertyDef('ReportShowStateText', '标段未批复');
  492. FReportShowStateWithoutReply := GetBoolPropertyDef('ReportShowStateWithoutReply', True);
  493. end;
  494. procedure TProjProperties.Open(AConnection: TADOConnection);
  495. begin
  496. FPropertyInqurity := TPropertyInquiry.Create(AConnection);
  497. FPropertyInqurity.TableName := 'ProjProperties';
  498. LoadBaseProperties;
  499. LoadViewProperties;
  500. LoadDealInfo;
  501. LoadTechParameters;
  502. LoadCalcParameters;
  503. LoadDateTime;
  504. FUnlockInfoPassword := GetStrPropertyDef('UnlockInfoPassword', '');
  505. FUpdateFlag := GetIntPropertyDef('UpdateFlag', 0);
  506. end;
  507. procedure TProjProperties.Reload;
  508. begin
  509. LoadBaseProperties;
  510. LoadViewProperties;
  511. LoadDealInfo;
  512. LoadTechParameters;
  513. LoadCalcParameters;
  514. FUnlockInfoPassword := GetStrPropertyDef('UnlockInfoPassword', '');
  515. end;
  516. procedure TProjProperties.Save;
  517. begin
  518. SaveDealInfo;
  519. SaveTechParameters;
  520. SaveCalcParameters;
  521. // 无意义,不可删除,Sql最后一句不执行,写多一句,以保证完整执行
  522. FPropertyInqurity.Value['Complete'] := True;
  523. end;
  524. procedure TProjProperties.SaveCalcParameters;
  525. begin
  526. if FPhaseCount > 0 then Exit;
  527. FPropertyInqurity.Value['DealPayAloneDigit'] := FDealPayAloneDigit;
  528. with FDecimalManager do
  529. begin
  530. {FPropertyInqurity.Value['QuantityDigit'] := Common.Quantity.Digit;
  531. FPropertyInqurity.Value['TotalPriceDigit'] := Common.TotalPrice.Digit;
  532. FPropertyInqurity.Value['QuantityDigit1'] := Compile.Quantity.Digit;
  533. FPropertyInqurity.Value['TotalPriceDigit1'] := Compile.TotalPrice.Digit;}
  534. //FPropertyInqurity.Value['PM_PriceDigit'] := PriceMargin.Price.Digit;
  535. FPropertyInqurity.Value['DealPayTPDigit'] := DealPay.TotalPrice.Digit;
  536. end;
  537. end;
  538. procedure TProjProperties.SaveDealInfo;
  539. begin
  540. FPropertyInqurity.Value['ProjectName'] := FProjectName;
  541. FPropertyInqurity.Value['DealName'] := FDealName;
  542. FPropertyInqurity.Value['DealIndex'] := FDealIndex;
  543. FPropertyInqurity.Value['DealType'] := FDealType;
  544. FPropertyInqurity.Value['BName'] := FBName;
  545. FPropertyInqurity.Value['BLegal'] := FBLegal;
  546. FPropertyInqurity.Value['BDate'] := FBDate;
  547. FPropertyInqurity.Value['CName'] := FCName;
  548. FPropertyInqurity.Value['CLegal'] := FCLegal;
  549. FPropertyInqurity.Value['CDate'] := FCDate;
  550. FPropertyInqurity.Value['CName_2'] := FCName_2;
  551. FPropertyInqurity.Value['CLegal_2'] := FCLegal_2;
  552. FPropertyInqurity.Value['CDate_2'] := FCDate_2;
  553. FPropertyInqurity.Value['SName'] := FSName;
  554. FPropertyInqurity.Value['SLegal'] := FSLegal;
  555. FPropertyInqurity.Value['SDate'] := FSDate;
  556. FPropertyInqurity.Value['SName_2'] := FSName_2;
  557. FPropertyInqurity.Value['SLegal_2'] := FSLegal_2;
  558. FPropertyInqurity.Value['SDate_2'] := FSDate_2;
  559. end;
  560. procedure TProjProperties.SaveTechParameters;
  561. begin
  562. FPropertyInqurity.Value['LoadLevel'] := FLoadLevel;
  563. FPropertyInqurity.Value['StartPeg'] := FStartPeg;
  564. FPropertyInqurity.Value['EndPeg'] := FEndPeg;
  565. FPropertyInqurity.Value['LoadLength'] := FLoadLength;
  566. FPropertyInqurity.Value['LaneCount'] := FLaneCount;
  567. FPropertyInqurity.Value['DealPhase'] := FDealPhase;
  568. end;
  569. procedure TProjProperties.SetAuditCompany(const Value: string);
  570. begin
  571. FPropertyInqurity.Value['AuditCompany'] := Value;
  572. end;
  573. procedure TProjProperties.SetAuditStatus(const Value: Integer);
  574. begin
  575. FPropertyInqurity.Value['AuditStatus'] := Value;
  576. end;
  577. procedure TProjProperties.SetBaseline(const Value: string);
  578. begin
  579. FBaseline := Value;
  580. FPropertyInqurity.Value['Baseline'] := Value;
  581. end;
  582. procedure TProjProperties.SetContractPrice(const Value: Double);
  583. begin
  584. FContractPrice := Value;
  585. FPropertyInqurity.Value['ContractPrice'] := Value;
  586. end;
  587. procedure TProjProperties.SetDeadline(const Value: string);
  588. begin
  589. FDeadline := Value;
  590. FPropertyInqurity.Value['Deadline'] := Value;
  591. end;
  592. procedure TProjProperties.SetDealPayAloneDigit(const Value: Boolean);
  593. begin
  594. FDealPayAloneDigit := Value;
  595. if Value then
  596. DecimalManager.DealPay.RelaCalcDecimal := nil
  597. else
  598. DecimalManager.DealPay.RelaCalcDecimal := DecimalManager.Common;
  599. end;
  600. procedure TProjProperties.SetFinalAuditCount(const Value: Integer);
  601. begin
  602. FPropertyInqurity.Value['FinalAuditCount'] := Value;
  603. end;
  604. procedure TProjProperties.SetLockedLedgerData(const Value: Boolean);
  605. begin
  606. FLockedLedgerData := Value;
  607. FPropertyInqurity.Value['LockedLedgerData'] := Value;
  608. end;
  609. procedure TProjProperties.SetMaterialSubsist(const Value: Double);
  610. begin
  611. FMaterialSubsist := Value;
  612. FPropertyInqurity.Value['MaterialSubsist'] := Value;
  613. end;
  614. procedure TProjProperties.SetPhaseCount(const Value: Integer);
  615. begin
  616. FPhaseCount := Value;
  617. FPropertyInqurity.Value['PhaseCount'] := Value;
  618. end;
  619. procedure TProjProperties.SetPhaseIndex(const Value: Integer);
  620. begin
  621. FPhaseIndex := Value;
  622. FPropertyInqurity.Value['PhaseIndex'] := Value;
  623. end;
  624. procedure TProjProperties.SetQuantityDigit(const Value: Integer);
  625. begin
  626. FQuantityDigit := Value;
  627. FPropertyInqurity.Value['QuantityDigit'] := Value;
  628. FQuantityFormat := GetDisplayFormat(FQuantityDigit);
  629. end;
  630. procedure TProjProperties.SetReportShading(const Value: string);
  631. begin
  632. FReportShading := Value;
  633. FPropertyInqurity.Value['ReportShading'] := Value;
  634. end;
  635. procedure TProjProperties.SetReportShowState(const Value: Boolean);
  636. begin
  637. FReportShowState := Value;
  638. FPropertyInqurity.Value['ReportShowState'] := Value;
  639. end;
  640. procedure TProjProperties.SetReportShowStateText(const Value: string);
  641. begin
  642. FReportShowStateText := Value;
  643. FPropertyInqurity.Value['ReportShowStateText'] := Value;
  644. end;
  645. procedure TProjProperties.SetReportShowStateWithoutReply(
  646. const Value: Boolean);
  647. begin
  648. FReportShowStateWithoutReply := Value;
  649. FPropertyInqurity.Value['ReportShowStateWithoutReply'] := Value;
  650. end;
  651. procedure TProjProperties.SetShowAlias(const Value: Boolean);
  652. begin
  653. FShowAlias := Value;
  654. FPropertyInqurity.Value['ShowAlias'] := Value;
  655. end;
  656. procedure TProjProperties.SetShowBGLCode(const Value: Boolean);
  657. begin
  658. FShowBGLCode := Value;
  659. FPropertyInqurity.Value['ShowBGLCode'] := Value;
  660. end;
  661. procedure TProjProperties.SetShowDesignQuantity(const Value: Boolean);
  662. begin
  663. FShowDesignQuantity := Value;
  664. FPropertyInqurity.Value['ShowDesignQuantity'] := Value;
  665. end;
  666. procedure TProjProperties.SetShowPriceChange(const Value: Boolean);
  667. begin
  668. FShowPriceChange := Value;
  669. FPropertyInqurity.Value['ShowPriceChange'] := Value;
  670. end;
  671. procedure TProjProperties.SetShowReportShading(const Value: Boolean);
  672. begin
  673. FShowReportShading := Value;
  674. FPropertyInqurity.Value['ShowReportShading'] := Value;
  675. end;
  676. procedure TProjProperties.SetStartedSubsist(const Value: Double);
  677. begin
  678. FStartedSubsist := Value;
  679. FPropertyInqurity.Value['StartedSubsist'] := Value;
  680. end;
  681. procedure TProjProperties.SetTotalPriceDigit(const Value: Integer);
  682. begin
  683. FTotalPriceDigit := Value;
  684. FPropertyInqurity.Value['TotalPriceDigit'] := Value;
  685. FTotalPriceFormat := GetDisplayFormat(FTotalPriceDigit);
  686. end;
  687. procedure TProjProperties.SetUnlockInfoPassword(const Value: string);
  688. begin
  689. FUnlockInfoPassword := Value;
  690. FPropertyInqurity.Value['UnlockInfoPassword'] := Value;
  691. end;
  692. procedure TProjProperties.SetUpdateFlag(const Value: Integer);
  693. begin
  694. FUpdateFlag := Value;
  695. FPropertyInqurity.Value['UpdateFlag'] := Value;
  696. end;
  697. procedure TProjProperties.SetZJJLPreText(const Value: string);
  698. begin
  699. FZJJLPreText := Value;
  700. FPropertyInqurity.Value['ZJJLPreText'] := Value;
  701. end;
  702. end.