public async Task <ActionResult> AddRelation(OutModels.Models.CatAttrRelation relation) { try { CatAttrRelationModel am = (CatAttrRelationModel)_mapper.Map <OutModels.Models.CatAttrRelation, CatAttrRelationModel>(relation); return(new JsonResult(await this._repository.Insert(am))); } catch (Exception ex) { return(null); } }
public async Task <ActionResult> UpdateCatAttr(OutModels.Models.CatAttrRelation attribute) { try { CatAttrRelationModel am = (CatAttrRelationModel)_mapper.Map <OutModels.Models.CatAttrRelation, CatAttrRelationModel>(attribute); return(new JsonResult(await this._repository.Update(am))); } catch (Exception ex) { return(null); } }
public async Task <ActionResult> ActiveCatAttribute(OutModels.Models.CatAttrRelation attribute) { try { int id = attribute.X_Id; if (id == 0) { return(new JsonResult(ResponseModel.Error("موردی یافت نشد"))); } return(new JsonResult(await this._repository.LogicalAvailable(id, true))); } catch (Exception ex) { return(null); } }
public async Task <ActionResult> DeleteCatAttribute(OutModels.Models.CatAttrRelation attribute) { try { int id = attribute.X_Id; if (id == 0) { return(new JsonResult(ResponseModel.Error("موردی یافت نشد"))); } return(new JsonResult(await this._repository.LogicalDelete(id))); } catch (Exception ex) { return(new JsonResult(ResponseModel.ServerInternalError(data: ex))); } }