Example #1
0
 public async Task <ActionResult> UpdateColor(OutModels.Models.Color color)
 {
     try
     {
         ColorModel cm = (ColorModel)_mapper.Map <OutModels.Models.Color, ColorModel>(color);
         return(new JsonResult(await this._repository.Update(cm)));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Example #2
0
 public async Task <ActionResult> DeleteColor(OutModels.Models.Color color)
 {
     try
     {
         int id = color.C_Id;
         if (id == 0)
         {
             return(new JsonResult(ResponseModel.Error("موردی یافت نشد")));
         }
         return(new JsonResult(await this._repository.LogicalDelete(id)));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }