Ejemplo n.º 1
0
        /// <summary>
        /// 克隆
        /// </summary>
        /// <returns>医技预约排班信息</returns>
        public new MedTechItemTemp Clone()
        {
            MedTechItemTemp medTechItemTemp = base.Clone() as MedTechItemTemp;

            medTechItemTemp.MedTechItem = this.MedTechItem.Clone();
            medTechItemTemp.Dept        = this.Dept.Clone();
            medTechItemTemp.Machine     = this.Machine.Clone();

            return(medTechItemTemp);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 根据行号获取一个实体

        /// </summary>
        /// <param name="itemTemp">实体</param>
        /// <param name="row">行号</param>
        /// <returns>1-成功;-1-失败</returns>
        private int GetItem(ref Neusoft.HISFC.Models.Terminal.MedTechItemTemp itemTemp, int row)
        {
            bool isValid = false;

            itemTemp.MedTechItem.Item.ID = this.neuSpread1_Sheet1.Cells[row, (int)cols.ItemCode].Text;
            if (itemTemp.MedTechItem.Item.ID == null || itemTemp.MedTechItem.Item.ID == "")
            {
                this.neuSpread1_Sheet1.SetActiveCell(row, (int)cols.ItemCode);
                MessageBox.Show("项目编码不能为空");
                return(-1);
            }
            itemTemp.MedTechItem.Item.Name           = this.neuSpread1_Sheet1.Cells[row, (int)cols.ItemName].Text;
            itemTemp.MedTechItem.ItemExtend.UnitFlag = this.GetUnitIDByName(this.neuSpread1_Sheet1.Cells[row, (int)cols.UnitFlag].Text);
            itemTemp.BookLmt        = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[row, (int)cols.BookLmt].Text);
            itemTemp.SpecialBookLmt = Neusoft.FrameWork.Function.NConvert.ToDecimal(this.neuSpread1_Sheet1.Cells[row, (int)cols.SpecialBookLmt].Text);
            if (itemTemp.BookLmt == 0 && itemTemp.SpecialBookLmt == 0)
            {
                this.neuSpread1_Sheet1.SetActiveCell(row, (int)cols.BookLmt);
                MessageBox.Show("预约限额和特诊限额不允许同时为0");
                return(-1);
            }
            itemTemp.NoonCode = noonListHelper.GetID(this.neuSpread1_Sheet1.Cells[row, (int)cols.Noon].Text);
            if (this.neuSpread1_Sheet1.Cells[row, (int)cols.Valid].Text == "有效")
            {
                isValid = true;
            }
            itemTemp.MedTechItem.Item.IsValid       = isValid;
            itemTemp.MedTechItem.Item.Notice        = this.neuSpread1_Sheet1.Cells[row, (int)cols.Remark].Text;
            itemTemp.MedTechItem.Item.Oper.ID       = this.operEnvironment.ID;
            itemTemp.MedTechItem.Item.Oper.OperTime = this.bookingIntegrate.GetCurrentDateTime();
            itemTemp.Week = this.week.ToString();
            itemTemp.MedTechItem.ItemExtend.Dept.ID = this.operEnvironment.Dept.ID;
            itemTemp.Dept.Name = this.operEnvironment.Dept.Name;
            itemTemp.TmpFlag   = this.neuSpread1_Sheet1.Cells [row, (int)cols.TmpFlag].Text.ToString();
            if (itemTemp.NoonCode == "")
            {
                this.neuSpread1_Sheet1.SetActiveCell(row, (int)cols.Noon);
                MessageBox.Show("午别不能为空!", "提示");
                return(-1);
            }
            if (Neusoft.FrameWork.Public.String.ValidMaxLengh(itemTemp.MedTechItem.Item.Notice, 100) == false)
            {
                this.neuSpread1_Sheet1.SetActiveCell(row, (int)cols.Remark);
                MessageBox.Show("备注不能超过100个汉字!", "提示");
                return(-1);
            }
            // {5A111831-190D-4187-8076-83E220BC97B2}
            itemTemp.StartTime = this.neuSpread1_Sheet1.Cells[row, (int)cols.StartTime].Text;
            itemTemp.EndTime   = this.neuSpread1_Sheet1.Cells[row, (int)cols.EndTime].Text;
            // 成功返回
            return(1);
        }
