Exemple #1
0
 /// <see cref="IPersonService.SaveDescriptionSchema"/>
 public bool SaveDescriptionSchema(int id, PageBlockModel model, int parsonId)
 {
     return(_personRepository.SaveDescriptionSchema(id,
                                                    PageModelHelper.GetPageBlock(model), model.UserPageCategoryId != null ?
                                                    new UserPageCategory
     {
         Id = model.UserPageCategoryId ?? 0,
         Name = model.UserPageCategory
     } : null, parsonId));
 }
Exemple #2
0
        public IHttpActionResult SaveDescriptionSchema(int id, int pesonId, [FromBody] PageBlockModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var error  = ServiceResponce.FromFailed().Result($"Error save schema");
            var succes = ServiceResponce.FromSuccess().Result("Schema save complete");

            return(Ok(_personService.SaveDescriptionSchema(id, model, pesonId) ? succes.Response() : error.Response()));
        }
Exemple #3
0
 public static PageBlock GetPageBlock(PageBlockModel model)
 {
     return model != null ? new PageBlock
     {
         Id = model.Id,
         IdBlockType = model.Type?.Id,
         IdPage = model.IdPage,
         Name = model.Name,
         Page = GetPage(model.Page)
     }
     : null;
 }