Пример #1
0
        public int AddItem(FarPoint.Win.Spread.SheetView sv, int activeRow)
        {
            string drugID = "";

            if (isBack)
            {
                drugID = sv.Cells[activeRow, 4].Value.ToString();

                string outbillNO = sv.Cells[activeRow, 1].Value.ToString();
                string outNo     = sv.Cells[activeRow, 2].Value.ToString();
                string stockNo   = sv.Cells[activeRow, 3].Value.ToString();
                if (this.isBack)
                {
                    return(this.AddDrugData(drugID, outNo, stockNo));
                }
                else
                {
                    //{3F8F98B1-44E9-4828-90C4-0931F6DA7B87}
                    //return this.AddDrugData(drugID, outbillNO);
                    return(-1);
                }
            }
            else
            {
                //自定义码和物资编码已对调 {7019A2A6-ADCA-4984-944B-C4F1A312449A}
                //drugID = sv.Cells[activeRow, 0].Value.ToString();
                drugID = sv.Cells[activeRow, 11].Value.ToString();
                //{3F8F98B1-44E9-4828-90C4-0931F6DA7B87}
                decimal applyPrice = NConvert.ToDecimal(sv.Cells[activeRow, 3].Text);
                //-----------------------
                return(this.AddDrugData(drugID, applyPrice));
            }
        }
