예제 #1
0
        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);
            }
        }