예제 #1
0
        /// <summary>
        /// 增加
        /// </summary>
        /// <param name="tempMedTechItemTemp">医技预约项目</param>
        public void AddTemp(Neusoft.HISFC.Models.Terminal.MedTechItemTemp tempMedTechItemTemp)
        {
            try
            {
                this.fpSpread1_Sheet1.Rows.Add(this.fpSpread1_Sheet1.RowCount, 1);
                this.fpSpread1_Sheet1.ActiveRowIndex = this.fpSpread1_Sheet1.RowCount - 1;
                int row = this.fpSpread1_Sheet1.ActiveRowIndex;

                this.fpSpread1_Sheet1.SetValue(row, (int)cols.ItemCode, tempMedTechItemTemp.MedTechItem.Item.ID, false);
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.ItemName, tempMedTechItemTemp.MedTechItem.Item.Name, false);
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.BookLmt, tempMedTechItemTemp.BookLmt, false);
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.SpecialBookLmt, tempMedTechItemTemp.SpecialBookLmt, false);
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.Noon, noonListHelper.GetName(tempMedTechItemTemp.NoonCode), false);
                //{5A111831-190D-4187-8076-83E220BC97B2}
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.StartTime, tempMedTechItemTemp.StartTime, false);
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.EndTime, tempMedTechItemTemp.EndTime, false);
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.BookNum, 0);
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.SpecialBookNum, 0);
                this.fpSpread1_Sheet1.SetValue(row, (int)cols.UnitFlag, this.GetUnitNameById(tempMedTechItemTemp.MedTechItem.ItemExtend.UnitFlag), false);
                this.fpSpread1_Sheet1.SetValue(row, ( int )cols.TmpFlag, tempMedTechItemTemp.TmpFlag, false);
                if (tempMedTechItemTemp.TmpFlag == "2")
                {
                    this.fpSpread1_Sheet1.SetValue(row, (int)cols.Machine, tempMedTechItemTemp.MedTechItem.Item.ID, false);
                }
                this.fpSpread1.Focus();
                this.fpSpread1_Sheet1.SetActiveCell(this.fpSpread1_Sheet1.ActiveRowIndex, (int)cols.ItemCode, false);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "提示信息");
                return;
            }
        }
예제 #2
0
        /// <summary>
        /// 获取模板项目
        /// </summary>
        /// <param name="tempMedTechItemTemp">模板项目</param>
        /// <param name="row">行号</param>
        /// <returns>1-成功;-1-失败</returns>
        private int GetTempItem(ref Neusoft.HISFC.Models.Terminal.MedTechItemTemp tempMedTechItemTemp, int row)
        {
            //{5A111831-190D-4187-8076-83E220BC97B2}
            tempMedTechItemTemp.MedTechItem.Item.ID             = this.fpSpread1_Sheet1.Cells[row, (int)cols.ItemCode].Text;
            tempMedTechItemTemp.MedTechItem.Item.Name           = this.fpSpread1_Sheet1.Cells[row, (int)cols.ItemName].Text;
            tempMedTechItemTemp.MedTechItem.ItemExtend.UnitFlag = this.GetUnitIDByName(this.fpSpread1_Sheet1.Cells[row, (int)cols.UnitFlag].Text);
            tempMedTechItemTemp.MedTechItem.ItemExtend.Dept.ID  = this.operEnvironment.Dept.ID;
            tempMedTechItemTemp.Dept.Name = this.operEnvironment.Dept.Name;
            tempMedTechItemTemp.MedTechItem.ItemExtend.BookTime = this.seeDate.ToString();
            tempMedTechItemTemp.NoonCode       = noonListHelper.GetID(this.fpSpread1_Sheet1.Cells[row, (int)cols.Noon].Text);
            tempMedTechItemTemp.BookLmt        = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[row, (int)cols.BookLmt].Text);
            tempMedTechItemTemp.SpecialBookLmt = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[row, (int)cols.SpecialBookLmt].Text);
            tempMedTechItemTemp.MedTechItem.Item.ChildPrice   = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[row, (int)cols.BookNum].Text);
            tempMedTechItemTemp.MedTechItem.Item.SpecialPrice = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.fpSpread1_Sheet1.Cells[row, (int)cols.SpecialBookNum].Text);
            tempMedTechItemTemp.MedTechItem.Item.Oper.ID      = this.operEnvironment.ID;
            tempMedTechItemTemp.TmpFlag    = this.fpSpread1_Sheet1.Cells [row, ( int )cols.TmpFlag].Text;
            tempMedTechItemTemp.StartTime  = this.fpSpread1_Sheet1.Cells[row, (int)cols.StartTime].Text;
            tempMedTechItemTemp.EndTime    = this.fpSpread1_Sheet1.Cells[row, (int)cols.EndTime].Text;
            tempMedTechItemTemp.Machine.ID = machineObjHelper.GetID(this.fpSpread1_Sheet1.Cells[row, (int)cols.Machine].Text);


            if (tempMedTechItemTemp.MedTechItem.Item.ID == null || tempMedTechItemTemp.MedTechItem.Item.ID == "")
            {
                this.fpSpread1_Sheet1.ActiveRowIndex = row;
                MessageBox.Show("项目编码不能为空");
                return(-1);
            }
            if (tempMedTechItemTemp.MedTechItem.Item.Name == null || tempMedTechItemTemp.MedTechItem.Item.Name == "")
            {
                this.fpSpread1_Sheet1.SetActiveCell(row, (int)cols.ItemName);
                MessageBox.Show("项目名称不能为空");
                return(-1);
            }
            if (tempMedTechItemTemp.NoonCode == null || tempMedTechItemTemp.NoonCode == "")
            {
                this.fpSpread1_Sheet1.SetActiveCell(row, (int)cols.Noon);
                MessageBox.Show("午别不能为空");
                return(-1);
            }
            if (tempMedTechItemTemp.BookLmt == 0 && tempMedTechItemTemp.SpecialBookLmt == 0)
            {
                this.fpSpread1_Sheet1.SetActiveCell(row, (int)cols.BookLmt);
                this.fpSpread1_Sheet1.ActiveRowIndex = row;
                MessageBox.Show("预约限额和特诊限额不允许同时为0");
                return(-1);
            }
            return(1);
        }