Пример #2
0
        /// <summary>
        /// 加价率设置
        /// </summary>
        protected void SetTransferRate(object sender, System.EventArgs args)
        {
            frmEasyData frm = new frmEasyData();

            frm.EasyLabel = "加价率";
            frm.ShowDialog();

            if (frm.DialogResult == DialogResult.OK)
            {
                try
                {
                    if (NConvert.ToDecimal(frm.EasyData) <= 0)
                    {
                        MessageBox.Show(Language.Msg("请正确设置价让率"), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                        this.SetTransferRate(null, System.EventArgs.Empty);
                    }
                    else
                    {
                        this.defaultPriceRate = NConvert.ToDecimal(frm.EasyData) + 1;

                        this.phaOutManager.ShowInfo = "当前价让加价率:" + this.defaultPriceRate.ToString("N");
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show(Language.Msg("请正确设置价让率"), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    this.SetTransferRate(null, System.EventArgs.Empty);
                }
            }
        }
Пример #3
0
        /// <summary>
        /// 有效性判断
        /// </summary>
        /// <returns>填写有效 返回True 否则返回 False</returns>
        public virtual bool Valid()
        {
            if (this.phaInManager.TargetDept.ID == "")
            {
                MessageBox.Show(Language.Msg("请选择供货公司"));
                return(false);
            }

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new DataBaseManger();
            DateTime sysTime = dataManager.GetDateTimeFromSysDateTime();

            foreach (DataRow dr in this.dt.Rows)
            {
                if (NConvert.ToDecimal(dr["入库数量"]) <= 0)
                {
                    MessageBox.Show(Language.Msg(dr["商品名称"].ToString() + "  请输入入库数量 入库数量不能小于等于0"));
                    return(false);
                }
                if (dr["批号"].ToString() == "")
                {
                    MessageBox.Show(Language.Msg("请输入批号"));
                    return(false);
                }
                if (NConvert.ToDateTime(dr["有效期"]) < sysTime)
                {
                    MessageBox.Show(Language.Msg(dr["商品名称"].ToString() + "  有效期应大于当前日期"));
                    return(false);
                }
            }

            return(true);
        }
Пример #4
0
        /// <summary>
        /// 校验
        /// </summary>
        /// <returns></returns>
        private bool Valid()
        {
            decimal money = NConvert.ToDecimal(this.txtMoney.Text);

            if (money <= 0)
            {
                MessageBox.Show("请输入授权限额!");
                this.txtMoney.Focus();
                return(false);
            }

            if (isEdit)
            {
                if (accountEmpower.PassWord != this.txtoldpw.Text.Trim())
                {
                    MessageBox.Show("原始密码输入不正确请重新输入!");
                    this.txtnewpwd.Focus();
                    return(false);
                }
            }
            if (ckflag.Checked)
            {
                if (!ValidPassword())
                {
                    this.txtnewpwd.Text     = string.Empty;
                    this.txtconfirmpwd.Text = string.Empty;
                    this.txtnewpwd.Focus();
                    return(false);
                }
            }

            return(true);
        }
Пример #5
0
        public bool Valid()
        {
            if (this.phaInManager.TargetDept.ID == "")
            {
                System.Windows.Forms.MessageBox.Show(Language.Msg("请选择供货科室!"));
                return(false);
            }
            try
            {
                foreach (DataRow dr in this.dt.Rows)
                {
                    if (NConvert.ToDecimal(dr["申请数量"]) <= 0)
                    {
                        System.Windows.Forms.MessageBox.Show(dr["商品名称"].ToString() + "申请数量不能小于等于零");
                        return(false);
                    }

                    //{99136B29-4E44-44aa-84DC-F3F24F2E98DE}退库申请时申请数量不能大于库存
                    if (isBack)
                    {
                        if (NConvert.ToDecimal(dr["申请数量"]) > NConvert.ToDecimal(dr["本科库存"]))
                        {
                            System.Windows.Forms.MessageBox.Show(dr["商品名称"].ToString() + "申请数量不能大于本科库存");
                            return(false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(false);
            }
            return(true);
        }
Пример #6
0
        /// <summary>
        /// 根据Dr内数据对实体进行赋值
        /// </summary>
        /// <param name="dr">数据表</param>
        /// <param name="sysTime">当前时间</param>
        /// <param name="output">ref 出库实体信息</param>
        /// <returns>成功返回1 失败返回-1</returns>
        protected virtual int GetOutputFormDataRow(DataRow dr, DateTime sysTime, ref Neusoft.HISFC.Models.Material.Output output)
        {
            //出库数量
            if (this.isUseMinUnit)                      //使用最小单位
            {
                output.StoreBase.Quantity = NConvert.ToDecimal(dr["出库数量"]);
            }
            else
            {
                output.StoreBase.Quantity = NConvert.ToDecimal(dr["出库数量"]) * output.StoreBase.Item.PackQty;
            }

            output.StoreBase.Operation.Oper.ID       = this.outManager.OperInfo.ID;
            output.StoreBase.Operation.Oper.OperTime = sysTime;

            output.StoreBase.Operation.ExamOper = output.StoreBase.Operation.Oper;              //审批人
            output.StoreBase.Operation.ExamQty  = output.StoreBase.Quantity;

            output.Memo = dr["备注"].ToString();                                                                          //备注
            if (this.outManager.TargetPerson != null)                                                                   //领药人
            {
                output.GetPerson = this.outManager.TargetPerson;
            }

            output.StoreBase.PrivType   = this.outManager.PrivType.ID;             //出库类型
            output.StoreBase.SystemType = this.outManager.PrivType.Memo;           //系统类型
            output.StoreBase.StockDept  = this.outManager.DeptInfo;                //当前科室
            output.StoreBase.TargetDept = myDept.GetDeptmentById(dr["目标科室"].ToString());
            //this.outManager.TargetDept;              //目标科室

            //借方科目 暂时赋值为空
            output.Debit = "";

            return(1);
        }
Пример #7
0
        public bool Valid()
        {
            try
            {
                foreach (DataRow dr in this.dt.Rows)
                {
                    if (NConvert.ToDecimal(dr["出库数量"]) <= 0)
                    {
                        MessageBox.Show(Language.Msg(dr["商品名称"].ToString() + " 出库数量不能小于等于零"));
                        return(false);
                    }
                    if (NConvert.ToDecimal(dr["库存数量"]) < NConvert.ToDecimal(dr["出库数量"]))
                    {
                        MessageBox.Show(Language.Msg(dr["商品名称"].ToString() + " 出库数量不能大于当前库存量"));
                        return(false);
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(false);
            }
        }
Пример #8
0
        /// <summary>
        /// 获取输入的入库信息
        /// </summary>
        private void GetInInstance()
        {
            if (this.inInstance == null)
            {
                this.inInstance = new Neusoft.HISFC.Models.Pharmacy.Input();
            }

            if (this.item == null || this.item.ID == "")
            {
                return;
            }

            this.inInstance.Item        = this.item;                                                                         //药品信息
            this.inInstance.Quantity    = NConvert.ToDecimal(this.ntbInQty.NumericValue) * this.item.PackQty;                //入库数量
            this.inInstance.RetailCost  = NConvert.ToDecimal(this.ntbInCost.NumericValue);                                   //入库金额
            this.inInstance.BatchNO     = Neusoft.FrameWork.Public.String.TakeOffSpecialChar(this.txtBatchNO.Text.Trim());   //批    号
            this.inInstance.ValidTime   = this.dtValidTime.Value.Date;                                                       //有 效 期
            this.inInstance.InvoiceNO   = Neusoft.FrameWork.Public.String.TakeOffSpecialChar(this.txtInvoiceNO.Text.Trim()); //发 票 号
            this.inInstance.InvoiceType = this.cmbInvoiceType.Text.Trim();                                                   //发票分类
            this.inInstance.Item.PriceCollection.PurchasePrice = NConvert.ToDecimal(this.ntbPurchasePrice.NumericValue);     //购入价
            if (this.cmbProduce.Tag != null)                                                                                 //生产厂家
            {
                //{3F6FF86C-0C62-44de-B09B-595B297DD832}
                this.inInstance.Producer.ID   = this.cmbProduce.Tag.ToString();
                this.inInstance.Producer.Name = this.cmbProduce.Text.Trim();

                //{C03DD304-AE71-4b6a-BC63-F385DB162EB7}
                this.inInstance.Item.Product.Producer.ID   = this.cmbProduce.Tag.ToString();
                this.inInstance.Item.Product.Producer.Name = this.cmbProduce.Text.Trim();
            }
            this.inInstance.DeliveryNO = this.txtDeliveryNO.Text.Trim();                                                  //送货单号
            this.inInstance.PlaceNO    = Neusoft.FrameWork.Public.String.TakeOffSpecialChar(this.txtPlaceNO.Text.Trim()); //货位号
            this.inInstance.Memo       = Neusoft.FrameWork.Public.String.TakeOffSpecialChar(this.txtMemo.Text);           //备注
        }
Пример #9
0
        private void ntbPurchasePrice_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                if (NConvert.ToDecimal(this.ntbPurchasePrice.Text) <= 0)
                {
                    MessageBox.Show(Language.Msg("请正确输入购入价 购入价应大于等于零"));
                    this.errorProvider1.SetError(this.ntbPurchasePrice, "购入价必须输入且大于0");
                    this.ntbPurchasePrice.Focus();
                    return;
                }
                else
                {
                    this.errorProvider1.Clear();
                }

                this.ComputeCost();
                if (this.isManagerFac)
                {
                    this.cmbProduce.Focus();
                }
                else if (this.isManagerExtend)
                {
                    this.txtDeliveryNO.Focus();
                }
                else
                {
                    this.btnOK.Focus();
                }
            }
        }
Пример #10
0
        private void value_FpKeyEvent(Keys key)
        {
            if (this.svTemp != null)
            {
                if (key == Keys.Enter)
                {
                    if (this.svTemp.ActiveColumnIndex == (int)ColumnSet.ColApplyQty)
                    {
                        decimal applyQty = NConvert.ToDecimal(this.svTemp.Cells[this.svTemp.ActiveRowIndex, (int)ColumnSet.ColApplyQty].Text);
                        decimal price    = NConvert.ToDecimal(this.svTemp.Cells[this.svTemp.ActiveRowIndex, (int)ColumnSet.ColRetailPrice].Text);
                        this.svTemp.Cells[this.svTemp.ActiveRowIndex, (int)ColumnSet.ColApplyCost].Text = (applyQty * price).ToString();

                        this.CompuateSum();
                    }

                    if (this.svTemp.ActiveRowIndex == this.svTemp.Rows.Count - 1)
                    {
                        this.phaInManager.SetFocus();
                    }
                    else
                    {
                        this.svTemp.ActiveRowIndex++;
                        this.svTemp.ActiveColumnIndex = (int)ColumnSet.ColApplyQty;
                    }
                }
            }
        }
Пример #11
0
        private void neuSpread1_EditModeOff(object sender, EventArgs e)
        {
            decimal radixQty   = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.ActiveRowIndex, (int)ColumnSet.ColRadixQty].Text);
            decimal surplusQty = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.ActiveRowIndex, (int)ColumnSet.ColSurplusQty].Text);
            decimal expendQty  = NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.ActiveRowIndex, (int)ColumnSet.ColExpendQty].Text);

            this.neuSpread1_Sheet1.Cells[this.neuSpread1_Sheet1.ActiveRowIndex, (int)ColumnSet.ColSupllyQty].Text = (radixQty + expendQty - surplusQty).ToString();
        }
Пример #12
0
        ///<summary>
        ///根据药品警戒线加入数据
        ///</summary>
        ///<param name="alterFlag">生成方式 0 警戒线 1 日消耗</param>
        ///<param name="deptCode">库房编码</param>
        ///<returns>成功返回0,失败返回-1</returns>
        public void FindByAlter(string alterFlag, string deptCode)
        {
            if (this.hsApplyData.Count > 0)
            {
                DialogResult result;
                result = MessageBox.Show("按警戒线生成将清除当前内容,是否继续", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1,
                                         MessageBoxOptions.RightAlign);
                if (result == DialogResult.No)
                {
                    return;
                }
            }

            try
            {
                this.Clear();

                ArrayList alDetail = new ArrayList();
                if (alterFlag == "1")
                {
                    #region 弹出窗口 设置日消耗参数 计算需申请信息
                    using (HISFC.Components.Pharmacy.ucPhaAlter uc = new ucPhaAlter())
                    {
                        uc.DeptCode = deptCode;
                        uc.SetData();
                        uc.Focus();
                        Neusoft.FrameWork.WinForms.Classes.Function.PopShowControl(uc);

                        if (uc.ApplyInfo != null)
                        {
                            alDetail = uc.ApplyInfo;
                        }
                    }
                    #endregion
                }
                else
                {
                    //{F4D82F23-CCDC-45a6-86A1-95D41EF856B8} 更改调用函数
                    alDetail = this.itemManager.QueryDrugListByNumAlter(deptCode);
                    if (alDetail == null)
                    {
                        MessageBox.Show(Language.Msg("按照数量警戒线执行信息计算未正确执行\n" + this.itemManager.Err));
                        return;
                    }
                }

                Neusoft.HISFC.Models.Pharmacy.Item item = new Neusoft.HISFC.Models.Pharmacy.Item();
                foreach (Neusoft.FrameWork.Models.NeuObject temp in alDetail)
                {
                    this.AddDrugData(temp.ID, null, NConvert.ToDecimal(temp.User03));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(Language.Msg(ex.Message));
            }
        }
Пример #13
0
        /// <summary>
        /// 获取住院患者的项目信息,包括药品和非药品
        /// </summary>
        /// <param name="InpatientNo"></param>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public ArrayList GetItemList(string InpatientNo, string beginTime, string endTime)
        {
            string sql = string.Empty;

            if (Sql.GetSql("WinForms.Report.Finance.FinIpb.ucFinIpbPatientDayFee2.2", ref sql) == -1)
            {
                return(null);
            }
            sql = " " + string.Format(sql, InpatientNo, beginTime, endTime);
            ArrayList items = new ArrayList(); //用于返回非药品信息的数组

            //执行当前Sql语句
            if (this.ExecQuery(sql) == -1)
            {
                this.Err = this.Sql.Err;

                return(null);
            }

            try
            {
                //循环读取数据
                while (this.Reader.Read())
                {
                    Undrug item = new Undrug();

                    item.ID        = this.Reader[0].ToString();                     //非药品编码
                    item.Name      = this.Reader[1].ToString();                     //非药品名称
                    item.Specs     = this.Reader[2].ToString();                     //规格
                    item.Qty       = NConvert.ToDecimal(this.Reader[3].ToString()); //数量
                    item.PriceUnit = this.Reader[4].ToString();                     //单位
                    item.Price     = NConvert.ToDecimal(this.Reader[5].ToString()); //默认价代替总额(为了方便)

                    items.Add(item);
                }//循环结束

                //关闭Reader
                this.Reader.Close();

                return(items);
            }
            catch (Exception e)
            {
                this.Err = "获得项目基本信息出错!" + e.Message;
                this.WriteErr();

                //如果还没有关闭Reader 关闭之
                if (!this.Reader.IsClosed)
                {
                    this.Reader.Close();
                }

                items = null;

                return(null);
            }
        }
Пример #14
0
        /// <summary>
        /// 根据床位等级编码提取BedFeeItem信息
        /// </summary>
        /// <param name="minFeeCode">最小费用编码</param>
        /// <returns>成功: 床位信息数组, 失败 null, 没有找到数据:元素为0的ArrayList</returns>
        public ArrayList QueryBedFeeItemByMinFeeCode(string minFeeCode)
        {
            string sql = string.Empty;             //查询SQL语句

            if (this.Sql.GetSql("Fee.BedFeeItem.SelectByFeeCode", ref sql) == -1)
            {
                this.Err = "没有找到索引为:Fee.BedFeeItem.SelectByFeeCode的SQL语句";

                return(null);
            }

            if (this.ExecQuery(sql, minFeeCode) == -1)
            {
                return(null);
            }

            try
            {
                ArrayList bedFeeItems = new ArrayList();

                //循环读取数据
                while (this.Reader.Read())
                {
                    Neusoft.HISFC.Models.Fee.BedFeeItem bedFeeItem = new Neusoft.HISFC.Models.Fee.BedFeeItem();

                    bedFeeItem.PrimaryKey     = this.Reader[0].ToString();
                    bedFeeItem.FeeGradeCode   = this.Reader[1].ToString();
                    bedFeeItem.ID             = this.Reader[2].ToString();
                    bedFeeItem.Name           = this.Reader[3].ToString();
                    bedFeeItem.Qty            = NConvert.ToDecimal(this.Reader[4].ToString());
                    bedFeeItem.SortID         = NConvert.ToInt32(this.Reader[5].ToString());
                    bedFeeItem.IsBabyRelation = NConvert.ToBoolean(this.Reader[6].ToString());
                    bedFeeItem.IsTimeRelation = NConvert.ToBoolean(this.Reader[7].ToString());
                    bedFeeItem.BeginTime      = NConvert.ToDateTime(this.Reader[8].ToString());
                    bedFeeItem.EndTime        = NConvert.ToDateTime(this.Reader[9].ToString());
                    bedFeeItem.ValidState     = (EnumValidState)NConvert.ToInt32(this.Reader[10]);
                    bedFeeItem.ExtendFlag     = this.Reader[13].ToString();

                    bedFeeItems.Add(bedFeeItem);
                }

                this.Reader.Close();

                return(bedFeeItems);
            }
            catch (Exception e)
            {
                this.Err = e.Message;

                if (!this.Reader.IsClosed)
                {
                    this.Reader.Close();
                }

                return(null);
            }
        }
Пример #15
0
        //{0EA3CF1A-2F03-46c3-83AE-1543B00BBDDB}
        /// <summary>
        /// 显示减免金额数据
        /// </summary>
        /// <param name="sheet">SheetView</param>
        /// <param name="ds">DataSet</param>
        protected virtual void SetRebateValue(FarPoint.Win.Spread.SheetView sheet, DataSet ds)
        {
            DataTable dt = ds.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                SetOneCellText(sheet, "A010", dr["rebate_cost"].ToString());
                this.d减免金额 = NConvert.ToDecimal(dr["rebate_cost"]);
            }
        }
        /// <summary>
        /// 科室虚库存管理保存
        /// </summary>
        /// <returns>成功返回1 失败返回-1</returns>
        public int SaveDeptPreStock()
        {
            this.deptSpread.StopCellEditing();

            this.dvDeptPreStock.RowFilter = "1=1";
            for (int i = 0; i < this.dvDeptPreStock.Count; i++)
            {
                this.dvDeptPreStock[i].EndEdit();
            }

            DataTable dtModify = this.dtDeptPreStock.GetChanges(DataRowState.Modified);

            if (dtModify == null || dtModify.Rows.Count <= 0)
            {
                return(-1);
            }

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

            //Neusoft.FrameWork.Management.Transaction t = new Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //t.BeginTransaction();

            this.itemManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            foreach (DataRow dr in dtModify.Rows)
            {
                decimal storeQty    = NConvert.ToDecimal(dr["实际库存"]);
                decimal preQty      = NConvert.ToDecimal(dr["预扣库存"]);
                decimal originalQty = NConvert.ToDecimal(dr["原预扣量"]);

                if (preQty > storeQty)
                {
                    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                    MessageBox.Show(Language.Msg("保存不能进行。【" + dr["药品名称"].ToString() + "】虚库存量不能大于实际库存量!"), "提示");
                    return(-1);
                }

                //虚库存管理模式变更 此处未来得及修改

                //if (this.itemManager.UpdateStockinfoPreOutNum(this.privDept.ID, dr["药品编码"].ToString(), preQty - originalQty) == -1)
                //{
                //    Neusoft.FrameWork.Management.PublicTrans.RollBack();
                //    MessageBox.Show(Language.Msg("保存操作 更新库存失败") + this.itemManager.Err);
                //    return -1;
                //}
            }

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

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

            return(1);
        }
Пример #17
0
        /// <summary>
        /// 显示医保金额数据
        /// </summary>
        /// <param name="sheet">SheetView</param>
        /// <param name="ds">DataSet</param>
        protected virtual void SetProtectValue(FarPoint.Win.Spread.SheetView sheet, DataSet ds)
        {
            DataTable dt = ds.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                switch (dr["pact_code"].ToString())
                {
                case "4":                                                     //公费
                {
                    SetOneCellText(sheet, "A012", dr["pub_cost"].ToString()); //公费医疗
                    this.d公费医疗 = NConvert.ToDecimal(dr["pub_cost"]);
                    SetOneCellText(sheet, "A013", dr["pay_cost"].ToString()); //公费自付
                    break;
                }

                case "2":                                                      //市护
                {
                    SetOneCellText(sheet, "A014", dr["own_cost"].ToString());  //市保自付

                    SetOneCellText(sheet, "A015", dr["pay_cost"].ToString());  //市保账户

                    SetOneCellText(sheet, "A016", dr["pub_cost"].ToString());  //市保统筹

                    SetOneCellText(sheet, "A017", dr["over_cost"].ToString()); //市保大额
                    this.d市保账户 = NConvert.ToDecimal(dr["pay_cost"]);
                    this.d市保统筹 = NConvert.ToDecimal(dr["pub_cost"]);
                    this.d市保大额 = NConvert.ToDecimal(dr["over_cost"]);

                    break;
                }

                case "3":                                                          //省保
                {
                    SetOneCellText(sheet, "A018", dr["own_cost"].ToString());      //省保自付

                    SetOneCellText(sheet, "A019", dr["pay_cost"].ToString());      //省保账户

                    SetOneCellText(sheet, "A020", dr["pub_cost"].ToString());      //省保统筹

                    SetOneCellText(sheet, "A021", dr["over_cost"].ToString());     //省保大额

                    SetOneCellText(sheet, "A022", dr["official_cost"].ToString()); //省公务员
                    this.d省保账户  = NConvert.ToDecimal(dr["pay_cost"]);
                    this.d省保统筹  = NConvert.ToDecimal(dr["pub_cost"]);
                    this.d省保大额  = NConvert.ToDecimal(dr["over_cost"]);
                    this.d省保公务员 = NConvert.ToDecimal(dr["official_cost"]);

                    break;
                }
                }
            }
        }
