D7myYunxiang/云翔OA(WTOA.dll)/U_YGYPInPut_LiZhi.pas
DESKTOP-E401PHE\Administrator 1011cb7292 1
2025-01-20 13:04:03 +08:00

168 lines
4.1 KiB
ObjectPascal
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

unit U_YGYPInPut_LiZhi;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
cxGridCustomView, cxGrid, cxMemo, cxRichEdit, ComCtrls, cxContainer,
cxTextEdit, cxMaskEdit, cxButtonEdit, StdCtrls, ToolWin, DBClient, ADODB,
ExtCtrls, BtnEdit, cxCalendar,StrUtils, cxDropDownEdit,jpeg,
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdFTP, cxPC,
cxGridCustomPopupMenu, cxGridPopupMenu, Menus, ExtDlgs;
type
TfrmYGYPInPut_LiZhi = class(TForm)
ToolBar1: TToolBar;
TBClose: TToolButton;
ADOTemp: TADOQuery;
ADOCmd: TADOQuery;
TBSave: TToolButton;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
DataSource1: TDataSource;
Order_Sub: TClientDataSet;
Panel3: TPanel;
Label4: TLabel;
Label5: TLabel;
Label11: TLabel;
Label27: TLabel;
YGName: TEdit;
YGSex: TComboBox;
SJLiZhiDate: TDateTimePicker;
LiZhiNote: TRichEdit;
Label2: TLabel;
JHLiZhiDate: TDateTimePicker;
Label3: TLabel;
LiZhiTBDate: TDateTimePicker;
Label1: TLabel;
UserID: TEdit;
Dept: TEdit;
Label6: TLabel;
GangWei: TEdit;
Label7: TLabel;
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure TBSaveClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormDestroy(Sender: TObject);
private
TPInt:Integer;
procedure InitData();
function SaveData():Boolean;
{ Private declarations }
public
canshu1:String;
PState,CopyInt:Integer;
FMainId,FDName:String;
{ Public declarations }
end;
var
frmYGYPInPut_LiZhi: TfrmYGYPInPut_LiZhi;
implementation
uses
U_DataLink,U_ZDYHelp,U_RTFun,U_ZDYHelpSel;
{$R *.dfm}
procedure TfrmYGYPInPut_LiZhi.TBCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmYGYPInPut_LiZhi.InitData();
begin
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('select A.*,B.UserID from OA_YG_DangAn A ');
sql.add('inner join SY_User B On B.UserName=isnull(A.YGEName,A.YGName) ');
if trim(FDName)='' then
sql.add('where isnull(A.YGEName,A.YGName)='''+Trim(DName)+'''')
else
sql.add('where A.YGName='''+trim(FDName)+'''');
sql.Add(' and A.YGType<>''<27><>ְ''');
Open;
end;
SCSHDataNew(ADOCmd,Panel3,2);
UserID.Text:=trim(ADOCmd.fieldbyname('UserID').AsString);
end;
procedure TfrmYGYPInPut_LiZhi.FormShow(Sender: TObject);
begin
LizhiTBDate.DateTime:=SGetServerDate(ADOTemp);
JHLiZhiDate.DateTime:=SGetServerDate(ADOTemp);
SJLiZhiDate.DateTime:=SGetServerDate(ADOTemp);
InitData();
end;
function TfrmYGYPInPut_LiZhi.SaveData():Boolean;
var
maxno:String;
begin
Result:=False;
try
ADOCmd.Connection.BeginTrans;
with ADOCmd do
begin
Close;
sql.Clear;
SQL.Add('select * from OA_YG_DangAn where isnull(YGEName,YGName)='''+Trim(DName)+''' and YGType<>''<27><>ְ''');
Open;
end;
with ADOCmd do
begin
Edit;
RTSetsavedata(ADOCmd,'OA_YG_DangAn',Panel3,2);
FieldByName('LiZhiStatus').Value:='<27><><EFBFBD>ύ';
Post;
end;
ADOCmd.Connection.CommitTrans;
Result:=True;
except
Result:=False;
ADOCmd.Connection.RollbackTrans;
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ',0);
end;
end;
procedure TfrmYGYPInPut_LiZhi.TBSaveClick(Sender: TObject);
var
FSFNO:String;
begin
ToolBar1.SetFocus;
if Trim(YGName.Text)='' then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>','<27><>ʾ',0);
Exit;
end;
if Trim(LiZhiNote.Text)='' then
begin
Application.MessageBox('<27><>ְԭ<D6B0><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>!','<27><>ʾ',0);
Exit;
end;
if SaveData() then
begin
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ',0);
Modalresult:=1;
end;
end;
procedure TfrmYGYPInPut_LiZhi.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
Action:=caFree;
end;
procedure TfrmYGYPInPut_LiZhi.FormDestroy(Sender: TObject);
begin
FrmYGYPInPut_LiZhi:=nil;
end;
end.