Exemple #1
0
        /// <summary>
        /// 停用启用医疗组
        /// </summary>
        /// <returns></returns>
        private int ProcessMedicalTeamValidFlag(bool isValid)
        {
            int    returnValue = 0;
            string errText     = string.Empty;

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            for (int i = 0; i < this.neuSpread1_Sheet1.Rows.Count; i++)
            {
                bool isSelectecd = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.neuSpread1_Sheet1.Cells[i, 0].Value);

                if (isSelectecd)
                {
                    Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam medcialTeamObj = this.neuSpread1_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam;

                    //更新医疗组标记
                    returnValue = this.medicalTeamLogic.UpdateValidFlag(Neusoft.FrameWork.Function.NConvert.ToInt32(isValid).ToString(), medcialTeamObj.Dept.ID, medcialTeamObj.ID);
                    if (returnValue < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("更新医疗组状态失败!" + this.medicalTeamLogic.Err);
                        return(-1);
                    }
                    if (isValid)
                    {
                        continue; //停用一起停,启用不一起启用
                    }
                    //更新医疗组内的医生
                    returnValue = ProcessDoctValidFlag(medcialTeamObj.Dept.ID, medcialTeamObj.ID, false, ref errText);
                    if (returnValue < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(errText);
                        return(-1);
                    }
                }
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();

            if (isValid)
            {
                MessageBox.Show("启用成功!");
            }
            else
            {
                MessageBox.Show("停用成功!");
            }
            this.QueryMedicalTeamByDept((this.tvDept.SelectedNode.Tag as Neusoft.FrameWork.Models.NeuObject).ID);

            return(1);
        }
Exemple #2
0
        /// <summary>
        /// 停用启用医生
        /// </summary>
        /// <param name="isValidFlag"></param>
        /// <returns></returns>
        private int ProcessDoctValidFlag(bool isValidFlag)
        {
            Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam obj = this.neuSpread1_Sheet1.ActiveRow.Tag as Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam;
            int    returnValue = 0;
            string errText     = string.Empty;

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            int j = 0;

            for (int i = 0; i < this.neuSpread1_Sheet1.RowCount; i++)
            {
                bool isSelectecd = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.neuSpread2_Sheet1.Cells[i, 0].Value);

                if (isSelectecd)
                {
                    j++;
                    Neusoft.HISFC.Models.Order.Inpatient.MedicalTeamForDoct medcialTeamForDoctObj = this.neuSpread2_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.MedicalTeamForDoct;

                    returnValue = this.medicalTeamForDoctLogic.UpdateValidFlag(medcialTeamForDoctObj.MedcicalTeam.Dept.ID, medcialTeamForDoctObj.MedcicalTeam.ID, medcialTeamForDoctObj.Doct.ID);
                    if (returnValue < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("更新医生状态出错!\n" + this.medicalTeamForDoctLogic.Err);
                        return(-1);
                    }
                }
            }
            if (j == 0) //没有选择
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("请选择要更新的医生");
                return(-1);
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.Commit();

                if (isValidFlag)
                {
                    MessageBox.Show("启用成功");
                }
                else
                {
                    MessageBox.Show("停用成功");
                }
            }
            this.QueryDoctByDeptAndMedicalTeam(obj.Dept.ID, obj.ID);
            return(1);
        }
Exemple #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="medicalTeamList"></param>
        private void SetFarpointValue(List <Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam> medicalTeamList)
        {
            for (int i = 0; i < medicalTeamList.Count; i++)
            {
                Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam obj = medicalTeamList[i];

                int count = this.neuSpread1_Sheet1.Rows.Count;
                this.neuSpread1_Sheet1.Rows.Add(count, 1);

                this.neuSpread1_Sheet1.Cells[count, 1].Text  = obj.ID;
                this.neuSpread1_Sheet1.Cells[count, 2].Text  = obj.Name;
                this.neuSpread1_Sheet1.Cells[count, 3].Value = obj.IsValid;
                this.neuSpread1_Sheet1.Cells[count, 4].Text  = obj.Dept.Name;
                this.neuSpread1_Sheet1.Rows[count].Tag       = obj;
            }
        }
Exemple #4
0
        private void neuSpread1_CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            if (e.ColumnHeader)
            {
                return;
            }


            Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam obj = this.neuSpread1_Sheet1.Rows[e.Row].Tag as Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam;

            this.tabPage2.Text = obj.Name;

            if (obj == null)
            {
                return;
            }

            this.QueryDoctByDeptAndMedicalTeam(obj.Dept.ID, obj.ID);
        }
Exemple #5
0
        /// <summary>
        /// 添加医疗组
        /// </summary>
        private int ModifyMedicalTeam()
        {
            if (this.tvDept.SelectedNode.Level == 0)
            {
                return(-1);
            }
            Forms.frmMedcialTeam frmMedcialTeam = new Neusoft.HISFC.Components.Order.Forms.frmMedcialTeam();

            Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam medicalTeam = this.neuSpread1_Sheet1.ActiveRow.Tag as Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam;

            medicalTeam.Dept           = this.tvDept.SelectedNode.Tag as Neusoft.FrameWork.Models.NeuObject;
            frmMedcialTeam.MedicalTeam = medicalTeam;

            frmMedcialTeam.ShowDialog();

            //重新刷新
            this.QueryMedicalTeamByDept(medicalTeam.Dept.ID);

            return(1);
        }
