private MaterialDetailViewModel InitDetailModel(MaterialDetailViewModel model) { model.MainMenu = _mainMenu; model.CurrentMenu = PageInfo; return(model); }
// // GET: /Material/Details/5 public ActionResult Details(string mn, string p) { var model = new MaterialDetailViewModel(); model.MainMenu = _mainMenu; model.CurrentMenu = PageInfo; var data = _materialBll.getByID(mn, p); //Mapper.Map(data,model); model = Mapper.Map <MaterialDetailViewModel>(data); model.ChangesHistoryList = Mapper.Map <List <ChangesHistoryItemModel> >(_changesHistoryBll.GetByFormTypeAndFormId(Enums.MenuList.MaterialMaster, mn + p)); model.ConversionValueStr = model.Conversion == null ? string.Empty : model.Conversion.ToString(); model.HjeStr = model.Hje == null ? string.Empty : model.Hje.ToString(); model.TariffStr = model.Tariff == null ? string.Empty : model.Tariff.ToString(); model = InitDetailModel(model); if (model.IsDeleted.HasValue && model.IsDeleted.Value) { model.IsAllowDelete = false; } else { if (model.IsFromSap.HasValue && model.IsFromSap.Value) { model.IsAllowDelete = false; } else { model.IsAllowDelete = true; } } return(View("Details", model)); }
public DetailSource(MaterialDetailViewController viewController) { this.viewController = viewController; viewModel = viewController.ViewModel; }