Beispiel #1
0
        public int Delete()
        {
            if (this.neuSpread1_Sheet1.Rows.Count <= 0)
            {
                return(-1);
            }

            DialogResult rs = MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("确认删除当前选择信息吗?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);

            if (rs == DialogResult.No)
            {
                return(-1);
            }

            Neusoft.HISFC.BizLogic.Manager.Constant consManager = new Neusoft.HISFC.BizLogic.Manager.Constant();
            string id = this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.ActiveRowIndex, 0].Text;
            //{B7BFFC6E-D820-44ca-B74C-2B211EA9FA1F}
            string name = this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.ActiveRowIndex, 2].Text;

            if (consManager.DelConstant("SpeDrugGrade", id + "|" + name) == -1)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("删除药品等级职级对照列表发生错误"));
                return(-1);
            }

            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("删除药品等级职级对照列表成功"));

            //{B7BFFC6E-D820-44ca-B74C-2B211EA9FA1F}刷新显示
            ShowDrugDocCompare();

            return(1);
        }
Beispiel #2
0
        public int Save()
        {
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            Neusoft.HISFC.BizLogic.Manager.Constant consManager = new Neusoft.HISFC.BizLogic.Manager.Constant();

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //t.BeginTransaction();
            //consManager.SetTrans(t.Trans);
            //{3F1D29EA-0A9D-4703-938E-AB3E51257672}
            int returnValue = consManager.DelConstant("SpeDrugGrade");

            if (returnValue < 0)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("删除常数信息出错.\n 错误信息 :" + consManager.Err);
                return(-1);
            }

            for (int i = 0; i < this.neuSpread1_Sheet1.Rows.Count; i++)
            {
                if (string.IsNullOrEmpty(this.neuSpread1_Sheet1.Cells[i, 0].Text) || string.IsNullOrEmpty(this.neuSpread1_Sheet1.Cells[i, 2].Text))
                {
                    continue;
                }

                Neusoft.HISFC.Models.Base.Const cons = new Neusoft.HISFC.Models.Base.Const();

                cons.ID      = this.neuSpread1_Sheet1.Cells[i, 0].Text;
                cons.Name    = this.neuSpread1_Sheet1.Cells[i, 2].Text;
                cons.IsValid = true;
                //{3972BA6D-5CE4-4995-90AA-30DD281D1660}
                //为了避免主键重复 对于医生职级与药品等级分开
                cons.ID = cons.ID + "|" + cons.Name;

                if (consManager.SetConstant("SpeDrugGrade", cons) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("药品等级、医生职级对照更新失败"));
                    return(1);
                }
            }

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

            MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("保存成功"));

            this.Query();

            return(1);
        }