Beispiel #1
0
 public IActionResult deleteResCates(ResourceCategoryModel obj)
 {
     try
     {
         _commRes.deleteResourceCategory(obj);
         return(Ok());
     }
     catch
     {
         return(BadRequest());
     }
 }
Beispiel #2
0
 public IActionResult setResCateFlg(ResourceCategoryModel obj)
 {
     try
     {
         _commRes.setResourceCategoryEnableFlg(obj.Id, obj.enable_flg);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest());
     }
 }
Beispiel #3
0
 public bool addResourceCategory(ResourceCategoryModel obj)
 {
     try
     {
         var o = new Resource_Category
         {
             user_code           = obj.user_code,
             category_name       = obj.category_name,
             category_decription = obj.category_decription,
             enable_flg          = obj.enable_flg
         };
         _resourceCategoryRepo.insert(o);
         return(true);
     }
     catch (System.Exception)
     {
         return(false);
     }
 }
Beispiel #4
0
 public ResourceCategoryModel getResourceCategory(int id)
 {
     try
     {
         var o   = _resourceCategoryRepo.GetById(id);
         var res = new ResourceCategoryModel
         {
             Id                  = o.Id,
             dateAdded           = o.dateAdded,
             user_code           = o.user_code,
             category_name       = o.category_name,
             category_decription = o.category_decription,
             enable_flg          = o.enable_flg
         };
         return(res);
     }
     catch (System.Exception)
     {
         return(null);
     }
 }
Beispiel #5
0
 public bool editResourceCategory(ResourceCategoryModel obj)
 {
     try
     {
         var o = new Resource_Category
         {
             Id                  = obj.Id,
             dateAdded           = obj.dateAdded,
             user_code           = obj.user_code,
             category_name       = obj.category_name,
             category_decription = obj.category_decription,
             enable_flg          = obj.enable_flg
         };
         _resourceCategoryRepo.update(o);
         _resourceCategoryRepo.save();
         return(true);
     }catch (Exception ex)
     {
         return(false);
     }
 }