Changeset 158 for devel/web/UBill.pas


Ignore:
Timestamp:
Feb 18, 2009, 12:11:53 PM (16 years ago)
Author:
george
Message:
  • Upraveno: Přepracován databázový objektový subsystém.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/web/UBill.pas

    r142 r158  
    1717  { TBillItem }
    1818
    19   TBillItem = class(TDbObject)
     19  TBillItem = class
     20    Id: Integer;
    2021    Description: string;
    2122    Quantity: Integer;
    2223    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
    2829  end;
    2930
    3031  { TBill }
    3132
    32   TBill = class(TDbObject)
     33  TBill = class
    3334  private
    3435    function CreateBill: Integer;
    3536  public
     37    Id: Integer;
    3638    Items: TBillItemList;
    3739    User: TUser;
     
    4345    TimeDue: TDateTime;
    4446    function GenerateBill: string;
    45     procedure Load; override;
    46     procedure Store; override;
     47    procedure Load;
     48    procedure Store;
    4749  end;
    4850
     
    5961  T: TUser;
    6062begin
     63 (*
    6164  T.FirstName:= 'ss';
    6265
    6366  DbRows := Database.Select('finance_bills', '*', 'id=' + IntToStr(Id));
    64   LoadFromDbRecord(DbRows[0]);
     67//  LoadFromDbRecord(DbRows[0]);
    6568  DbRows.Free;
    6669
     
    7477    BillItem := TBillItem.Create;
    7578//    BillItem.LoadFromDbRecord(DbRows[I]);
    76     Items.Add(BillItem);
     79//    Items.Add(BillItem);
    7780  end;
    7881
     
    132135    '<tr><td colspan="2"><hr></td></tr>' +
    133136    '</table>';
     137    *)
    134138end;
    135139
    136140procedure TBill.Load;
    137141begin
     142(*
    138143  Id := StrToInt(DbRow.Values['id']);
    139144  BillCode := DbRow.Values['BillCode'];
     
    143148  TimeCreate := UnixToDateTime(StrToInt(DbRow.Values['time_create']));
    144149  UserId := StrToInt(DbRow.Values['user_id']);
     150*)
    145151end;
    146152
     
    158164  Database.Update('finance_bills', Data, 'id=' + IntToStr(Id));
    159165  Data.Free;
    160   inherited Store;
    161166end;
    162167
Note: See TracChangeset for help on using the changeset viewer.