ОСЫМША В
Листинг
unit ufmMain;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Menus, ComCtrls, ToolWin, ActnList, ImgList, ExtCtrls, DBCtrls, Grids, DBGrids, StdCtrls, StdActns;
type TMain = class(TForm) ActionList1: TActionList; MainMenu1: TMainMenu; ImageList1: TImageList; Splitter1: TSplitter; Panel1: TPanel; Panel2: TPanel; Panel3: TPanel; Panel4: TPanel; dbnPrihod: TDBNavigator; dbnSpisanie: TDBNavigator; dbgPrihod: TDBGrid; dbgSpisanie: TDBGrid; Panel5: TPanel; Bevel1: TBevel; Label1: TLabel; Panel6: TPanel; Bevel2: TBevel; Label2: TLabel; ActionExit: TFileExit; N1: TMenuItem; Exit1: TMenuItem; ActionSclad: TAction; ActionPodrazd: TAction; ActionNomGrup: TAction; ActionMat: TAction; ActionStatiya: TAction; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; N7: TMenuItem; N8: TMenuItem; ActionMatVed: TAction; N9: TMenuItem; procedure dbgPrihodDblClick(Sender: TObject); procedure dbnPrihodClick(Sender: TObject; Button: TNavigateBtn); procedure dbgSpisanieDblClick(Sender: TObject); procedure dbnSpisanieClick(Sender: TObject; Button: TNavigateBtn); procedure ActionMatExecute(Sender: TObject); procedure ActionScladExecute(Sender: TObject); procedure ActionPodrazdExecute(Sender: TObject); procedure ActionNomGrupExecute(Sender: TObject); procedure ActionStatiyaExecute(Sender: TObject); procedure ActionMatVedExecute(Sender: TObject); private { Private declarations } public { Public declarations } end;
var TMain: Tmain;
implementation
uses udmMain, ufmPrihod, ufmSpisanie, ufmNSI, ufmMatVed;
{$R *.dfm}
procedure Tmain.ActionMatExecute(Sender: TObject); begin ShowNSIForm('Ìàòåðèàëû', 'Ìàòåðèàëû'); end;
procedure Tmain.ActionMatVedExecute(Sender: TObject); begin fmMatVed:= TfmMatVed.Create(Application); fmMatVed.ShowModal; fmMatVed.Free; end;
procedure Tmain.ActionNomGrupExecute(Sender: TObject); begin ShowNSIForm('ÍîìåíêëàòóðíûåÃðóïïû', 'Íîìåíêëàòóðíûå ãðóïïû'); end;
procedure Tmain.ActionPodrazdExecute(Sender: TObject); begin ShowNSIForm('Ïîäðàçäåëåíèÿ', 'Ïîäðàçäåëåíèÿ'); end;
procedure Tmain.ActionScladExecute(Sender: TObject); begin ShowNSIForm('Ñêëàäû', 'Ñêëàäû'); end;
procedure Tmain.ActionStatiyaExecute(Sender: TObject); begin ShowNSIForm('ÑòàòüèÇàòðàò', 'Ñòàòüè çàòðàò'); end;
procedure Tmain.dbgPrihodDblClick(Sender: TObject); begin fmPrihod:= TfmPrihod.Create(Application); fmPrihod.ShowModal; fmPrihod.Free; end;
procedure Tmain.dbgSpisanieDblClick(Sender: TObject); begin fmSpisanie:= TfmSpisanie.Create(Application); fmSpisanie.ShowModal; fmSpisanie.Free; end;
procedure Tmain.dbnSpisanieClick(Sender: TObject; Button: TNavigateBtn); begin if Button in [nbEdit, nbInsert] then dbgSpisanieDblClick(Sender); end;
procedure Tmain.dbnPrihodClick(Sender: TObject; Button: TNavigateBtn); begin if Button in [nbEdit, nbInsert] then dbgPrihodDblClick(Sender); end;
end. unit ufmMatVed;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, RpBase, RpSystem, RpDefine, RpRave, StdCtrls, Buttons, ComCtrls, RpCon, RpConDS;
type TfmMatVed = class(TForm) RvProject: TRvProject; RvSystem: TRvSystem; bbtnStart: TBitBtn; dtpBegin: TDateTimePicker; dtpEnd: TDateTimePicker; Label1: TLabel; Label2: TLabel; RvDataSetConnection: TRvDataSetConnection; procedure bbtnStartClick(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;
var fmMatVed: TfmMatVed;
implementation
uses udmMain;
{$R *.dfm}
procedure TfmMatVed.bbtnStartClick(Sender: TObject); var DBegin, DEnd: TDateTime; Year, Month, Day: Word; begin with dmMain do begin DecodeDate(dtpBegin.DateTime, Year, Month, Day); DBegin:= EncodeDate(Year, Month, Day);
DecodeDate(dtpEnd.DateTime, Year, Month, Day); DEnd:= EncodeDate(Year, Month, Day) + EncodeTime(23, 59, 59, 999);
adospMatVed.Parameters.FindParam('ПериодС').Value:= DBegin; adospMatVed.Parameters.FindParam('ПериодПо').Value:= DEnd; adospMatVed.Open;
RvProject.Open; RvProject.SelectReport('RaveProject', False); RvProject.Execute; RvProject.Close;
adospMatVed.Close; end; end;
procedure TfmMatVed.FormCreate(Sender: TObject); begin RvProject.ProjectFile:= ChangeFileExt(ParamStr(0), '.rav'); dtpBegin.DateTime:= Now; dtpEnd.DateTime:= dtpBegin.DateTime; end;
end.
|