public JsonResult loadPollDetails(string JsonData, int Operation, int OffSet, int RowCount) { NuPortalDBService.NuPortalService dbService = new NuPortalDBService.NuPortalService(); dbService.Url = Constants.DBService; try { string jsonString = dbService.GetFilterForGrid(JsonData, Convert.ToInt32(Session["CompanyId"]), OffSet, RowCount, Operation); if (jsonString != string.Empty) { return(Json(jsonString, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; return(Json(Common_Library.Constants.JsonError)); } finally { dbService = null; } return(Json(Common_Library.Constants.JsonError)); }
public JsonResult GetGridData(string jsonData, int Operation, int ProjId, int TypeId, int OffSet, int RowCount) { NuPortalDBService.NuPortalService Dbservice = new NuPortalDBService.NuPortalService(); Dbservice.Url = Constants.DBService; try { int SessionValue = 0; string jsonString = string.Empty; if (TypeId == 0) { SessionValue = ProjId; } else if (TypeId == 1) { SessionValue = Convert.ToInt32(Session["CompanyId"]); } else if (TypeId == 2) { SessionValue = Convert.ToInt32(Session["EmpId"]); } else if (TypeId == 3) { SessionValue = ProjId; } jsonString = Dbservice.GetFilterForGrid(jsonData, SessionValue, OffSet, RowCount, Operation); //change value of offset as per pagination case if (jsonString != string.Empty) { return(Json(jsonString, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { GeneralFunctions genFun = new GeneralFunctions(); genFun.LogError(ControllerContext.HttpContext, ex.Message, ex.TargetSite.Name, Convert.ToString(ControllerContext.RouteData.Values["action"]), Convert.ToString(ControllerContext.RouteData.Values["controller"])); genFun = null; return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); } finally { Dbservice = null; } return(Json(Common_Library.Constants.JsonError, JsonRequestBehavior.AllowGet)); }