Ejemplo n.º 3
0
        ///// <summary>
        ///// 验证
        ///// </summary>
        ///// <param name="dataTable">数据表</param>
        ///// <returns>0-成功;-1-失败</returns>
        //private int Valid(DataTable dataTable)
        //{
        //    if (dataTable != null)
        //    {
        //        foreach (DataRow dataRow in dataTable.Rows)
        //        {
        //            // 午别编码
        //            string noon = noonListHelper.GetID(dataRow["Noon"].ToString());

        //            if (dataRow["ItemCode"].ToString() == null || dataRow["ItemCode"].ToString() == "")
        //            {
        //                MessageBox.Show("项目代码不能为空!", "提示");
        //                return -1;
        //            }
        //            if (noon == "")
        //            {
        //                MessageBox.Show("午别不能为空!", "提示");
        //                return -1;
        //            }
        //            if (dataRow["BookLmt"].ToString() == null || dataRow["BookLmt"].ToString() == "")
        //            {
        //                MessageBox.Show("预约限额必须录入!", "提示");
        //                return -1;
        //            }
        //            if (dataRow["SpecialBookLmt"].ToString() == null || dataRow["SpecialBookLmt"].ToString() == "")
        //            {
        //                MessageBox.Show("特诊预约限额必须录入!", "提示");
        //                return -1;
        //            }
        //            if (Neusoft.FrameWork.Function.NConvert.ToInt32(dataRow["BookLmt"]) == 0 && Neusoft.FrameWork.Function.NConvert.ToInt32(dataRow["SpecialBookLmt"]) == 0)
        //            {
        //                MessageBox.Show("预约限额和特诊限额不允许同时为0", "提示");
        //                return -1;
        //            }
        //            if (Neusoft.FrameWork.Public.String.ValidMaxLengh(dataRow["Remark"].ToString(), 100) == false)
        //            {
        //                MessageBox.Show("备注不能超过100个汉字!", "提示");
        //                return -1;
        //            }
        //        }
        //    }
        //    // 成功返回
        //    return 0;
        //}

        /// <summary>
        /// 将表中数据转换为实体集合
        /// </summary>
        /// <param name="dataTable">数据表</param>
        /// <returns></returns>
        private ArrayList DataTableToArrayList(DataTable dataTable)
        {
            // 模板数据
            this.tempList = new ArrayList();

            if (dataTable != null)
            {
                try
                {
                    foreach (DataRow dataRow in dataTable.Rows)
                    {
                        // 排班模板
                        Neusoft.HISFC.Models.Terminal.MedTechItemTemp medTechItemTemp = new Neusoft.HISFC.Models.Terminal.MedTechItemTemp();
                        // 有效性

                        bool isValid = false;

                        medTechItemTemp.MedTechItem.Item.ID             = dataRow["ItemCode"].ToString();
                        medTechItemTemp.MedTechItem.Item.Name           = dataRow["ItemName"].ToString();
                        medTechItemTemp.MedTechItem.ItemExtend.UnitFlag = this.GetUnitIDByName(dataRow["UnitFlag"].ToString());
                        medTechItemTemp.BookLmt        = Neusoft.FrameWork.Function.NConvert.ToDecimal(dataRow["BookLmt"]);
                        medTechItemTemp.SpecialBookLmt = Neusoft.FrameWork.Function.NConvert.ToDecimal(dataRow["SpecialBookLmt"]);
                        medTechItemTemp.NoonCode       = noonListHelper.GetID(dataRow["Noon"].ToString());
                        if (dataRow["Valid"].ToString() == "有效")
                        {
                            isValid = true;
                        }
                        medTechItemTemp.MedTechItem.Item.IsValid       = isValid;
                        medTechItemTemp.MedTechItem.Item.Notice        = dataRow["Remark"].ToString();
                        medTechItemTemp.MedTechItem.Item.Oper.ID       = this.operEnvironment.ID;
                        medTechItemTemp.MedTechItem.Item.Oper.OperTime = this.bookingIntegrate.GetCurrentDateTime();
                        medTechItemTemp.Week = this.week.ToString();
                        medTechItemTemp.MedTechItem.ItemExtend.Dept.ID = this.operEnvironment.Dept.ID;
                        medTechItemTemp.Dept.Name = this.operEnvironment.Dept.Name;
                        // //{5A111831-190D-4187-8076-83E220BC97B2}
                        medTechItemTemp.StartTime = this.bookingIntegrate.GetCurrentDateTime().ToShortTimeString();
                        medTechItemTemp.EndTime   = this.bookingIntegrate.GetCurrentDateTime().ToShortTimeString();
                        // 添加进数组

                        this.tempList.Add(medTechItemTemp);
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show("生成实体集合时出错!" + e.Message, "提示");
                    return(null);
                }
            }

            return(tempList);
        }