Пример #18
0
        /// <summary>
        /// 返回本张单据差额
        /// </summary>
        public virtual void CompuateSum()
        {
            decimal retailCost = 0;

            if (this.dt != null)
            {
                foreach (DataRow dr in this.dt.Rows)
                {
                    retailCost += NConvert.ToDecimal(dr["实发数量"]) * NConvert.ToDecimal(dr["零售价"]);
                }
                this.phaOutManager.TotCostInfo = string.Format("实发金额:{0}", retailCost.ToString("N"));
            }
        }
Пример #19
0
        private void Fp_EditModeOff(object sender, EventArgs e)
        {
            if (this.phaInManager.FpSheetView.ActiveColumnIndex == (int)ColumnSet.ColBackQty)
            {
                DataRow dr = this.dt.Rows.Find(this.GetKey(this.phaInManager.FpSheetView, this.phaInManager.FpSheetView.ActiveRowIndex));
                if (dr != null)
                {
                    dr["退库金额"] = NConvert.ToDecimal(dr["退库数量"]) * NConvert.ToDecimal(dr["零售价"]);

                    dr.EndEdit();
                }
            }
        }
Пример #20
0
        public bool Valid()
        {
            foreach (DataRow dr in this.dt.Rows)
            {
                if (NConvert.ToDecimal(dr["申请数量"]) <= 0)
                {
                    MessageBox.Show(Language.Msg(dr["商品名称"].ToString() + "申请出库数量不能为空"));
                    return(false);
                }
            }

            return(true);
        }
