예제 #1
0
        /// <summary>
        /// 获取午别
        /// </summary>
        /// <param name="current"></param>
        /// <returns></returns>
        private Neusoft.HISFC.Models.Base.Noon getNoon(DateTime current)
        {
            Neusoft.HISFC.BizLogic.Registration.Noon noonMgr = new Neusoft.HISFC.BizLogic.Registration.Noon();

            System.Collections.ArrayList alNoon = noonMgr.Query();
            if (alNoon == null)
            {
                MessageBox.Show("获取午别信息时出错!" + noonMgr.Err, "提示");
                return(null);
            }
            if (alNoon == null)
            {
                return(null);
            }

            /*
             * 理解错误:以为午别应该是包含一天全部时间上午:06~12,下午:12~18其余为晚上,
             * 实际午别为医生出诊时间段,上午可能为08~11:30,下午为14~17:30
             * 所以如果挂号员如果不在这个时间段挂号,就有可能提示午别未维护
             * 所以改为根据传人时间所在的午别例如:9:30在06~12之间,那么就判断是否有午别在
             * 06~12之间,全包含就说明9:30是那个午别代码
             */
            //			foreach(Neusoft.HISFC.Models.Registration.Noon obj in alNoon)
            //			{
            //				if(int.Parse(current.ToString("HHmmss"))>=int.Parse(obj.BeginTime.ToString("HHmmss"))&&
            //					int.Parse(current.ToString("HHmmss"))<int.Parse(obj.EndTime.ToString("HHmmss")))
            //				{
            //					return obj.ID;
            //				}
            //			}



            int[,] zones = new int[, ] {
                { 0, 120000 }, { 120000, 180000 }, { 180000, 235959 }
            };
            int time = int.Parse(current.ToString("HHmmss"));
            int begin = 0, end = 0;

            for (int i = 0; i < 3; i++)
            {
                if (zones[i, 0] <= time && zones[i, 1] > time)
                {
                    begin = zones[i, 0];
                    end   = zones[i, 1];
                    break;
                }
            }

            foreach (Neusoft.HISFC.Models.Base.Noon obj in alNoon)
            {
                if (int.Parse(obj.StartTime.ToString("HHmmss")) >= begin &&
                    int.Parse(obj.EndTime.ToString("HHmmss")) <= end)
                {
                    return(obj);
                }
            }

            return(null);
        }
예제 #2
0
 /// <summary>
 /// 初始化午别
 /// </summary>
 private void InitNoon()
 {
     Neusoft.HISFC.BizLogic.Registration.Noon noonMgr = new Neusoft.HISFC.BizLogic.Registration.Noon();
     this.alNoon = noonMgr.Query();
     if (alNoon == null)
     {
         MessageBox.Show("获取午别信息时出错!" + noonMgr.Err, "提示");
         return;
     }
 }
        /// <summary>
        /// 初始化午别
        /// </summary>
        private void InitNoon()
        {
            Neusoft.HISFC.BizLogic.Registration.Noon NoonMgr = new Neusoft.HISFC.BizLogic.Registration.Noon();

            ArrayList al = NoonMgr.Query();

            if (al == null)
            {
                MessageBox.Show("获取午别信息时出错!" + NoonMgr.Err, "提示");
                return;
            }

            foreach (Neusoft.HISFC.Models.Base.Noon obj in al)
            {
                this.htNoon.Add(obj.ID, obj.Name);
            }
        }