public ActionResult Bug() { string user_id = HttpContext.User.Identity.Name; BugManager bugManager = new BugManager(int.Parse(user_id)); BPageData data = new BPageData(); int page = 0; int pageSize = 0; int u_id = 0; int feature_id = 0; int total = 0; int status_id = 0; int.TryParse(Request["page"], out page); int.TryParse(Request["pageSize"], out pageSize); int.TryParse(Request["status"], out status_id); int.TryParse(Request["feature"], out feature_id); int.TryParse(Request["user"], out u_id); if (pageSize <= 0) { pageSize = 20; } if (page <= 0) { page = 1; } data.Data = bugManager.SearchBugs(u_id, feature_id, status_id, page, pageSize, out total); data.Page = page; data.TotalRecords = total; data.PageSize = pageSize; data.URL = Request.RawUrl; ViewData["CurrentUser"] = bugManager.CurrentUser; return View(data); }
public PQGridData SearchBugs() { PQGridData data = new PQGridData(); HttpContextBase context = (HttpContextBase)Request.Properties["MS_HttpContext"]; HttpRequestBase request = context.Request; string user_id = User.Identity.Name; BugManager bugManager = new BugManager(int.Parse(user_id)); int page = 0; int pageSize = 0; int u_id = 0; int feature_id = 0; int total = 0; int status_id=0; int.TryParse(request["page"],out page); int.TryParse(request["pageSize"],out pageSize); int.TryParse(request["status"],out status_id); int.TryParse(request["feature"],out feature_id); int.TryParse(request["user"],out u_id); if (pageSize <= 0) { pageSize = 20; } if (page <= 0) { page = 1; } data.data = bugManager.SearchBugs(u_id, feature_id, status_id, page, pageSize, out total); data.curPage = page; data.totalRecords = total; return data; }