You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
4.6 KiB
Plaintext

unit u_sys_message_pri;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, BusinessSkinForm, dxExEdtr, dxCntner, dxTL, dxDBCtrl, dxDBGrid,
dxDBTLCl, dxGrClms, bsSkinCtrls, StdCtrls, wwdbdatetimepicker, RxLookup,
DB, ADODB;
type
Tfrm_sys_message_pri = class(TForm)
bsBusinessSkinForm1: TbsBusinessSkinForm;
dxDBGrid: TdxDBGrid;
colSpeciesNo: TdxDBGridColumn;
colNotes: TdxDBGridMemoColumn;
colSpeciesName: TdxDBGridColumn;
colLength: TdxDBGridColumn;
bsSkinPanel1: TbsSkinPanel;
bsSkinButton2: TbsSkinButton;
bsSkinButton1: TbsSkinButton;
bsSkinButton3: TbsSkinButton;
Label1: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
wwDBDateTimePicker2: TwwDBDateTimePicker;
Label2: TLabel;
Label13: TLabel;
RxDBLookupCombo5: TRxDBLookupCombo;
bsSkinButton4: TbsSkinButton;
p_do: TADOStoredProc;
procedure FormShow(Sender: TObject);
procedure bsSkinButton2Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure dxDBGridCustomDrawCell(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxTreeListColumn;
ASelected, AFocused, ANewItemRow: Boolean; var AText: String;
var AColor: TColor; AFont: TFont; var AAlignment: TAlignment;
var ADone: Boolean);
procedure bsSkinButton1Click(Sender: TObject);
procedure bsSkinButton4Click(Sender: TObject);
procedure bsSkinButton3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_sys_message_pri: Tfrm_sys_message_pri;
implementation
uses u_main, my_sys_function, u_sys_message_tell;
{$R *.dfm}
procedure Tfrm_sys_message_pri.FormShow(Sender: TObject);
begin
frm_main.t_sys_message_yes.Requery();
end;
procedure Tfrm_sys_message_pri.bsSkinButton2Click(Sender: TObject);
begin
p_do.Parameters.ParamByName('SQLStr').value:='update t_sys_massage set ÊÇ·ñÖªµÀ=1 where ½ÓÊÕ·½='
+''''+employee+''''+' and ÊÇ·ñÖªµÀ=0';
p_do.ExecProc;
if assigned(frm_sys_message_tell) then
begin
frm_sys_message_tell.Edit1.Lines.Clear;
frm_sys_message_tell.RichEdit1.Lines.Clear;
frm_sys_message_tell.Hide;
end;
close;
end;
procedure Tfrm_sys_message_pri.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
frm_main.t_sys_message_yes.close;
frm_main.t_sys_message_yes.sql.clear;
frm_main.t_sys_message_yes.SQL.add('select * from t_sys_massage where ½ÓÊÕ·½='+
''''+employee+''''+' and ÊÇ·ñÖªµÀ=0 order by ʱ¼ä desc');
frm_main.t_sys_message_yes.open;
end;
procedure Tfrm_sys_message_pri.dxDBGridCustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
AColor:=GridDrawCell(ANode);
AFont.Color:=clblack;
end;
procedure Tfrm_sys_message_pri.bsSkinButton1Click(Sender: TObject);
var
str:widestring;
Year, Month, Day: word;
begin
str:=' where (·¢ËÍ·½='+''''+employee+''''+' or ½ÓÊÕ·½='+''''+employee+''''+')';
if wwDBDateTimePicker1.text<>''then
begin
DecodeDate(wwDBDateTimePicker1.date, Year, Month, day);
str:=str+' and (DATEPART(Year,ʱ¼ä)*10000+DATEPART(month,ʱ¼ä)*100+DATEPART(day,ʱ¼ä))>='
+inttostr(Year*10000+Month*100+day);
end;
if wwDBDateTimePicker2.text<>''then
begin
DecodeDate(wwDBDateTimePicker2.date, Year, Month, day);
str:=str+' and (DATEPART(Year,ʱ¼ä)*10000+DATEPART(month,ʱ¼ä)*100+DATEPART(day,ʱ¼ä))<='
+inttostr(Year*10000+Month*100+day);
end;
if RxDBLookupCombo5.DisplayValue<>''then
str:=str+' and (·¢ËÍ·½='+''''+RxDBLookupCombo5.DisplayValue+''''+' or ½ÓÊÕ·½='+''''+RxDBLookupCombo5.DisplayValue+''''+')';
frm_main.t_sys_message_yes.close;
frm_main.t_sys_message_yes.sql.clear;
frm_main.t_sys_message_yes.sql.add('select * from t_sys_massage'+str+' order by ʱ¼ä desc');
frm_main.t_sys_message_yes.open;
end;
procedure Tfrm_sys_message_pri.bsSkinButton4Click(Sender: TObject);
var
i:integer;
begin
if frm_main.t_sys_message_yes.IsEmpty then
exit;
i:=frm_main.t_sys_message_yes.fieldbyname('id').asinteger;
frm_main.t_sys_message_yes.Refresh;
if frm_main.t_sys_message_yes.locate('id',i,[]) then
begin
frm_main.t_sys_message_yes.edit;
frm_main.t_sys_message_yes['ÊÇ·ñÖªµÀ']:=1;
frm_main.t_sys_message_yes.post;
end;
frm_main.t_sys_message_yes.Requery();
end;
procedure Tfrm_sys_message_pri.bsSkinButton3Click(Sender: TObject);
begin
close;
end;
end.