Beispiel #1
0
        /// <summary>
        /// Init
        /// </summary>
        void Init()
        {
            this.lsvItemPath.Height = 0;

            clsBIHOrderService svc = new clsDcl_GetSvcObject().m_GetOrderSvcObject();
            DataTable          tmp = svc.GetCpExecPlan(this.patVo.m_strRegisterID);

            ExecPlanDataSource = tmp.Rows[0];
            string deptCode = svc.GetCpDeptCode(patVo.m_strDeptID);

            //deptCode = "0327";
            PathDataSource = svc.GetCpListByDeptCode(deptCode);
            VarDataSource  = svc.GetCpVariation(Convert.ToInt32(this.ExecPlanDataSource["cpid"].ToString()));
            GetHistory(svc.GetCpExecVarList(Convert.ToDecimal(this.ExecPlanDataSource["execid"].ToString())));
            if (PathDataSource != null && PathDataSource.Rows.Count > 0)
            {
                PathDataSourceFilter = PathDataSource.Clone();
                PathDataSourceFilter.BeginLoadData();
                List <string> lstCpId = new List <string>();
                foreach (DataRow dr in PathDataSource.Rows)
                {
                    if (lstCpId.IndexOf(dr["cpid"].ToString()) < 0)
                    {
                        lstCpId.Add(dr["cpid"].ToString());
                        PathDataSourceFilter.LoadDataRow(dr.ItemArray, true);
                    }
                }
                PathDataSourceFilter.EndLoadData();
            }

            this.clstTarget.Items.Clear();
            if (VarDataSource != null && VarDataSource.Rows.Count > 0)
            {
                foreach (DataRow dr in VarDataSource.Rows)
                {
                    this.clstTarget.Items.Add(dr["varinfo"].ToString());
                }
            }

            this.lblCpName.Text   = this.ExecPlanDataSource["cpname"].ToString();
            this.lblDeptName.Text = this.patVo.m_strDeptName;
            this.lblBedNo.Text    = this.patVo.m_strBedName + "床";
            this.lblPatName.Text  = this.patVo.m_strPatientName;
            this.lblIpNo.Text     = this.patVo.m_strInHospitalNo;
        }
Beispiel #2
0
        /// <summary>
        /// Save
        /// </summary>
        void Save()
        {
            int varId = 0;

            if (this.btnOK.Tag != null)
            {
                varId = Convert.ToInt32(this.btnOK.Tag.ToString());
            }

            EntityCpExecPlanVar varVo = new EntityCpExecPlanVar();

            varVo.varid      = varId;
            varVo.execid     = Convert.ToDecimal(this.ExecPlanDataSource["execid"]);
            varVo.registerid = patVo.m_strRegisterID;
            varVo.vardate    = Convert.ToDateTime(this.dtpVar.Text);
            if (this.chkEva1.Checked)
            {
                varVo.vartype = 1;
            }
            else if (this.chkEva2.Checked)
            {
                varVo.vartype = 2;
            }
            else if (this.chkEva3.Checked)
            {
                varVo.vartype = 3;
            }
            varVo.doctid     = patVo.m_strDOCTORID_CHR;
            varVo.operid     = this.LoginInfo.m_strEmpID;
            varVo.operdate   = DateTime.Now;
            varVo.status     = 1;
            varVo.varcontent = this.txtResult.Text.Trim();

            if (varVo.vartype == 0)
            {
                MessageBox.Show("请选择变异类型。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.chkEva1.Focus();
                return;
            }
            if (varVo.varcontent == string.Empty)
            {
                MessageBox.Show("请输入变异原因。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtResult.Focus();
                return;
            }
            if (varVo.vartype == 2)
            {
                if (this.txtPathName.Tag == null)
                {
                    MessageBox.Show("请选择新路径。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    this.txtPathName.Focus();
                    return;
                }
                else
                {
                    DataRow dr = this.txtPathName.Tag as DataRow;
                    varVo.newcpid = Convert.ToDecimal(dr["cpid"].ToString());
                }
            }

            List <EntityCpExecPlanVarDetail> lstVo = new List <EntityCpExecPlanVarDetail>();

            if (this.clstTarget.CheckedItems.Count > 0)
            {
                EntityCpExecPlanVarDetail vo = null;
                for (int i = 0; i < this.clstTarget.CheckedItems.Count; i++)
                {
                    vo            = new EntityCpExecPlanVarDetail();
                    vo.varcontent = this.clstTarget.CheckedItems[i].ToString();
                    lstVo.Add(vo);
                }
            }

            bool isNew             = varId <= 0 ? true : false;
            clsBIHOrderService svc = new clsDcl_GetSvcObject().m_GetOrderSvcObject();

            if (svc.SaveCpExecvariation(ref varId, varVo, lstVo) > 0)
            {
                this.btnOK.Tag = varId.ToString();
                if (isNew)
                {
                    GetHistory(svc.GetCpExecVarList(varVo.execid));
                }
                if ((varVo.vartype == 2 || varVo.vartype == 3) && this.IsStopCp == false)
                {
                    this.IsStopCp = true;
                }
                MessageBox.Show("保存变异成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                MessageBox.Show("保存变异失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }