public FrmEdtCaseHis( Int64 id) { InitializeComponent(); //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]); db = new Database("XE"); _id = id; caseHis = db.Single<CASE_HISTORY>("select * from CASE_HISTORY where ID = @0", _id); cASEHISTORYBindingSource.DataSource = caseHis; lookUpEdit1.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[]{11}); lookUpEdit1.Properties.DisplayMember = "DSP_MEMBER"; lookUpEdit1.Properties.ValueMember = "VALUE_MEMBER"; vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 181 }); }
private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (!dxValidationProvider1.Validate()) return; if (XtraMessageBox.Show("确定保存该患者基本信息?", "操作确认", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { cASEHISTORYBindingSource.EndEdit(); cASEHISTORYBindingSource.CurrencyManager.EndCurrentEdit(); try { //db.OpenSharedConnection(); caseHis.LOG_DATE = DateTime.Now; db.Insert(caseHis); //db.CloseSharedConnection(); caseHis = new CASE_HISTORY(); caseHis.REG_ID = _reg_id; caseHis.BASE_INFO_ID = _baseID; caseHis.OPERATOR = ClsFrmMng.WorkerID; cASEHISTORYBindingSource.DataSource = caseHis; if (NewRegistEvt != null) NewRegistEvt(); } catch (Exception err) { XtraMessageBox.Show(err.Message, "错误提示", MessageBoxButtons.OK); } } }