Esempio n. 1
0
        public EntityAction Update(WorkCategoryModel entity)
        {
            var          category = rep.Get(entity.Id);
            var          model    = entity.ToWorkCategory(category);
            EntityAction result   = rep.Update(model);

            return(result);
        }
Esempio n. 2
0
        public EntityAction Create(WorkCategoryModel entity)
        {
            //entity.Id = rep.GetNextId();
            var model = entity.ToWorkCategory();

            model.Id = rep.GetNextId();
            EntityAction result = rep.Create(model);

            return(result);
        }
Esempio n. 3
0
        public WorkCategoryModel Get(int id)
        {
            var model = rep.Get(id);

            if (model != null)
            {
                WorkCategoryModel result = new WorkCategoryModel(model);
                return(result);
            }
            return(null);
        }
Esempio n. 4
0
 public WorkCategoryViewModel(WorkCategoryModel model)
 {
     this.Id            = model.Id;
     this.Title         = model.Title;
     this.Description   = model.Description;
     this.CategoryImage = model.CategoryImage;
     this.KeyWord       = model.KeyWord;
     this.ParentId      = model.ParentId;
     this.ParentName    = model.ParentName;
     this.Slug          = model.Slug;
 }