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()); }
public object RS_GetModel(string winNum, string userCode) { var winBusiQuery = new TWindowBusinessDAL(this.db, this.areaNo).GetQuery(); var userQuery = new TUserDAL(this.db, this.areaNo).GetQuery(); return(winBusiQuery .InnerJoin(this.GetQuery(), (m, w) => m.WindowID == w.ID) .InnerJoin(userQuery, (m, w, u) => m.unitSeq == u.unitSeq) .Where((m, w, u) => w.Number == winNum && u.Code == userCode) .Select((m, w, u) => u).FirstOrDefault()); }
public string RS_GetUserPhoto(string userCode) { var userQuery = new TUserDAL(this.db, this.areaNo).GetQuery(); var user = userQuery.Where(p => p.Code == userCode).FirstOrDefault(); if (user != null) { if (user.Photo != null) { return(Convert.ToBase64String(user.Photo)); } } return(""); }
public object GetGridUserData(int winId) { var userQuery = new TUserDAL(this.db, this.areaNo).GetQuery(); return(this.GetQuery() .Where(m => m.WindowID == winId) .GroupBy(k => k.unitSeq) .Select(s => new { s.ID, s.unitSeq }) .InnerJoin(userQuery, (m, u) => m.unitSeq == u.unitSeq) .Select((m, u) => new { ID = m.ID, UserID = u.ID, UserName = u.Name }) .OrderBy(k => k.UserID) .ToList()); }