public JsonResult AJXSearchRecipients() { int storeID = Session[Constant.SessionStoreID] != null?int.Parse(Session[Constant.SessionStoreID].ToString()) : -1; string keyword = Request.Form["SearchKeyword"].ToString().Length < 1 ? null : Request.Form["SearchKeyword"]; int searchType = Request.Form["SearchType"] != null?int.Parse(Request.Form["SearchType"]) : -1; var isActive = Request.Form["IsActive"] == "on"; int pageSize = int.Parse(ConfigurationManager.AppSettings["PageSize"]); PagedList.IPagedList result = null; int ddlStore = -1; if (!String.IsNullOrEmpty(Request.Form["ddlStore"]) && !Libs.IsStore()) { ddlStore = Request.Form["ddlStore"] != null?int.Parse(Request.Form["ddlStore"]) : -1; } if (Libs.IsStore()) { ddlStore = storeID; } if (Libs.IsAdmin()) { result = _storeService.GetListRecieverByStoreID(1, pageSize, ddlStore, keyword, searchType, isActive); } else { result = _storeService.GetListRecieverByStoreID(1, pageSize, ddlStore, keyword, searchType, isActive); } return(Json(RenderPartialViewToString("_RecieverGrid", result), JsonRequestBehavior.AllowGet)); }
public ActionResult LoadListStore() { List <tblStoreAccount> lstStoreAccount; if (Libs.IsAdmin() || Libs.IsCSKH()) { lstStoreAccount = _storeService.LoadListStore(); } else { var storeAccount = GetStoreAccountInfo(); lstStoreAccount = new List <tblStoreAccount> { storeAccount }; } return(Json(lstStoreAccount)); }
public PartialViewResult _RecieverGrid(int?page) { int storeID = Session[Constant.SessionStoreID] != null?int.Parse(Session[Constant.SessionStoreID].ToString()) : -1; int pageSize = int.Parse(ConfigurationManager.AppSettings["PageSize"]); int pageIndex = page != null?int.Parse(page.ToString()) : 1; PagedList.IPagedList lsReciever = null; if (Libs.IsAdmin()) { lsReciever = _storeService.GetListRecieverByStoreID(pageIndex, pageSize, -1, null, -1); } else { lsReciever = _storeService.GetListRecieverByStoreID(pageIndex, pageSize, storeID, null, -1); } ViewBag.Index = pageSize * (pageIndex - 1) + 1; return(PartialView(lsReciever)); }