Пример #21
0
        private void Fp_EditModeOn(object sender, EventArgs e)
        {
            if (this.phaInManager.FpSheetView.ActiveRowIndex == (int)ColumnSet.ColPurchasePrice)
            {
                DataRow dr = this.dt.Rows.Find(this.GetKey(this.phaInManager.FpSheetView, this.phaInManager.FpSheetView.ActiveRowIndex));
                if (dr != null)
                {
                    dr["购入金额"] = NConvert.ToDecimal(dr["入库数量"]) * NConvert.ToDecimal(dr["购入价"]);

                    this.CompuateSum();
                }
            }
        }
Пример #22
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <returns></returns>
        protected int AddNewNostrumDetail()
        {
            if (this.tvNostrumList.SelectedNode.Tag == null)
            {
                MessageBox.Show("请选择所要维护的项目!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(-1);
            }

            if (this.IsCanEdit() == false)          //不允许进行编辑
            {
                return(-1);
            }

            Neusoft.HISFC.Models.Pharmacy.Item selectItem = (Neusoft.HISFC.Models.Pharmacy.Item) this.tvNostrumList.SelectedNode.Tag;
            string pcode  = selectItem.ID;
            string pname  = selectItem.Name + "[" + selectItem.Specs + "]";
            string itemID = this.fsDrugListSheet.GetText(this.fsDrugListSheet.ActiveRowIndex, 3);

            //判断是否存在该药品
            if (this.IsNewLineExists(pcode, itemID))
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("组套明细已经存在改处方项目"));
                return(-1);
            }

            Neusoft.HISFC.Models.Pharmacy.Item detailItem = this.itemManager.GetItem(itemID);
            if (detailItem == null)
            {
                MessageBox.Show(Neusoft.FrameWork.Management.Language.Msg("根据药品编码获取药品明细信息发生错误  ") + this.itemManager.Err);
                return(-1);
            }

            Neusoft.HISFC.Models.Pharmacy.Nostrum nostrum = new Neusoft.HISFC.Models.Pharmacy.Nostrum();
            nostrum.ID   = pcode;
            nostrum.Name = pname;

            nostrum.Item = detailItem;

            nostrum.Qty = NConvert.ToDecimal(1);

            nostrum.IsValid = true;
            nostrum.SortNO  = 1;

            //从药品列表添加到处方列表中
            CreateNewLineInFpDetails(nostrum);

            this.fsNostrumDetail.Focus();
            this.fsNostrumDetailSheet.ActiveColumnIndex = (int)NostrumDetailColumn.ColQty;

            return(1);
        }
