public List <MaterialType> GetMaterialTypes_Filters(SM_MaterialType searchData) { List <MaterialType> list = this.GetAllMaterialTypes(); list = list.Where(a => (searchData.MaterialTypeID > 0) ? a.ID == searchData.MaterialTypeID : true).ToList(); list = list.ToPagedList(searchData.CurrentPage++, CommonClass.PageSize).ToList(); return(list); }
public ActionResult SearchMaterialType(SM_MaterialType mdl) { if (string.IsNullOrEmpty(mdl.MaterialTypeName)) { mdl.MaterialTypeID = 0; } return(RedirectToAction("MaterialTypeList", mdl)); }
public int GetAllMaterialTypeCount(SM_MaterialType searchData) { int Count = 0; List <MaterialType> list = this.GetAllMaterialTypes(); list = list.Where(a => (searchData.MaterialTypeID > 0) ? a.ID == searchData.MaterialTypeID : true).ToList(); Count = list.Count; return(Count); }
// GET: MaterialType public ActionResult MaterialTypeList(SM_MaterialType data) { if (Session["UserInfo"] != null) { SystemUser userInfo = (SystemUser)Session["UserInfo"]; ViewBag.SystemUserType = userInfo.SystemUserType; data.TotalPage = cs.TotalPage(da.GetAllMaterialTypeCount(data)); data.TotalCount = da.GetAllMaterialTypeCount(data); data.CurrentPage = 1; ViewBag.ActivePageID = "PageMaterialType"; return(View("MaterialTypeList", data)); } else { return(RedirectToAction("SessionTimeOut", "Error")); } }