admin_unit.~pas
上传用户:bjkrmsxy
上传日期:2010-01-31
资源大小:9004k
文件大小:3k
源码类别:

百货/超市行业

开发平台:

Delphi

  1. unit admin_unit;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, Grids, DBGrids, DB, ADODB, ExtCtrls;
  6. type
  7.   TAdmin_Form = class(TForm)
  8.     Panel1: TPanel;
  9.     Panel2: TPanel;
  10.     ADOQuery1: TADOQuery;
  11.     ADOQuery2: TADOQuery;
  12.     DataSource1: TDataSource;
  13.     DataSource2: TDataSource;
  14.     DBGrid1: TDBGrid;
  15.     DBGrid2: TDBGrid;
  16.     GroupBox1: TGroupBox;
  17.     Label1: TLabel;
  18.     Label2: TLabel;
  19.     GroupBox2: TGroupBox;
  20.     Button1: TButton;
  21.     Button2: TButton;
  22.     Button3: TButton;
  23.     Button4: TButton;
  24.     Button5: TButton;
  25.     Button6: TButton;
  26.     Button7: TButton;
  27.     Button8: TButton;
  28.     Button9: TButton;
  29.     Button10: TButton;
  30.     Button11: TButton;
  31.     Button12: TButton;
  32.     Button13: TButton;
  33.     Button14: TButton;
  34.     Label3: TLabel;
  35.     Label4: TLabel;
  36.     procedure Button1Click(Sender: TObject);
  37.     procedure Button2Click(Sender: TObject);
  38.     procedure Button3Click(Sender: TObject);
  39.     procedure Button4Click(Sender: TObject);
  40.     procedure Button5Click(Sender: TObject);
  41.     procedure Button6Click(Sender: TObject);
  42.     procedure Button7Click(Sender: TObject);
  43.     procedure Button8Click(Sender: TObject);
  44.     procedure Button9Click(Sender: TObject);
  45.     procedure Button10Click(Sender: TObject);
  46.     procedure Button11Click(Sender: TObject);
  47.     procedure Button12Click(Sender: TObject);
  48.     procedure Button13Click(Sender: TObject);
  49.     procedure Button14Click(Sender: TObject);
  50.     procedure FormActivate(Sender: TObject);
  51.   private
  52.     { Private declarations }
  53.   public
  54.     { Public declarations }
  55.   end;
  56. var
  57.   Admin_Form: TAdmin_Form;
  58. implementation
  59. uses datamodule;
  60. {$R *.dfm}
  61. procedure TAdmin_Form.Button1Click(Sender: TObject);
  62. begin
  63. adoquery1.insert;
  64. end;
  65. procedure TAdmin_Form.Button2Click(Sender: TObject);
  66. begin
  67.  adoquery1.edit;
  68. end;
  69. procedure TAdmin_Form.Button3Click(Sender: TObject);
  70. begin
  71. adoquery1.delete;
  72. end;
  73. procedure TAdmin_Form.Button4Click(Sender: TObject);
  74. begin
  75. adoquery1.prior;
  76. end;
  77. procedure TAdmin_Form.Button5Click(Sender: TObject);
  78. begin
  79. adoquery1.next;
  80. end;
  81. procedure TAdmin_Form.Button6Click(Sender: TObject);
  82. begin
  83.  adoquery1.post;
  84. end;
  85. procedure TAdmin_Form.Button7Click(Sender: TObject);
  86. begin
  87. adoquery1.close;
  88. adoquery2.close;
  89. close;
  90. end;
  91. procedure TAdmin_Form.Button8Click(Sender: TObject);
  92. begin
  93. adoquery2.insert;
  94. end;
  95. procedure TAdmin_Form.Button9Click(Sender: TObject);
  96. begin
  97. adoquery2.edit;
  98. end;
  99. procedure TAdmin_Form.Button10Click(Sender: TObject);
  100. begin
  101. adoquery2.delete;
  102. end;
  103. procedure TAdmin_Form.Button11Click(Sender: TObject);
  104. begin
  105. adoquery2.prior;
  106. end;
  107. procedure TAdmin_Form.Button12Click(Sender: TObject);
  108. begin
  109. adoquery2.next;
  110. end;
  111. procedure TAdmin_Form.Button13Click(Sender: TObject);
  112. begin
  113.  adoquery2.post;
  114. end;
  115. procedure TAdmin_Form.Button14Click(Sender: TObject);
  116. begin
  117. adoquery1.close;
  118. adoquery2.close;
  119. close;
  120. end;
  121. procedure TAdmin_Form.FormActivate(Sender: TObject);
  122. begin
  123. if not adoquery1.active then
  124. adoquery1.open;
  125. if not adoquery2.active then
  126. adoquery2.open;
  127. end;
  128. end.