Пример #23
0
        /// <summary>
        /// 返回本张单据差额
        /// </summary>
        public virtual void CompuateSum()
        {
            decimal retailCost = 0;

            if (this.dt != null)
            {
                for (int i = 0; i < this.phaInManager.FpSheetView.Rows.Count; i++)
                {
                    retailCost += NConvert.ToDecimal(this.phaInManager.FpSheetView.Cells[i, (int)ColumnSet.ColApplyCost].Text);
                }

                this.phaInManager.TotCostInfo = string.Format("申请总金额:{0} ", retailCost.ToString("N"));
            }
        }
Пример #24
0
        public int AddItem(FarPoint.Win.Spread.SheetView sv, int activeRow)
        {
            string  drugNO   = sv.Cells[activeRow, 0].Text;
            string  batchNO  = sv.Cells[activeRow, 3].Text;
            decimal storeQty = NConvert.ToDecimal(sv.Cells[activeRow, 5].Text);

            if (this.AddDrugData(drugNO, batchNO, storeQty) == 1)
            {
                this.SetFormat();

                this.SetFocusSelect();
            }
            return(1);
        }
Пример #25
0
        private void fpPayMode_Sheet1_CellChanged(object sender, SheetViewEventArgs e)
        {
            string tempString = this.fpPayMode_Sheet1.Cells[e.Row, (int)PayModeCols.PayMode].Text;

            if (tempString == string.Empty)
            {
                for (int i = 0; i < this.fpPayMode_Sheet1.Columns.Count; i++)
                {
                    this.fpPayMode_Sheet1.Cells[e.Row, i].Text = string.Empty;
                }
            }
            bool    isOnlyCash = true;
            decimal nowCost    = 0;

            for (int i = 0; i < this.fpPayMode_Sheet1.RowCount; i++)
            {
                if (this.fpPayMode_Sheet1.Cells[i, (int)PayModeCols.PayMode].Text != string.Empty)
                {
                    if (this.fpPayMode_Sheet1.Rows[i].Tag != null && this.fpPayMode_Sheet1.Rows[i].Tag.ToString() != "CA" &&
                        NConvert.ToDecimal(this.fpPayMode_Sheet1.Cells[i, (int)PayModeCols.Cost].Value) > 0)
                    {
                        isOnlyCash = false;
                        nowCost   += NConvert.ToDecimal(this.fpPayMode_Sheet1.Cells[i, (int)PayModeCols.Cost].Value);
                    }
                }
            }

            if (this.realCost == 0)
            {
                this.realCost = this.totOwnCost;
            }

            if (isOnlyCash)
            {
                this.totOwnCost = Neusoft.FrameWork.Public.String.FormatNumber(totOwnCost, 2);
                this.fpPayMode_Sheet1.Cells[0, (int)PayModeCols.Cost].Text = totOwnCost.ToString();
            }
            else
            {
                if (realCost - nowCost < 0)
                {
                    this.fpPayMode_Sheet1.Cells[e.Row, (int)PayModeCols.Cost].Value = 0;
                    this.fpPayMode_Sheet1.SetActiveCell(e.Row, (int)PayModeCols.Cost, false);
                    nowCost = 0;
                }
                this.totOwnCost = Neusoft.FrameWork.Public.String.FormatNumber(realCost, 2);
                this.fpPayMode_Sheet1.Cells[0, (int)PayModeCols.Cost].Value = realCost - nowCost;
            }
        }
