/// <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); } }
public ConfigOR Read() { string ConfigPath = string.Format("{0}\\config.xml", Common.GetPath()); if (!File.Exists(ConfigPath)) { ErrorLog.WriteLog("ReadXmlConfig#Read", "配置文件不存在."); return null; } XmlDocument xmlDoc = new XmlDocument(); try { xmlDoc.Load(ConfigPath); } catch (Exception ex) { ErrorLog.WriteLog("", ex.Message); } XmlNodeList nodeList = xmlDoc.SelectSingleNode("root").ChildNodes;// ConfigOR config = new ConfigOR(); foreach (XmlNode xn in nodeList) { if (xn is XmlElement) { XmlElement xe = (XmlElement)xn; switch (xe.Name) { case "tp_4_adv": config.tp_4_adv = xe.InnerText; break; case "tp_5_adv": config.tp_5_adv = xe.InnerText; break; case "tp_8_adv": config.tp_8_adv = xe.InnerText; break; case "tp_8_show": config.tp_8_show = xe.InnerText; break; case "zhp_4_adv": config.zhp_4_adv = xe.InnerText; break; case "zhp_5_adv": config.zhp_5_adv = xe.InnerText; break; case "zhp_8_adv": config.zhp_8_adv = xe.InnerText; break; case "volume": int itemp = 5; if (int.TryParse(xe.InnerText, out itemp)) { config.volume = itemp; } else { config.volume = 7; } break; } } } return config; }