Exemplo n.º 1
0
        private int SaveOtherItems()
        {
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            //执行单表操作
            Neusoft.HISFC.BizLogic.Order.ExecBill manager = new Neusoft.HISFC.BizLogic.Order.ExecBill();
            if (manager.InsertExecBillOtherItem(this.nurseID, this.billNO, this.myOrderType, this.mySysClass) == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            //DataSet操作
            DataTable dt = this.ucInputUndrug.DsUndrugItem.Tables[this.myOrderType];

            if (dt == null)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            ArrayList alItems = new ArrayList();
            string    filter  = "类别编码='" + this.mySysClass + "'";

            foreach (DataRow row in dt.Select(filter))
            {
                Neusoft.HISFC.Models.Order.Inpatient.Order order = new Neusoft.HISFC.Models.Order.Inpatient.Order();
                order.ID               = this.billNO;
                order.Memo             = "2";
                order.OrderType.ID     = this.myOrderType;
                order.OrderType.Name   = this.orderTypeHelper.GetName(this.myOrderType);
                order.Item.SysClass.ID = this.mySysClass;
                order.Item.ID          = row["编码"].ToString();
                order.Item.Name        = row["名称"].ToString();
                alItems.Add(order);
                row.Delete();
            }

            //farpoint操作
            if (this.ItemOtherInsert != null)
            {
                if (this.ItemOtherInsert(alItems) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    return(-1);
                }
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();
            return(0);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 选择单选或多选的保存
        /// </summary>
        /// <returns></returns>
        private int SaveItems()
        {
            ArrayList alItem = this.GetItems();

            if (alItem == null)
            {
                return(0);
            }

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            //执行单表操作
            Neusoft.HISFC.BizLogic.Order.ExecBill manager = new Neusoft.HISFC.BizLogic.Order.ExecBill();
            foreach (Neusoft.HISFC.Models.Order.Inpatient.Order order in alItem)
            {
                if (manager.UpdateExecBillItem(this.nurseID, this.billNO, this.myOrderType, this.mySysClass, order.Item.ID, order.Item.Name) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    return(-1);
                }
            }

            DataTable dt = this.ucInputUndrug.DsUndrugItem.Tables[this.myOrderType];

            if (dt == null)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            //datase操作
            string filter = "类别编码='" + this.mySysClass + "' and 编码 in (";

            foreach (Neusoft.HISFC.Models.Order.Inpatient.Order order in alItem)
            {
                filter += "'" + order.Item.ID + "',";
            }
            filter  = filter.Substring(0, filter.Length - 1);
            filter += ")";
            foreach (DataRow row in dt.Select(filter))
            {
                row.Delete();
            }

            //farpoint操作
            if (this.ItemInsert != null)
            {
                if (this.ItemInsert(alItem) == -1)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    return(-1);
                }
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                return(-1);
            }

            Neusoft.FrameWork.Management.PublicTrans.Commit();
            return(0);
        }
Exemplo n.º 3
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.txtExecBillName.Text.Trim() == "" || this.txtExecBillName.Text.Length == 0)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("执行单名称不能为空"));
                return;
            }
            if (this.cmbStyle.Text.Length == 0)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("执行单类别不能为空"));
                return;
            }
            Neusoft.HISFC.BizLogic.Order.ExecBill oExecBill = new Neusoft.HISFC.BizLogic.Order.ExecBill();
            if (txtExecBillName.Tag == null)
            {
                if (IsNull(txtExecBillName) && IsRepeat())
                {
                    this.objExecBill.Name = this.txtExecBillName.Text.Trim();
                    #region addby xuewj 2010-9-2 {46983F5B-E184-4b8b-B819-AA1C34993F1B} 非药物执行单单项目维护

                    if (this.chkItemBill.Checked)
                    {
                        this.objExecBill.Memo = "1";//项目执行单
                    }
                    else
                    {
                        this.objExecBill.Memo = "0";//非项目执行单
                    }

                    #endregion
                    this.objExecBill.User01 = this.txtMemo.Text;                      //备注
                    this.objExecBill.User02 = this.cmbStyle.SelectedIndex.ToString(); //类型
                    r.Result1 = txtExecBillName.Text;
                    #region addby xuewj 2010-9-2 {46983F5B-E184-4b8b-B819-AA1C34993F1B} 非药物执行单单项目维护

                    Neusoft.HISFC.Models.Base.Employee empl = Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee;
                    if (oExecBill.SetExecBill(this.objExecBill, empl.Nurse.ID) < 0)
                    {
                        MessageBox.Show("添加新执行单错误!:" + oExecBill.Err);
                        this.objExecBill = null;
                    }

                    #endregion
                    this.FindForm().Close();
                }
            }
            else
            {
                string strId = txtExecBillName.Tag.ToString();
                if (txtMemo.Text != "")
                {
                    txtMemo.Text = txtMemo.Text.Trim();
                }
                if (oExecBill.UpdateExecBillName(strId, txtExecBillName.Text.Trim(), txtMemo.Text, this.cmbStyle.SelectedIndex.ToString()) != -1)
                {
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新成功!"));
                    r.Result1 = txtExecBillName.Text;
                    this.FindForm().Close();
                }
                else
                {
                    MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("更新失败"));
                }
            }
        }