Пример #26
0
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>

        protected int Query()
        {
            if (this.cmbStockDept.Tag == null || this.cmbStockDept.Tag.ToString() == "")
            {
                MessageBox.Show(Language.Msg("请选择查询药库"));
                return(-1);
            }

            System.Data.DataSet ds = new DataSet();

            Neusoft.FrameWork.Management.DataBaseManger dataManager = new DataBaseManger();
            if (dataManager.ExecQuery("Pharmacy.Report.InputSum", ref ds, this.cmbStockDept.Tag.ToString(), this.BeginTime.ToString(), this.EndTime.ToString()) == -1)
            {
                MessageBox.Show(Language.Msg("没有相关信息!") + dataManager.Err);
                return(-1);
            }

            if (ds == null || ds.Tables.Count <= 0)
            {
                return(0);
            }
            this.fpSpread1_Sheet1.DataSource = ds;



            int     iTotIndex = this.fpSpread1_Sheet1.RowCount;
            decimal sumNum4   = 0;
            decimal sumNum3   = 0;
            decimal sumNum2   = 0;
            decimal sumNum1   = 0;


            for (int i = 0; i < iTotIndex; i++)
            {
                sumNum1 = sumNum1 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 1].Text);
                sumNum2 = sumNum2 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 2].Text);
                sumNum3 = sumNum3 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 3].Text);
                sumNum4 = sumNum4 + NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[i, 4].Text);
            }
            //this.fpSpread1_Sheet1.RowCount = iTotIndex + 1;
            this.fpSpread1_Sheet1.Rows.Add(iTotIndex, 1);
            this.fpSpread1_Sheet1.Cells[iTotIndex, 0].Text = "合计";
            this.fpSpread1_Sheet1.Cells[iTotIndex, 1].Text = sumNum1.ToString();
            this.fpSpread1_Sheet1.Cells[iTotIndex, 2].Text = sumNum2.ToString();
            this.fpSpread1_Sheet1.Cells[iTotIndex, 3].Text = sumNum3.ToString();
            this.fpSpread1_Sheet1.Cells[iTotIndex, 4].Text = sumNum4.ToString();

            return(1);
        }
