/// <summary> /// 根据页面传进来的每页数据行数加載出最大页数 /// </summary> public void GetMaxPage(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { OleExec sfcdb = null; T_c_user LoadUsetInfo; List <c_user_model> LoadUsetInfolsit = new List <c_user_model>(); string r = Data["PageRow"].ToString() == "" ? "10" : Data["PageRow"].ToString(); string emp_no = Data["Emp_No"].ToString(); int PageRow = Convert.ToInt32(r == "0" ? "10" : r); int MaxPage; try { sfcdb = this.DBPools["SFCDB"].Borrow(); LoadUsetInfo = new T_c_user(sfcdb, DBTYPE); MaxPage = LoadUsetInfo.CheckMaxPage(PageRow, emp_no, sfcdb); StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.Message = "获取页数成功"; StationReturn.Data = MaxPage; this.DBPools["SFCDB"].Return(sfcdb); } catch (Exception e) { this.DBPools["SFCDB"].Return(sfcdb); throw e; } }
/// <summary> /// 加載所有用戶列表 /// </summary> public void LoadInformation(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn) { OleExec sfcdb = null; T_c_user LoadUsetInfo; List <c_user_model> LoadUsetInfolsit = new List <c_user_model>(); string r = Data["PageRow"].ToString() == "" ? "10" : Data["PageRow"].ToString(); string i = Data["PageCount"].ToString() == "" ? "1" : Data["PageCount"].ToString(); int PageRow = Convert.ToInt32(r == "0" ? "10" : r); int PageCount = Convert.ToInt32(i == "0" ? "1" : i); string emp_no = Data["emp_no"].ToString();//需要查询人的工号 int MaxPage; try { sfcdb = this.DBPools["SFCDB"].Borrow(); LoadUsetInfo = new T_c_user(sfcdb, DBTYPE); MaxPage = LoadUsetInfo.CheckMaxPage(PageRow, emp_no, sfcdb); if (MaxPage >= PageCount) { LoadUsetInfolsit = LoadUsetInfo.SelectUserInfo(PageRow, PageCount, emp_no, this.LoginUser.EMP_LEVEL, this.LoginUser.DPT_NAME, this.LoginUser.EMP_NO, this.LoginUser.FACTORY, this.LoginUser.BU, sfcdb); StationReturn.Status = StationReturnStatusValue.Pass; StationReturn.MessageCode = "MES00000017"; StationReturn.Data = LoadUsetInfolsit; this.DBPools["SFCDB"].Return(sfcdb); } else { StationReturn.Status = StationReturnStatusValue.Fail; StationReturn.MessageCode = "MES00000018"; StationReturn.MessagePara.Add(PageCount); StationReturn.MessagePara.Add(MaxPage); this.DBPools["SFCDB"].Return(sfcdb); } } catch (Exception e) { this.DBPools["SFCDB"].Return(sfcdb); throw e; } }