Changeset 158 for devel/web/UBill.pas
- Timestamp:
- Feb 18, 2009, 12:11:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/web/UBill.pas
r142 r158 17 17 { TBillItem } 18 18 19 TBillItem = class(TDbObject) 19 TBillItem = class 20 Id: Integer; 20 21 Description: string; 21 22 Quantity: Integer; 22 23 Price: Double; 23 procedure Load; override;24 procedure Store; override;25 end; 26 27 TBillItemList = class (TDbList)24 procedure Load; 25 procedure Store; 26 end; 27 28 TBillItemList = class 28 29 end; 29 30 30 31 { TBill } 31 32 32 TBill = class (TDbObject)33 TBill = class 33 34 private 34 35 function CreateBill: Integer; 35 36 public 37 Id: Integer; 36 38 Items: TBillItemList; 37 39 User: TUser; … … 43 45 TimeDue: TDateTime; 44 46 function GenerateBill: string; 45 procedure Load; override;46 procedure Store; override;47 procedure Load; 48 procedure Store; 47 49 end; 48 50 … … 59 61 T: TUser; 60 62 begin 63 (* 61 64 T.FirstName:= 'ss'; 62 65 63 66 DbRows := Database.Select('finance_bills', '*', 'id=' + IntToStr(Id)); 64 LoadFromDbRecord(DbRows[0]);67 // LoadFromDbRecord(DbRows[0]); 65 68 DbRows.Free; 66 69 … … 74 77 BillItem := TBillItem.Create; 75 78 // BillItem.LoadFromDbRecord(DbRows[I]); 76 Items.Add(BillItem);79 // Items.Add(BillItem); 77 80 end; 78 81 … … 132 135 '<tr><td colspan="2"><hr></td></tr>' + 133 136 '</table>'; 137 *) 134 138 end; 135 139 136 140 procedure TBill.Load; 137 141 begin 142 (* 138 143 Id := StrToInt(DbRow.Values['id']); 139 144 BillCode := DbRow.Values['BillCode']; … … 143 148 TimeCreate := UnixToDateTime(StrToInt(DbRow.Values['time_create'])); 144 149 UserId := StrToInt(DbRow.Values['user_id']); 150 *) 145 151 end; 146 152 … … 158 164 Database.Update('finance_bills', Data, 'id=' + IntToStr(Id)); 159 165 Data.Free; 160 inherited Store;161 166 end; 162 167
Note:
See TracChangeset
for help on using the changeset viewer.