コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 public override void MapFromClientParameters(MasterfileParameter parameters)
 {
     SharedViewModel = MapFromClientParameters <DashboardModuleDocumentTypeOperationShareViewModel>(parameters);
 }
コード例 #5
0
 public override void MapFromClientParameters(MasterfileParameter parameters)
 {
     SharedViewModel = MapFromClientParameters <DashboardStateShareViewModel>(parameters);
 }
コード例 #6
0
 public override void MapFromClientParameters(MasterfileParameter parameters)
 {
     SharedViewModel = MapFromClientParameters <DashboardFranchiseeTenantShareViewModel>(parameters);
 }
コード例 #7
0
 protected virtual TViewModel MapFromClientParameters(MasterfileParameter parameters, Action <TViewModel> advanceMapping = null)
 {
     return(MapFromClientParameters <TViewModel>(parameters, advanceMapping));
 }
コード例 #8
0
 public override void MapFromClientParameters(MasterfileParameter parameters)
 {
     SharedViewModel = MapFromClientParameters <DashboardCountryOrRegionShareViewModel>(parameters);
 }
コード例 #9
0
 public override void MapFromClientParameters(MasterfileParameter parameters)
 {
     SharedViewModel = MapFromClientParameters <DashboardSystemConfigurationShareViewModel>(parameters);
 }