using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using DevExpress.XtraEditors; using ICSSoft.Frame.User.BLL; using ICSSoft.Base.Config.AppConfig; using ICSSoft.Base.Language.Tool; using ICSSoft.Base.UserControl.MessageControl; using ICSSoft.Base.Config.DBHelper; using ICSSoft.Base.ReferForm.AppReferForm; using ICSSoft.Frame.Data.Entity; namespace ICSSoft.Frame.APP { public partial class FormPOArriveSelect : DevExpress.XtraEditors.XtraForm { public RCVData data=new RCVData(); public FormPOArriveSelect() { InitializeComponent(); setDateType(txtUserPwd); setDateType(timeEdit1); txtUserName.KeyDown +=new KeyEventHandler(txtUserCode_KeyDown); txtUserPwd.KeyDown += new KeyEventHandler(txtUserCode_KeyDown); timeEdit1.KeyDown += new KeyEventHandler(txtUserCode_KeyDown); } private void setDateType(DateEdit edit) { edit.Properties.DisplayFormat.FormatString = "yyyy-MM-dd HH:mm"; edit.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; edit.Properties.EditFormat.FormatString = "yyyy-MM-dd HH:mm"; edit.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime; edit.Properties.Mask.EditMask = "yyyy-MM-dd HH:mm"; edit.Properties.VistaDisplayMode = DevExpress.Utils.DefaultBoolean.True; edit.Properties.VistaEditTime = DevExpress.Utils.DefaultBoolean.True; edit.Properties.VistaTimeProperties.DisplayFormat.FormatString = "HH:mm:ss"; edit.Properties.VistaTimeProperties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; edit.Properties.VistaTimeProperties.EditFormat.FormatString = "HH:mm:ss"; edit.Properties.VistaTimeProperties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime; edit.Properties.VistaTimeProperties.Mask.EditMask = "HH:mm:ss"; } private void simpleButton1_Click(object sender, EventArgs e) { data.RcvNo = txtUserCode.Text; data.CreateUser = txtUserName.Text; data.StartTime = txtUserPwd.Text; data.EndTime = timeEdit1.Text; this.DialogResult = DialogResult.OK; this.Close(); } private void simpleButton2_Click(object sender, EventArgs e) { data = null; this.Close(); } private void txtUserCode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { simpleButton1_Click(null,null); } } private void btnClose_Click(object sender, EventArgs e) { this.Close(); } } }