Пример #27
0
 /// <summary>
 /// 检查数据有效性
 /// </summary>
 /// <returns></returns>
 private bool IsValid()
 {
     if (this.txtName.TextLength == 0)
     {
         MessageBox.Show("公司名称不能为空!");
         this.txtName.Focus();
         return(false);
     }
     if (this.txtCoporation.TextLength == 0)
     {
         MessageBox.Show("公司法人不能为空!");
         this.txtCoporation.Focus();
         return(false);
     }
     if (this.txtAddress.TextLength == 0)
     {
         MessageBox.Show("公司地址不能为空!");
         this.txtAddress.Focus();
         return(false);
     }
     if (this.txtSpellCode.TextLength == 0)
     {
         MessageBox.Show("拼音不能为空!");
         this.txtSpellCode.Focus();
         return(false);
     }
     if (this.txtUserCode.Text.Length == 0)
     {
         MessageBox.Show("自定义编码不能为空!");
         this.txtUserCode.Focus();
         return(false);
     }
     if (this.txtWbCode.Text.Length == 0)
     {
         MessageBox.Show("五笔码不能为空!");
         this.txtWbCode.Focus();
         return(false);
     }
     if (NConvert.ToDecimal(this.txtActualRate.Text) >= NConvert.ToDecimal("1.0000"))
     {
         MessageBox.Show("政府扣率应当小于1大于0!");
         this.txtActualRate.Focus();
         return(false);
     }
     else
     {
         return(true);
     }
 }
