Сущность проектируемой автоматизированной системы

Автор работы: Пользователь скрыл имя, 30 Ноября 2010 в 22:19, Не определен

Описание работы

Курсовой проект

Файлы: 1 файл

Куровая по проектированию.doc

— 1.18 Мб (Скачать файл)

           DBNavigator1: TDBNavigator;

           Button1: TButton;

           Button3: TButton;

           Image1: TImage;

           procedure Button2Click(Sender: TObject);

           procedure Button1Click(Sender: TObject);

           procedure Button3Click(Sender: TObject);

         private

           { Private declarations }

         public

           { Public declarations }

         end; 

       var

         Form3: TForm3;

           w,tab: variant;

       implementation 

       uses Unit6; 

       {$R *.dfm} 

       procedure TForm3.Button2Click(Sender: TObject);

       begin

       DataSource1.DataSet:=Query1;

       case RadioGroup1.ItemIndex of

         0:begin

             Query1.Active:=False;

             Query1.SQL.Clear;

             Query1.SQL.Add('SELECT * FROM uch_chast WHERE Kurs='+#39+Edit1.Text+#39);

             Query1.Active:=True;

           end;

         1:begin

             Query1.Active:=False;

             Query1.SQL.Clear;

             Query1.SQL.Add('SELECT * FROM uch_chast WHERE Spez='+#39+Edit1.Text+#39);

             Query1.Active:=True;

           end;

           2:begin

             Query1.Active:=False;

             Query1.SQL.Clear;

             Query1.SQL.Add('SELECT * FROM uch_chast WHERE Disz='+#39+Edit1.Text+#39);

             Query1.Active:=True;

           end;

         3:begin

            Query1.Active:=False;

             Query1.SQL.Clear;

             Query1.SQL.Add('SELECT * FROM uch_chast WHERE Prepod='+#39+Edit1.Text+#39);

             Query1.Active:=True;

           end;

        

       end;

       end;

       procedure TForm3.Button1Click(Sender: TObject);

       var

       i:integer;

       begin

       w:=CreateOleObject('Word.Application');

       w.Visible:=true;

       w.Documents.Add;

       tab:=w.ActiveDocument.Tables.Add(Range:=w.ActiveDocument.range, NumRows:=2, NumColumns:=13);

       tab.Autoformat (Format:=31); 

       tab.columns.item(1).width:=20;

       tab.columns.item(2).width:=90;

       tab.columns.item(3).width:=70;

       tab.columns.item(4).width:=90;

       tab.columns.item(5).width:=80;

       tab.columns.item(6).width:=100;

       tab.columns.item(7).width:=80;

       tab.columns.item(8).width:=80;

       tab.columns.item(9).width:=80;

       tab.columns.item(10).width:=90;

       tab.columns.item(11).width:=90;

       tab.columns.item(12).width:=90;

       tab.columns.item(13).width:=90; 

       tab.cell(1,1).range.text:='nom'; 

       for i:=2 to 13 do

         tab.cell(1,i).range.text:=dbGrid1.Columns[i-1].Title.caption;

        i:=2;

        Query1.First; 

         while not(Query1.Eof) do

          begin

         tab.rows.add; 
 
 
 

        tab.cell(i,1).range.text:=Form3.Table1.fieldbyName('nom').AsString;

        tab.cell(i,2).range.text:=Form3.Table1.fieldbyName('fam').AsString;

        tab.cell(i,3).range.text:=Form3.Table1.fieldbyName('im').AsString;

        tab.cell(i,4).range.text:=Form3.Table1.fieldbyName('ot').AsString;

        tab.cell(i,5).range.text:=Form3.Table1.fieldbyName('dr').AsString;

        tab.cell(i,6).range.text:=Form3.Table1.fieldbyName('adr').AsString;

        tab.cell(i,7).range.text:=Form3.Table1.fieldbyName('gr').AsString;

        tab.cell(i,8).range.text:=Form3.Table1.fieldbyName('sv').AsString;

        tab.cell(i,9).range.text:=Form3.Table1.fieldbyName('nompr').AsString;

        tab.cell(i,10).range.text:=Form3.Table1.fieldbyName('ob').AsString;

        tab.cell(i,11).range.text:=Form3.Table1.fieldbyName('mat').AsString;

        tab.cell(i,12).range.text:=Form3.Table1.fieldbyName('ote').AsString;

        tab.cell(i,13).range.text:=Form3.Table1.fieldbyName('dopsv').AsString; 
 

         form3.Query1.Next;

       i:=i+1;

       end; 

       tab.rows.item(i).delete;

       end; 
 

        

       procedure TForm3.Button3Click(Sender: TObject);

       begin

       DataSource1.DataSet:=Query1;

       Query1.Active:=False;

             Query1.SQL.Clear;

             Query1.SQL.Add('SELECT * FROM Student');

             Query1.Active:=True;

       end; 

       end. 
 
 

           Программный код формы 4: 

           unit Unit5; 

           interface 

           uses

             Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

             Dialogs, StdCtrls, jpeg, ExtCtrls; 

           type

             TForm5 = class(TForm)

               Label1: TLabel;

               Label2: TLabel;

               Label3: TLabel;

               procedure Button1Click(Sender: TObject);

             private

               { Private declarations }

             public

               { Public declarations }

             end; 

           var

             Form5: TForm5; 

           implementation 

           {$R *.dfm} 

           procedure TForm5.Button1Click(Sender: TObject);

           begin

           Close;

           end; 

           end. 

           Программный код  формы № 5

           unit Unit6; 

           interface 

           uses

             Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

             Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables, StdCtrls, ComObj,

             jpeg ; 

           type

             TForm6 = class(TForm)

               Table1: TTable;

               DataSource1: TDataSource;

               DBGrid1: TDBGrid;

               DBNavigator2: TDBNavigator;

               RadioGroup1: TRadioGroup;

               Edit1: TEdit;

               Button2: TButton;

               Query1: TQuery;

               Button3: TButton;

               Image1: TImage;

               Button1: TButton;

               procedure Button2Click(Sender: TObject);

               procedure Button1Click(Sender: TObject);

               procedure Button3Click(Sender: TObject);

             private

               { Private declarations }

             public

               { Public declarations }

             end; 

           var

             Form6: TForm6;

              w,tab: variant;

           implementation 

           {$R *.dfm} 

           procedure TForm6.Button2Click(Sender: TObject);

           begin

           DataSource1.DataSet:=Query1;

           case RadioGroup1.ItemIndex of 

             0:begin

                 Query1.Active:=False;

                 Query1.SQL.Clear;

                 Query1.SQL.Add('SELECT * FROM otdel_kadr WHERE Fam='+#39+Edit1.Text+#39);

                 Query1.Active:=True;

              end;

             1:begin

                 Query1.Active:=False;

                 Query1.SQL.Clear;

                 Query1.SQL.Add('SELECT * FROM otdel_kadr WHERE Obuchen='+#39+Edit1.Text+#39);

                 Query1.Active:=True;

               end;

             end;

             end; 

           procedure TForm6.Button1Click(Sender: TObject);

           var

           i:integer;

           begin

           w:=CreateOleObject('Word.Application');

           w.Visible:=true;

           w.Documents.Add;

           tab:=w.ActiveDocument.Tables.Add(Range:=w.ActiveDocument.range, NumRows:=2, NumColumns:=9);

           tab.Autoformat (Format:=31); 
     
     
     
     

           tab.columns.item(1).width:=20;

           tab.columns.item(2).width:=100;

           tab.columns.item(3).width:=70;

           tab.columns.item(4).width:=70;

           tab.columns.item(5).width:=80;

           tab.columns.item(6).width:=100;

           tab.columns.item(7).width:=80;

           tab.columns.item(8).width:=80;

Информация о работе Сущность проектируемой автоматизированной системы