public ActionResult Index() { var data = _penaltyBLL.GetPenalty(); var model = new PenaltyModel(); model.Details = Mapper.Map <List <PenaltyItem> >(data); foreach (var item in model.Details) { var Vendor = _vendorBLL.GetByID(item.Vendor); if (Vendor != null) { item.VendorName = Vendor.VendorName; } } model.MainMenu = _mainMenu; model.CurrentLogin = CurrentUser; model.CurrentPageAccess = CurrentPageAccess; if (CurrentUser.UserRole == Enums.UserRole.Viewer) { model.IsShowNewButton = false; model.IsNotViewer = false; } else { model.IsShowNewButton = true; model.IsNotViewer = true; } return(View(model)); }
public ActionResult Index() { var data = _priceListBLL.GetPriceList(); var model = new PriceListModel(); model.Details = Mapper.Map <List <PriceListItem> >(data); foreach (PriceListItem detail in model.Details) { detail.VendorName = _vendorBLL.GetByID(detail.Vendor) == null ? string.Empty : _vendorBLL.GetByID(detail.Vendor).VendorName; } model.MainMenu = _mainMenu; model.CurrentLogin = CurrentUser; model.CurrentPageAccess = CurrentPageAccess; if (CurrentUser.UserRole == Enums.UserRole.Viewer) { model.IsShowNewButton = false; model.IsNotViewer = false; } else { model.IsShowNewButton = true; model.IsNotViewer = true; } return(View(model)); }
public ActionResult Edit(int?MstVendorid) { if (!MstVendorid.HasValue) { return(HttpNotFound()); } var data = _vendorBLL.GetByID(MstVendorid.Value); var model = new VendorItem(); model = Mapper.Map <VendorItem>(data); model.MainMenu = _mainMenu; model.CurrentLogin = CurrentUser; model.ChangesLogs = GetChangesHistory((int)Enums.MenuList.MasterVendor, MstVendorid.Value); return(View(model)); }