public FrmEdtDrugsAllergy(Int64 id) { InitializeComponent(); _id = id; //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]); db = new Database("XE"); _id = id; vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 185"); vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 186"); vALUECODEBindingSource2.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 187"); vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 183"); vALUECODEBindingSource4.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = 184"); drugAllergyHis = db.Single<DRUG_ALLERGY_HISTORY>("select * from DRUG_ALLERGY_HISTORY where ID = @0", _id); dRUGALLERGYHISTORYBindingSource.DataSource = drugAllergyHis; }
private void btnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (XtraMessageBox.Show("确定保存该患者基本信息?", "操作确认", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { dRUGALLERGYHISTORYBindingSource.EndEdit(); dRUGALLERGYHISTORYBindingSource.CurrencyManager.EndCurrentEdit(); try { drugAllergyHis.LOG_TIME = DateTime.Now; db.Insert(drugAllergyHis); drugAllergyHis = new DRUG_ALLERGY_HISTORY(); drugAllergyHis.REG_ID = _regID; drugAllergyHis.BASE_INFO_ID = _baseID; drugAllergyHis.OPERATOR = ClsFrmMng.WorkerID; dRUGALLERGYHISTORYBindingSource.DataSource = drugAllergyHis; if (NewRegistEvt != null) NewRegistEvt(); } catch (Exception err) { XtraMessageBox.Show(err.Message, "错误提示", MessageBoxButtons.OK); } } }