Exemple #6
0
        /// <summary>
        /// 添加医生
        /// </summary>
        /// <returns></returns>
        private int AddDoct()
        {
            Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam obj = this.neuSpread1_Sheet1.ActiveRow.Tag as Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam;
            if (obj == null)
            {
                MessageBox.Show("请选择医疗组信息");
                return(-1);
            }

            Forms.frmAddDoct frmAddDoct = new Neusoft.HISFC.Components.Order.Forms.frmAddDoct();

            if (obj == null)
            {
                return(-1);
            }
            frmAddDoct.MedicalTeam = obj;
            frmAddDoct.ShowDialog();
            this.QueryDoctByDeptAndMedicalTeam(obj.Dept.ID, obj.ID);

            return(1);
        }
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="medcialTeam"></param>
        private void Save()
        {
            int    reuturnValue = 1;
            string strMsg       = string.Empty;

            Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam medcialTeamClone = this.MedicalTeam.Clone();
            medcialTeamClone.Name          = this.txtMecialTeam.Text;
            medcialTeamClone.IsValid       = this.ckbValid.Checked;
            medcialTeamClone.Oper.ID       = this.medicalTeamLogic.Operator.ID;
            medcialTeamClone.Oper.OperTime = this.medicalTeamLogic.GetDateTimeFromSysDateTime();
            if (string.IsNullOrEmpty(MedicalTeam.ID)) //新增
            {
                string seqNO = this.medicalTeamLogic.GetSequence("MedicalTeam.GetSeq");
                medcialTeamClone.ID = seqNO.PadLeft(8, '0');

                reuturnValue = this.medicalTeamLogic.InsertMedicalTeam(medcialTeamClone);
                if (reuturnValue < 0)
                {
                    MessageBox.Show("插入表出错!\n" + this.medicalTeamLogic.Err);
                    return;
                }
                strMsg = "保存成功";
            }
            else //修改
            {
                reuturnValue = this.medicalTeamLogic.UpdateMedicalTeam(medcialTeamClone);
                if (reuturnValue < 0)
                {
                    MessageBox.Show("更新表出错!\n" + this.medicalTeamLogic.Err);
                    return;
                }
                strMsg = "修改成功";
            }

            MessageBox.Show(strMsg);
            this.DialogResult = DialogResult.OK;
        }
Exemple #8
0
        /// <summary>
        /// 删除科室下所有医疗组信息
        /// </summary>
        /// <param name="deptCode"></param>
        /// <returns></returns>
        private int DeleteMedicalTeamAll()
        {
            if (this.tvDept.SelectedNode.Level == 0)
            {
                return(-1);
            }

            Neusoft.FrameWork.Models.NeuObject deptObj = this.tvDept.SelectedNode.Tag as Neusoft.FrameWork.Models.NeuObject;
            string deptCode    = deptObj.ID;
            int    returnValue = 1;
            string errText     = string.Empty;
            int    j           = 0;

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            for (int i = 0; i < this.neuSpread1_Sheet1.RowCount; i++)
            {
                bool isSelectecd = Neusoft.FrameWork.Function.NConvert.ToBoolean(this.neuSpread1_Sheet1.Cells[i, 0].Value);

                if (isSelectecd)
                {
                    j++;
                    Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam medcialTeamObj = this.neuSpread1_Sheet1.Rows[i].Tag as Neusoft.HISFC.Models.Order.Inpatient.MedicalTeam;

                    List <Neusoft.HISFC.Models.Order.Inpatient.MedicalTeamForDoct> doctList = this.medicalTeamForDoctLogic.QueryQueryMedicalTeamForDoctInfo(medcialTeamObj.Dept.ID, medcialTeamObj.ID, "All");

                    if (doctList == null)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("查询护理组下医生失败!\n" + this.medicalTeamForDoctLogic.Err);
                        return(-1);
                    }

                    if (doctList.Count > 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show("护理组:" + medcialTeamObj.Name + "有医生信息,不能删除!\n请先删除医生信息!");
                        return(-1);
                    }

                    returnValue = this.medicalTeamLogic.DeleteMedicalTeam(deptCode, medcialTeamObj.ID);
                    if (returnValue < 0)
                    {
                        Neusoft.FrameWork.Management.PublicTrans.RollBack();
                        MessageBox.Show(errText);
                        return(-1);
                    }
                }
            }

            if (j == 0)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("请选择要删除的医疗组信息");
                return(-1);
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.Commit();

                MessageBox.Show("删除成功");
            }
            this.QueryMedicalTeamByDept(deptCode);
            this.neuSpread2_Sheet1.Rows.Count = 0;
            return(1);
        }