/// <summary> /// 初使化、 /// </summary> public QueueMian() { try { InitBankNo(); //Vip优先时间处理类 VipCardHeadObj = new VipCardHeadle(); VipCardHeadObj.Init(); List<BussinessOR> ListBuss = new List<BussinessOR>();//所有业务 //查询 所有的业务队列 ListBuss = _busDA.selectAllBussiness(); QhQueues = new List<BussinessQueueOR>(); //根据队列,取出已取号的排队信息。 foreach (BussinessOR obj in ListBuss) { BussinessQueueOR bussQue = new BussinessQueueOR(); bussQue.Init(obj); bussQue.BussQueues = _QueueDA.selectBussinessQueues(obj.Id);//获取此队列未办结的取号记录 foreach (QueueInfoOR qhObj in bussQue.BussQueues) { if (!string.IsNullOrEmpty(qhObj.Cardno)) { qhObj.VipFirstTime = VipCardHeadObj.GetFirstTime(qhObj.Cardno); } } QhQueues.Add(bussQue); } //初使化登录日志 ListWindowLogins = _WindowLoginDA.SelectToDayLogins(); //获取窗口 ListWindows = new WindowMySqlDA().SelectWindows(); //业务角色处理 BussRoleObj = new BussinessRoleHeadle(); BussRoleObj.Init(); //参数设置 _SysparaConfigObj = new SysParaMySqlDA().SelectConfigORByWdbh(); //读取config.xml文件 _Config = new ReadXmlConfig().Read(); List<DeviceOR> ListAllZP = new DeviceDAMySql().SelectAllDevices(); foreach (DeviceOR obj in ListAllZP) { if (obj.Devicetypeid == 4) { ListZPOR.Add(obj); } } } catch (Exception ex) { ErrorLog.WriteLog("QueueMian_Init#ex", ex.Message); } }
/// <summary> /// 获取所有业务队业,根据用户登录窗口处理它们可以办理的队列 /// </summary> /// <returns></returns> public List<BussinessQueueOR> getQueuesByWindow(string windowID) { WindowLoginInfoOR _loginWin= GetLoginLogByWindowNo(windowID); if (_loginWin == null) return null; _loginWin.GetDataTime = DateTime.Now; List<BussinessQueueOR> list = new List<BussinessQueueOR>(); if (QhQueues != null) { foreach (var v in QhQueues) { if (BussRoleObj.BussinessIsEnableHeadle(_loginWin.BussinessRoleOn, v.Id,ListWindowLogins)) { BussinessQueueOR obj = new BussinessQueueOR(); obj.Init(v); obj.InitNumber(); obj.BussQueues = v.GetCurrentQueues(windowID); //v.InitNumber(); list.Add(obj); } } } return list; }
/// <summary> /// 判断当前时间是否可以办理 /// </summary> /// <returns></returns> private bool CheckBussinessTime(BussinessQueueOR _buss, out string mErrorMsg) { bool isEnable = false; string headTime = string.Empty; string WeekShow = ""; switch (DateTime.Now.DayOfWeek) { case DayOfWeek.Monday://星期一 isEnable = _buss.Mondayflag; headTime = _buss.Mondaytime; WeekShow = "星期一"; break; case DayOfWeek.Tuesday: isEnable = _buss.Tuesdayflag; headTime = _buss.Tuesdaytime; WeekShow = "星期二"; break; case DayOfWeek.Wednesday: isEnable = _buss.Wednesdayflag; headTime = _buss.Wednesdaytime; WeekShow = "星期三"; break; case DayOfWeek.Thursday: isEnable = _buss.Thurdayflag; headTime = _buss.Thurdaytime; WeekShow = "星期四"; break; case DayOfWeek.Friday: isEnable = _buss.Fridayflag; headTime = _buss.Fridaytime; WeekShow = "星期五"; break; case DayOfWeek.Saturday: isEnable = _buss.Saturdayflag; headTime = _buss.Saturdaytime; WeekShow = "星期六"; break; case DayOfWeek.Sunday: isEnable = _buss.Sundayflag; headTime = _buss.Sundaytime; WeekShow = "星期日"; break; } mErrorMsg = ""; if (!isEnable) { mErrorMsg = string.Format("Error:业务:{1},{0}不能办理。", _buss.Name, WeekShow); return false; } //判断时间判断 if (string.IsNullOrEmpty(headTime)) return true; string[] timeArr=headTime.Split(';'); if (timeArr.Length >= 3) { if (string.IsNullOrEmpty(timeArr[0]) && string.IsNullOrEmpty(timeArr[1])) return true; if (!VaildTime(timeArr[0], timeArr[1], out mErrorMsg)) { return false; } } return true; }