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());
        }
Beispiel #2
0
        public object RS_GetUserListByWindowNo(string winNum)
        {
            var winBusiQuery = new TWindowBusinessDAL(this.db, this.areaNo).GetQuery();
            var winQuery     = this.GetQuery();
            var userQuery    = new TUserDAL(this.db, this.areaNo).GetQuery();
            var unitQuery    = new TUnitDAL(this.db, this.areaNo).GetQuery();

            return(winBusiQuery
                   .InnerJoin(winQuery, (m, w) => m.WindowID == w.ID)
                   .Where((m, w) => w.Number == winNum)
                   .Select((m, w) => m)
                   .GroupBy(k => k.unitSeq)
                   .Select(s => s.unitSeq)
                   .InnerJoin(userQuery, (s, user) => s == user.unitSeq)
                   .InnerJoin(unitQuery, (s, user, unit) => s == unit.unitSeq)
                   .Select((s, user, unit) => new
            {
                UserCode = user.Code,
                UserName = user.Name,
                UnitSeq = unit.unitSeq,
                UnitName = unit.unitName,
                State = user.State
            })
                   .OrderBy(k => k.UserCode)
                   .ToList());
        }
Beispiel #3
0
        public object GetGridData()
        {
            var dicType   = new FDictionaryDAL(this.db, this.areaNo).GetModelQueryByName(FDictionaryString.AppointmentType);
            var unitQuery = new TUnitDAL(this.db, this.areaNo).GetQuery();

            return(this.GetQuery()
                   .LeftJoin(dicType, (m, t) => m.busiType.ToString() == t.Value)
                   .LeftJoin(unitQuery, (m, t, u) => m.unitSeq == u.unitSeq)
                   .Select((m, t, u) => new
            {
                m.ID,
                u.unitName,
                m.unitSeq,
                m.busiSeq,
                m.busiCode,
                m.busiName,
                busiType = t.Name,
                acceptBusi = m.acceptBusi ? "是" : "否",
                getBusi = m.getBusi ? "是" : "否",
                askBusi = m.askBusi ? "是" : "否",
                Model = m
            })
                   .OrderBy(k => k.ID)
                   .ToList());
        }
        public object GetGridData()
        {
            var unitQuery = new TUnitDAL(this.db, this.areaNo).GetQuery();

            return(this.GetQuery()
                   .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());
        }
Beispiel #5
0
        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 })
                   .InnerJoin(unitQuery, (b, u) => b.unitSeq == u.unitSeq)
                   .Select((b, u) => u)
                   .OrderBy(k => k.unitSeq)
                   .ToList());
        }
Beispiel #6
0
        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 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());
        }
Beispiel #8
0
        public object GetGridData()
        {
            var dicState  = new FDictionaryDAL(this.db, this.areaNo).GetModelQueryByName(FDictionaryString.WorkState);
            var dicSex    = new FDictionaryDAL(this.db, this.areaNo).GetModelQueryByName(FDictionaryString.UserSex);
            var unitQuery = new TUnitDAL(this.db, this.areaNo).GetQuery();

            return(this.GetQuery()
                   .LeftJoin(dicState, (u, d) => u.State == d.Value)
                   .LeftJoin(dicSex, (u, d, s) => u.Sex == s.Value)
                   .LeftJoin(unitQuery, (u, d, s, u2) => u.unitSeq == u2.unitSeq)
                   .Select((u, d, s, u2) => new
            {
                u.ID,
                u.Code,
                u.Name,
                u2.unitName,
                Sex = s.Name,
                State = d.Name,
                u.Remark
            })
                   .OrderBy(k => k.ID).ToList());
        }
Beispiel #9
0
        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);
            }
        }