Пример #28
0
        private void Fp_EditModeOff(object sender, EventArgs e)
        {
            if (this.matInManager.FpSheetView.ActiveColumnIndex == (int)ColumnSet.ColBackQty)
            {
                DataRow dr = this.dt.Rows.Find(this.GetKey(this.matInManager.FpSheetView, this.matInManager.FpSheetView.ActiveRowIndex));
                //string[] keys = new string[] { this.matInManager.FpSheetView.Cells[this.matInManager.FpSheetView.ActiveRowIndex, (int)ColumnSet.ColItemCode].Text, this.matInManager.FpSheetView.Cells[this.matInManager.FpSheetView.ActiveRowIndex, (int)ColumnSet.ColGroupNO].Text };
                //DataRow dr = this.dt.Rows.Find(keys);
                if (dr != null)
                {
                    dr["退库金额"] = NConvert.ToDecimal(dr["退库数量"]) * NConvert.ToDecimal(dr["购入价"]);

                    dr.EndEdit();
                }
            }
        }
Пример #29
0
        /// <summary>
        /// 项目信息添加
        /// </summary>
        /// <param name="sv"></param>
        /// <param name="activeRow">新增行</param>
        /// <returns></returns>
        public int AddItem(FarPoint.Win.Spread.SheetView sv, int activeRow)
        {
            //-----by yuyun 08-7-25 第一列变成自定义码  原自定义码列成物资编码
            //string itemNO = sv.Cells[activeRow, 0].Text;
            string itemNO = sv.Cells[activeRow, 11].Text;

            decimal storeQty = NConvert.ToDecimal(sv.Cells[activeRow, 4].Text);
            Decimal price    = NConvert.ToDecimal(sv.Cells[activeRow, 3].Text);

            if (this.AddDrugData(itemNO, storeQty, price) == 1)
            {
                this.SetFocusSelect();
            }
            return(1);
        }
Пример #30
0
        /// <summary>
        /// 显示公费金额数据
        /// </summary>
        /// <param name="sheet">SheetView</param>
        /// <param name="ds">DataSet</param>
        protected virtual void SetPublicValue(FarPoint.Win.Spread.SheetView sheet, DataSet ds)
        {
            DataTable dt = ds.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                SetOneCellText(sheet, "A012", dr["pub_cost"].ToString()); //公费医疗
                this.d公费医疗 = NConvert.ToDecimal(dr["pub_cost"]);
                SetOneCellText(sheet, "A013", dr["own_cost"].ToString()); //公费自付
                SetOneCellText(sheet, "A026", dr["pay_cost"].ToString()); //公费账户
                this.d公费账户 = NConvert.ToDecimal(dr["pay_cost"]);
                //SetOneCellText(sheet, "A010", dr["rebate_cost"].ToString());
                //this.d减免金额 = NConvert.ToDecimal(dr["rebate_cost"]);
            }
        }