unit NachrichtenUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, DBCtrls, Grids, DBGrids,
DB, ADODB, ExtCtrls,
Menus, RpBase, RpSystem, RpConDS, RpDefine, RpCon, RpRave;
type
TNachrichten =
class(TForm)
TblNachrichten: TADOTable;
DSNachrichten: TDataSource;
DBGrid1: TDBGrid;
BtnSchliessen: TButton;
MemoNachricht: TDBMemo;
EditAbsVorname: TDBEdit;
EditAbsNachname: TDBEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
EditBetreff: TDBEdit;
Label5: TLabel;
DBNavigator1: TDBNavigator;
MainMenu1: TMainMenu;
Men1: TMenuItem;
Neu1: TMenuItem;
Lschen1: TMenuItem;
Schliessen1: TMenuItem;
Label4: TLabel;
EditPrioritaet: TDBEdit;
QryPrio: TADOQuery;
DSPrio: TDataSource;
QrySender: TADOQuery;
DSSender: TDataSource;
Button1: TButton;
RvDataSetNachricht: TRvDataSetConnection;
RvDataSetName: TRvDataSetConnection;
RvDataSetPrio: TRvDataSetConnection;
RvProject1: TRvProject;
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure BtnSchliessenClick(Sender: TObject);
procedure Lschen1Click(Sender: TObject);
procedure Neu1Click(Sender: TObject);
procedure DSNachrichtenDataChange(Sender: TObject; Field: TField);
procedure Button1Click(Sender: TObject);
procedure Schliessen1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Nachrichten: TNachrichten;
implementation
uses NachrichtNeuUnit, HauptUnit;
{$R *.dfm}
procedure TNachrichten.FormShow(Sender: TObject);
begin
TblNachrichten.Open;
QryPrio.Open;
QrySender.Open;
BtnSchliessen.SetFocus;
end;
procedure TNachrichten.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
TblNachrichten.Close;
QryPrio.Close;
QrySender.Close;
end;
procedure TNachrichten.BtnSchliessenClick(Sender: TObject);
begin
Nachrichten.Close;
end;
procedure TNachrichten.Lschen1Click(Sender: TObject);
begin
// Vorher nachfragen:
if messagedlg('
Soll die Nachricht wirklich gelöscht werden?', mtConfirmation , [mbYes, mbNo], 0) = mrYes
then
begin
TblNachrichten.Delete;
end;
TblNachrichten.Close;
TblNachrichten.Open;
end;
procedure TNachrichten.Neu1Click(Sender: TObject);
begin
NachrichtNeu.Showmodal;
end;
procedure TNachrichten.DSNachrichtenDataChange(Sender: TObject;
Field: TField);
var
IDP : Integer;
//Prio ID
IDS : Integer;
//Sender ID
begin
IDP := TblNachrichten.FieldByName('
prioritaet').AsInteger;
IDS := TblNachrichten.FieldByName('
sender_id').AsInteger;
QryPrio.Parameters.ParamByName('
IDP').Value := IDP;
QrySender.Parameters.ParamByName('
IDS').Value := IDS;
QryPrio.Close;
QryPrio.Open;
QrySender.Close;
QrySender.Open;
end;
procedure TNachrichten.Button1Click(Sender: TObject);
begin
HauptForm.RvSystemPrint.SystemSetups := HauptForm.RvSystemPrint.SystemSetups - [ssAllowSetup];
HauptForm.RvSystemPrint.DefaultDest := rdPrinter;
//RvProject1.Execute;
end;
procedure TNachrichten.Schliessen1Click(Sender: TObject);
begin
Nachrichten.Close;
end;
end.