Example #1
0
        public ActionResult Add()
        {
            MstComponentVM model = new MstComponentVM();

            model.CategoryDDList = dalcategory.GetCategoryDD();
            return(View(model));
        }
Example #2
0
        public ActionResult Edit(long id)
        {
            MstComponentVM model = new MstComponentVM();

            model.ComponentModel = objcomp.GetComponentByID(id);
            model.CategoryDDList = dalcategory.GetCategoryDD();
            return(View(model));
        }
Example #3
0
        // GET: Admin/Component
        public ActionResult Index(int PageNo = 1, int PageSize = 10, string searchTerm = "")
        {
            int            TotalRecords = 0;
            MstComponentVM model        = new MstComponentVM();

            model.ComponentList = objcomp.GetComponentPaged(PageNo, PageSize, searchTerm, out TotalRecords);
            model.PagingInfo    = new PagingInfo {
                CurrentPage = PageNo, ItemsPerPage = PageSize, TotalItems = TotalRecords
            };
            if (Request.IsAjaxRequest())
            {
                return(PartialView("_pvComponentList", model));
            }
            return(View(model));
        }
Example #4
0
 public ActionResult Add(MstComponentVM model)
 {
     if (ModelState.IsValid)
     {
         model.ComponentModel.UserID = User.Identity.Name;
         string result = objcomp.SaveComponent(model.ComponentModel);
         if (result.Contains("Success"))
         {
             objSite.AddAuditLog("utblMstComponents", "New Component Added", IPAddressGetter.GetIPAddress(), User.Identity.Name);
             TempData["ErrMsg"] = result;
             return(RedirectToAction("index", "component", new { Area = "Admin" }));
         }
         TempData["ErrMsg"] = result;
     }
     model.CategoryDDList = dalcategory.GetCategoryDD();
     return(View(model));
 }