public virtual TEntity CreateMasterFile(MasterfileParameter parameters, Action <TViewModel> advanceMapping = null) { var viewModel = MapFromClientParameters(parameters); var entity = viewModel.MapTo <TEntity>(); var savedEntity = MasterFileService.Add(entity); return(savedEntity); }
protected virtual TVModel MapFromClientParameters <TVModel>(MasterfileParameter parameters, Action <TVModel> advanceMapping = null) where TVModel : DtoBase, new() { var viewModel = new TVModel(); //viewModel.ProcessFromClientParameters(parameters); if (advanceMapping != null) { advanceMapping(viewModel); } return(viewModel); }
public virtual JsonResult UpdateMasterFile(MasterfileParameter parameters, Action <TViewModel> advanceMapping = null) { var viewModel = MapFromClientParameters(parameters); if (advanceMapping != null) { advanceMapping.Invoke(viewModel); } byte[] lastModified = null; if (ModelState.IsValid) { var entity = MasterFileService.GetById(viewModel.SharedViewModel.Id); var mappedEntity = viewModel.MapPropertiesToInstance(entity); lastModified = MasterFileService.Update(mappedEntity).LastModified; } return(Json(new { Error = string.Empty, Data = new { LastModified = lastModified } }, JsonRequestBehavior.AllowGet)); }
public override void MapFromClientParameters(MasterfileParameter parameters) { SharedViewModel = MapFromClientParameters <DashboardModuleDocumentTypeOperationShareViewModel>(parameters); }
public override void MapFromClientParameters(MasterfileParameter parameters) { SharedViewModel = MapFromClientParameters <DashboardStateShareViewModel>(parameters); }
public override void MapFromClientParameters(MasterfileParameter parameters) { SharedViewModel = MapFromClientParameters <DashboardFranchiseeTenantShareViewModel>(parameters); }
protected virtual TViewModel MapFromClientParameters(MasterfileParameter parameters, Action <TViewModel> advanceMapping = null) { return(MapFromClientParameters <TViewModel>(parameters, advanceMapping)); }
public override void MapFromClientParameters(MasterfileParameter parameters) { SharedViewModel = MapFromClientParameters <DashboardCountryOrRegionShareViewModel>(parameters); }
public override void MapFromClientParameters(MasterfileParameter parameters) { SharedViewModel = MapFromClientParameters <DashboardSystemConfigurationShareViewModel>(parameters); }