public JsonResult GetList(string CurUser, int page, int pageSize, int Status = 9999, int myList = 0) { T_User MOD_User = db.T_User.FirstOrDefault(a => a.Nickname == CurUser); //真名 string name = MOD_User.Name; IQueryable <T_Generalize> queryData = db.T_Generalize.Where(s => s.IsDelete != 1 && s.Status == 2).AsQueryable(); //分页 queryData = queryData.OrderByDescending(c => c.ID).Skip((page - 1) * pageSize).Take(pageSize); List <resultItem> list = new List <resultItem>(); foreach (var item in queryData) { resultItem i = new resultItem(); i.uid = item.ID; string str = item.StoreName; if (str == null) { str = ""; } if (str.Length >= 9) { str = str.Substring(0, 9) + "..."; } i.subTitle = "店铺名称:" + str; i.title = "申请人:" + item.UploadName; i.remark = int.Parse(item.IsDispose.ToString()); list.Add(i); } string json = "{\"lists\":" + JsonConvert.SerializeObject(list, Lib.Comm.setTimeFormat()) + "}"; return(Json(json, JsonRequestBehavior.AllowGet)); }
public JsonResult GetList(string CurUser, int page, int pageSize, int Status = 9999, int myList = 0) { T_User MOD_User = db.T_User.FirstOrDefault(a => a.Nickname == CurUser); //真名 string name = MOD_User.Name; List <T_FreezeApprove> ApproveMod = new List <T_FreezeApprove>(); if (Status == 9999) { ApproveMod = db.T_FreezeApprove.Where(a => a.ApproveName == name).ToList(); } else { ApproveMod = db.T_FreezeApprove.Where(a => a.ApproveName == name && a.ApproveStatus == Status).ToList(); } int[] Arry = new int[ApproveMod.Count]; for (int i = 0; i < ApproveMod.Count; i++) { Arry[i] = int.Parse(ApproveMod[i].freezeID.ToString()); } IQueryable <T_Freeze> queryData = null; //myList 我申请的? 0 否 1是 if (myList == 0) { queryData = from r in db.T_Freeze where Arry.Contains(r.ID) && r.isDelete == 0 && r.state != 3 select r; } else { queryData = from r in db.T_Freeze where r.isDelete == 0 && r.userName == CurUser && r.state != 3 select r; } //pager.totalRows = queryData.Count(); //分页 queryData = queryData.OrderByDescending(c => c.ID).Skip((page - 1) * pageSize).Take(pageSize); List <resultItem> list = new List <resultItem>(); foreach (var item in queryData) { resultItem i = new resultItem(); i.uid = item.ID; string str = item.shopName; if (str == null) { str = ""; } if (str.Length >= 9) { str = str.Substring(0, 9) + "..."; } i.subTitle = "店铺名称:" + str; i.title = "申请人:" + item.userName; i.remark = int.Parse(item.state.ToString()); list.Add(i); } string json = "{\"lists\":" + JsonConvert.SerializeObject(list, Lib.Comm.setTimeFormat()) + "}"; return(Json(json, JsonRequestBehavior.AllowGet)); }
//列表 public JsonResult GetList(string CurUser, int page, int pageSize, int Status = 9999, int myList = 0) { T_User MOD_User = db.T_User.FirstOrDefault(a => a.Nickname == CurUser); //真名 string name = MOD_User.Name; List <T_ReissueApprove> ApproveMod = new List <T_ReissueApprove>(); string sql = "select * from T_ReissueApprove where (ApproveUser='******' or ApproveName='" + CurUser + "' or ApproveName in (select GroupName from T_ReissueGroup where GroupUser in ('" + CurUser + "') ))"; if (Status == 9999) { // ApproveMod = db.T_ExchangeCenterApprove.Where(a => a.ApproveName == CurUser||a.ApproveUser==CurUser).ToList(); ApproveMod = db.Database.SqlQuery <T_ReissueApprove>(sql).ToList(); } else { // ApproveMod = db.T_ExchangeCenterApprove.Where(a => (a.ApproveName == CurUser || a.ApproveUser == CurUser) && a.ApproveStatus == Status).ToList(); sql += " and ApproveStatus='" + Status + "'"; ApproveMod = db.Database.SqlQuery <T_ReissueApprove>(sql).ToList(); } int[] Arry = new int[ApproveMod.Count]; for (int i = 0; i < ApproveMod.Count; i++) { Arry[i] = int.Parse(ApproveMod[i].Pid.ToString()); } IQueryable <T_Reissue> queryData = null; //myList 我申请的? 0 否 1是 if (myList == 0) { queryData = from r in db.T_Reissue where Arry.Contains(r.ID) && r.IsDelete == 0 select r; } else { queryData = from r in db.T_Reissue where r.IsDelete == 0 && r.PostUser == CurUser select r; } //pager.totalRows = queryData.Count(); //分页 queryData = queryData.OrderByDescending(c => c.ID).Skip((page - 1) * pageSize).Take(pageSize); List <resultItem> list = new List <resultItem>(); foreach (var item in queryData) { resultItem i = new resultItem(); i.uid = item.ID; string str = item.StoreName; if (str == null) { str = ""; } if (str.Length >= 22) { str = str.Substring(0, 22) + "..."; } i.subTitle = "店铺名称:" + str; i.title = "申请人:" + item.PostUser; i.remark = int.Parse(item.Status.ToString()); list.Add(i); } string json = "{\"lists\":" + JsonConvert.SerializeObject(list, Lib.Comm.setTimeFormat()) + "}"; return(Json(json, JsonRequestBehavior.AllowGet)); }
//列表 public JsonResult GetList(string CurUser, int page, int pageSize, string queryStr, int Status = -1, int myList = 0) { T_User MOD_User = db.T_User.FirstOrDefault(a => a.Nickname == CurUser); //真名 string name = MOD_User.Name; List <T_ExpenseApprove> ApproveMod = new List <T_ExpenseApprove>(); if (Status == 9999) { ApproveMod = db.T_ExpenseApprove.Where(a => a.ApproveName == CurUser).ToList(); } else { ApproveMod = db.T_ExpenseApprove.Where(a => a.ApproveName == CurUser && a.ApproveStatus == Status).ToList(); } int[] Arry = new int[ApproveMod.Count]; for (int i = 0; i < ApproveMod.Count; i++) { Arry[i] = int.Parse(ApproveMod[i].Reunbursement_id.ToString()); } IQueryable <T_Expense> queryData = null; //myList 我申请的? 0 否 1是 if (myList == 0) { queryData = from r in db.T_Expense where Arry.Contains(r.ID) && r.IsDelete == 0 && r.Status != 3 select r; } else { queryData = from r in db.T_Expense where r.IsDelete == 0 && r.PostUser == CurUser && r.Status != 3 select r; } if (!string.IsNullOrEmpty(queryStr)) { queryData = queryData.Where(a => a.PostUser.Contains(queryStr) || a.Reun_Code.Contains(queryStr)); } int ccc = queryData.Count(); //分页 queryData = queryData.OrderByDescending(c => c.ID).Skip((page - 1) * pageSize).Take(pageSize); List <resultItem> list = new List <resultItem>(); foreach (var item in queryData) { resultItem i = new resultItem(); i.uid = item.ID; string str = item.Reun_Code; if (str == null) { str = ""; } if (str.Length >= 22) { str = str.Substring(0, 22) + "..."; } i.subTitle = "编码:" + str; i.title = "申请人:" + item.PostUser; i.remark = int.Parse(item.Status.ToString()); list.Add(i); } string json = "{\"lists\":" + JsonConvert.SerializeObject(list, Lib.Comm.setTimeFormat()) + "}"; return(Json(json, JsonRequestBehavior.AllowGet)); }