Exemple #1
0
        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);
        }
Exemple #2
0
 public ActionResult SearchMaterialType(SM_MaterialType mdl)
 {
     if (string.IsNullOrEmpty(mdl.MaterialTypeName))
     {
         mdl.MaterialTypeID = 0;
     }
     return(RedirectToAction("MaterialTypeList", mdl));
 }
Exemple #3
0
        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);
        }
Exemple #4
0
        // 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"));
            }
        }