示例#1
0
 public async Task <ActionResult> AddFormula(OutModels.Models.Formula formula)
 {
     try
     {
         FormulaModel am = (FormulaModel)_mapper.Map <OutModels.Models.Formula, FormulaModel>(formula);
         return(new JsonResult(await this._repository.Insert(am)));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
示例#2
0
 public async Task <ActionResult> DeleteFormula(OutModels.Models.Formula attribute)
 {
     try
     {
         int id = attribute.F_Id;
         if (id == 0)
         {
             return(new JsonResult(ResponseModel.Error("موردی یافت نشد")));
         }
         return(new JsonResult(await this._repository.LogicalDelete(id)));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }