Ejemplo n.º 1
0
 public bool Update(int?Id, SubCategoryParam subCategoryParam)
 {
     if (Id != null && subCategoryParam != null)
     {
         status = _subCategoryRepository.Update(Id, subCategoryParam);
     }
     return(status);
 }
Ejemplo n.º 2
0
 public bool Insert(SubCategoryParam subCategoryParam)
 {
     if (subCategoryParam != null)
     {
         status = _subCategoryRepository.Insert(subCategoryParam);
     }
     return(status);
 }
Ejemplo n.º 3
0
        public bool Update(int?Id, SubCategoryParam subCategoryParam)
        {
            var result      = 0;
            var SubCategory = Get(Id);

            SubCategory.Name       = subCategoryParam.Name;
            SubCategory.Categories = myContext.Categories.Find(subCategoryParam.Categories);
            SubCategory.UpdateDate = DateTimeOffset.UtcNow.LocalDateTime;
            result = myContext.SaveChanges();
            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
Ejemplo n.º 4
0
        public bool Insert(SubCategoryParam subCategoryParam)
        {
            var result = 0;

            subCategory.Name       = subCategoryParam.Name;
            subCategory.Categories = myContext.Categories.Find(subCategoryParam.Categories);
            subCategory.CreateDate = DateTimeOffset.UtcNow.LocalDateTime;
            myContext.SubCategories.Add(subCategory);
            result = myContext.SaveChanges();
            if (result > 0)
            {
                status = true;
            }
            return(status);
        }
 // PUT: api/SubCategories/5
 public void Put(int id, SubCategoryParam subCategoryParam)
 {
     _subCategoryService.Update(id, subCategoryParam);
 }
 // POST: api/SubCategories
 public void Post(SubCategoryParam subCategoryParam)
 {
     _subCategoryService.Insert(subCategoryParam);
 }