private void btnOK_Click(object sender, EventArgs e) { bool result = false; Maticsoft.BLL.BadReaction bll = new Maticsoft.BLL.BadReaction(); BadReaction action = new BadReaction(); action.Peroid = CurrentPeriod; action.PID = PID; action.ReactionName = txtReactionName.Text; action.Severity = txtSeverity.Text; action.TreatMethod = txtTreatMethod.Text; action.TreatResult = txtTreatResult.Text; action.OccurDate = dtpOccurDate.Value; //if (OperatType == OperateType.ADD)//编辑,查看 //{ // result=bll.Add(action); //} //else //{ // action.ID = int.Parse(ActionID); // result = bll.Update(action); //} //if (result) //{ // MessageBox.Show(this, "操作成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); this.DialogResult = DialogResult.OK; this.returnValue = action; this.Close(); //} }
private void LoadBadActionList() { Maticsoft.BLL.BadReaction bll = new Maticsoft.BLL.BadReaction(); DataSet ds = bll.GetList("PID=" + pid.ToString() + " AND peroid=" + TreatPeroid.InTreatment); this.gridInfo.DataSource = ds.Tables[0]; this.gridInfo.DataBind(); }
private void bindBadAction_w() { Maticsoft.BLL.BadReaction bll = new Maticsoft.BLL.BadReaction(); DataSet ds = bll.GetList("PID=" + pid.ToString() + " AND Peroid=" + period.ToString()); this.ugBadAction_w.DataSource = ds; this.ugBadAction_w.DataBind(); }
private void ugBadAction_w_ClickCellButton(object sender, CellEventArgs e) { if (e.Cell.Text == "删除") { DialogResult dr = MessageBox.Show(this, "确定要删除此行?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); if (dr == DialogResult.Yes) { if (ugBadAction_w.ActiveRow.Cells["ID"].Text != "") { Maticsoft.BLL.BadReaction bll = new Maticsoft.BLL.BadReaction(); bll.Delete(int.Parse(ugBadAction_w.ActiveRow.Cells["ID"].Text)); } ugBadAction_w.ActiveRow.Delete(false);//删除所选行 } } if (e.Cell.Text == "编辑") { BadReaction bd = new BadReaction(); // bd.ID = int.Parse(ugBadReaction.ActiveRow.Cells["ID"].Text); bd.ReactionName = ugBadAction_w.ActiveRow.Cells["ReactionName"].Text; bd.OccurDate = DateTime.Parse(ugBadAction_w.ActiveRow.Cells["OccurDate"].Text); bd.Severity = ugBadAction_w.ActiveRow.Cells["Severity"].Text; bd.TreatMethod = ugBadAction_w.ActiveRow.Cells["TreatMethod"].Text; bd.TreatResult = ugBadAction_w.ActiveRow.Cells["TreatResult"].Text; BadReactionDetail openDialog = new BadReactionDetail(bd); //Butcher_EnterregisterDetail openDialog = new Butcher_EnterregisterDetail(0, 0, ""); openDialog.ShowDialog(); if (openDialog.DialogResult == DialogResult.OK) { if (openDialog.returnValue != null) { BadReaction returnAction = openDialog.returnValue; ugBadAction_w.ActiveRow.Cells["ReactionName"].Value = returnAction.ReactionName; ugBadAction_w.ActiveRow.Cells["OccurDate"].Value = returnAction.OccurDate.Value.ToString("yyyy-MM-dd"); ugBadAction_w.ActiveRow.Cells["Severity"].Value = returnAction.Severity; ugBadAction_w.ActiveRow.Cells["TreatMethod"].Value = returnAction.TreatMethod; ugBadAction_w.ActiveRow.Cells["TreatResult"].Value = returnAction.TreatResult; } } } }
private DataSet GetTreatInfo() { DataSet ds = new DataSet(); if (cbTreatInfo.Checked) { Maticsoft.BLL.TreatInfo bll = new Maticsoft.BLL.TreatInfo(); DataSet dsTreatInfo = bll.GetListWithTitle(""); dsTreatInfo.Tables[0].TableName = "治疗情况"; ds.Merge(dsTreatInfo); } if (cbTreatInfoBadAction.Checked) { Maticsoft.BLL.BadReaction badBLL = new Maticsoft.BLL.BadReaction(); DataSet dsBad = badBLL.GetListWithTitle(" AND g.peroid=" + TreatPeroid.InTreatment.ToString()); dsBad.Tables[0].TableName = "术中不良事件"; ds.Merge(dsBad); } return(ds); }
private void button10_Click(object sender, EventArgs e) { bool result = false; BloodGas bg = new BloodGas(); bg.PID = pid; bg.Period = period; bg.pH = txtPH_w.Text; bg.PaO2 = txtPaO2_w.Text; bg.SaO2 = txtSaO2_w.Text; bg.PaCO2 = txtPcO2_w.Text; bg.RealHCO3 = txtRealHCO3_w.Text; bg.StandHCO3 = txtStandHCO3_w.Text; bg.AB = txtAB_w.Text; bg.BE = txtBE_w.Text; bg.AG = txtAG_w.Text; bg.CheckDate = dtpBloodGas_w.Value; Maticsoft.BLL.BloodGas bgBll = new Maticsoft.BLL.BloodGas(); result = bgBll.SaveOrUpdate(bg); Lung lung = new Lung(); lung.PID = pid; lung.Period = period; lung.fev1 = txtFev1_w.Text; lung.fev1pre = txtFev1pre_w.Text; lung.fvc = txtFvc_w.Text; lung.fvcpre = txtFvcpre_w.Text; lung.fev1fvc = txtFev1fvc_w.Text; lung.tlc = txtTlc_w.Text; lung.tlvpre = txtTlvpre_w.Text; lung.rv = txtRV_w.Text; lung.rvpre = txtRvpre_w.Text; lung.rvtlc = txtRvtlc_w.Text; lung.CheckTime = dtpLung_w.Value; lung.File = this.uploaddicomLung_w.File; Maticsoft.BLL.Lung lungBLL = new Maticsoft.BLL.Lung(); result = lungBLL.SaveOrUpdate(lung); dicom di = new dicom(); di.PID = pid; di.Period = period; di.TreatLobeVolumn = txtLobeVolumn_w.Text; di.UnTreatLobeVolumn = txtLobeVolumn2_w.Text; di.File = this.uploaddicom_w.File; di.CheckDate = dtpDicom_w.Value; di.Heterogeneity = ""; di.LobeSplit = ""; Maticsoft.BLL.dicom diBLL = new Maticsoft.BLL.dicom(); result = diBLL.SaveOrUpdate(di); SportLife sl = new SportLife(); sl.PID = pid; sl.Period = period; int sixTest = 0; int.TryParse(txtSixTest_w.Text, out sixTest); sl.SixMinuteTest = sixTest; sl.SixMinuteTestDate = dtpSixTest_w.Value; sixTest = 0; int.TryParse(txtGeorgeTest_w.Text, out sixTest); sl.StGeorgeTest = sixTest;// int.Parse(txtGeorgeTest_w.Text); sl.StGeorgeTestDate = dtpGeorgeTest_w.Value; sl.StGeorgeTestFile = this.uploaddicomGeorge_w.File; sixTest = 0; int.TryParse(txtCatTest_w.Text, out sixTest); sl.CATTest = sixTest;// int.Parse(txtCatTest_w.Text); sl.CATTestDate = dtpCatTest_w.Value; sixTest = 0; int.TryParse(txtMmrcTest_w.Text, out sixTest); sl.MMRCTest = sixTest;// int.Parse(this.txtMmrc_w.Text); sl.MMRCTestDate = dtpMmrc_w.Value; Maticsoft.BLL.SportLife slBLL = new Maticsoft.BLL.SportLife(); result = slBLL.SaveOrUpdate(sl); List <BadReaction> treatHistories = new List <BadReaction>(); foreach (UltraGridRow r in this.ugBadAction_w.Rows) { BadReaction th = new BadReaction(); th.PID = pid; if (r.Cells["ID"].Text != "") { th.ID = int.Parse(r.Cells["ID"].Text); } th.Peroid = period; th.ReactionName = r.Cells["ReactionName"].Value.ToString(); th.OccurDate = DateTime.Parse(r.Cells["OccurDate"].Value.ToString()); th.Severity = r.Cells["Severity"].Value.ToString(); th.TreatMethod = r.Cells["TreatMethod"].Value.ToString(); th.TreatResult = r.Cells["TreatResult"].Value.ToString(); treatHistories.Add(th); } Maticsoft.BLL.BadReaction brBLL = new Maticsoft.BLL.BadReaction(); foreach (BadReaction th in treatHistories) { if (th.ID != 0) { result = brBLL.Update(th); } else { result = brBLL.Add(th); } } if (result) { MessageBox.Show(this, periodName + "数据保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); FreezeForm.ChangeControlEditable(this, false); } else { MessageBox.Show(this, periodName + "数据保存失败,请重试!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } }