public object GetGridDetailData(string unitSeq, string busiSeq) { var busiAttrQuery = new TBusinessAttributeDAL(this.db, this.areaNo).GetQuery(); var unitQuery = new TUnitDAL(this.db, this.areaNo).GetQuery(); var busiQuery = new TBusinessDAL(this.db, this.areaNo).GetQuery(); return(busiAttrQuery .LeftJoin(unitQuery, (m, u) => m.unitSeq == u.unitSeq) .LeftJoin(busiQuery, (m, u, b) => m.busiSeq == b.busiSeq && m.unitSeq == b.unitSeq) .Where((m, u, b) => m.unitSeq == unitSeq && m.busiSeq == busiSeq) .Select((m, u, b) => new { m.ID, u.unitSeq, u.unitName, b.busiSeq, b.busiCode, b.busiName, m.timeInterval, m.ticketRestriction, m.lineUpMax, m.lineUpWarningMax, m.ticketPrefix, isGreenChannel = m.isGreenChannel == 1 ? "是" : "否", m.remark, Model = m }) .OrderBy(k => k.ID) .ToList()); }
public object GetUnitList() { var busiQuery = new TBusinessDAL(this.db, this.areaNo).GetQuery(); var unitQuery = new TUnitDAL(this.db, this.areaNo).GetQuery(); return(busiQuery .GroupBy(k => k.unitSeq) .Select(s => new { s.unitSeq }) .LeftJoin(unitQuery, (b, u) => b.unitSeq == u.unitSeq) .Select((b, u) => u) .OrderBy(k => k.unitSeq) .ToList()); }
public object GetGridDetailData(string unitSeq, string busiSeq) { var busiAttrQuery = this.GetQuery(); var unitQuery = new TUnitDAL(this.db, this.areaNo).GetQuery(); var busiQuery = new TBusinessDAL(this.db, this.areaNo).GetQuery(); return(busiAttrQuery .LeftJoin(unitQuery, (m, u) => m.unitSeq == u.unitSeq) .LeftJoin(busiQuery, (m, u, b) => m.busiSeq == b.busiSeq && m.unitSeq == b.unitSeq) .Where((m, u, b) => m.unitSeq == unitSeq && m.busiSeq == busiSeq) .Select((m, u, b) => new { m.ID, m.itemName, m.remark }) .OrderBy(k => k.ID) .ToList()); }
public object GetGridDataByUnitSeq(string unitSeq) { var busiQuery = new TBusinessDAL(this.db, this.areaNo).GetQuery(); var dicType = new FDictionaryDAL(this.db, this.areaNo).GetModelQueryByName(FDictionaryString.AppointmentType); return(busiQuery.LeftJoin(dicType, (m, t) => m.busiType.ToString() == t.Value) .Where((m, t) => m.unitSeq == unitSeq) .Select((m, t) => new { m.unitSeq, m.busiSeq, m.busiCode, m.busiName, busiType = t.Name, acceptBusi = m.acceptBusi ? "是" : "否", getBusi = m.getBusi ? "是" : "否", askBusi = m.askBusi ? "是" : "否" }) .OrderBy(k => k.unitSeq) .ToList()); }
public object GetGridBusiData(int winId) { var unitQuery = new TUnitDAL(this.db, this.areaNo).GetQuery(); var busiQuery = new TBusinessDAL(this.db, this.areaNo).GetQuery(); return(this.GetQuery() .Where(m => m.WindowID == winId) .InnerJoin(unitQuery, (m, u) => m.unitSeq == u.unitSeq) .InnerJoin(busiQuery, (m, u, b) => m.busiSeq == b.busiSeq && m.unitSeq == b.unitSeq) .Select((m, u, b) => new { m.ID, m.WindowID, m.unitSeq, u.unitName, m.busiSeq, b.busiName }) .OrderBy(k => k.unitSeq) .ToList()); }
public ArrayList UploadUnitAndBusy(List <TUnitModel> uList, List <TBusinessModel> bList) { ArrayList arr = null; try { LockAction.Run(LockKey.Upload, () => { var businessList = new TBusinessDAL().GetModelList(); var unitList = new TUnitDAL().GetModelList(); var serchBlist = new List <TBusinessModel>(); //循环接口返回的部门,按照部门获取到业务类型 var insertBlist = new List <TBusinessModel>(); //筛选获取到的业务类型。把需要添加的列表整理出来 var inserUlist = new List <TUnitModel>(); var busyBll = new TBusinessDAL(this.db); foreach (var uSeq in uList) { var unitBusy = bList.Where(b => b.unitSeq == uSeq.unitSeq && b.unitName == uSeq.unitName).ToList(); if (unitBusy != null) { serchBlist.AddRange(unitBusy); } var unit = unitList.Where(b => b.unitSeq == uSeq.unitSeq && b.unitName == uSeq.unitName); if (unit.Count() == 0) { inserUlist.Add(uSeq); } //else // uSeq.orderNum = unit.FirstOrDefault().orderNum; } foreach (var i in serchBlist) { if (businessList.Where(b => b.unitSeq == i.unitSeq && b.unitName == i.unitName && b.busiSeq == i.busiSeq && b.busiName == i.busiName).Count() == 0) { insertBlist.Add(i); } } var deleteBusy = new List <TBusinessModel>(); var deleteUnit = new List <TUnitModel>(); foreach (var busy in businessList) { if (bList.Where(b => b.unitSeq == busy.unitSeq && b.unitName == busy.unitName && b.busiSeq == busy.busiSeq && b.busiName == busy.busiName).Count() == 0) { deleteBusy.Add(busy); } } foreach (var unit in unitList) { if (uList.Where(u => u.unitSeq == unit.unitSeq && u.unitName == unit.unitName).Count() == 0) { deleteUnit.Add(unit); } } foreach (var u in inserUlist) { this.Insert(u); } foreach (var d in deleteUnit) { this.Delete(d); } foreach (var i in insertBlist) { busyBll.Insert(i); } foreach (var d in deleteBusy) { busyBll.Delete(d); } arr = new ArrayList(); arr.Add(uList.OrderBy(o => o.orderNum).ToList()); arr.Add(serchBlist); }); return(arr); } catch (Exception ex) { return(arr); } }