//CRUD public override ProcessResult Delete(int id) { try { _repository.Delete(id); return(ServiceResultsHelper.FillProcessResult(null)); } catch (Exception ex) { return(ServiceResultsHelper.FillProcessResultForError(ex)); } }
public ProcessResult DelteUser(CPMUserBM user) { try { _repo.DeleteRecord(Mapper.Map <CPMUserEntity>(user)); return(ServiceResultsHelper.FillProcessResult()); } catch (Exception ex) { return(ServiceResultsHelper.FillProcessResultForError(ex)); } }
public override ProcessResult Save(OfferBM item) { try { //Validation can be inserted here if (item.IsNew) { _repository.Insert(Mapper.Map <OfferDM>(item)); } else { _repository.Update(Mapper.Map <OfferDM>(item)); } return(ServiceResultsHelper.FillProcessResult(_validator.Validations)); } catch (Exception ex) { return(ServiceResultsHelper.FillProcessResultForError(ex)); } }
public override ProcessResult Save(CurrencyBM item) { try { //validation optional if (item.IsNew) { _repository.Insert(Mapper.Map <CurrencyDM>(item)); } else { _repository.Update(Mapper.Map <CurrencyDM>(item)); } return(ServiceResultsHelper.FillProcessResult(_validator.Validations)); } catch (Exception ex) { return(ServiceResultsHelper.FillProcessResultForError(ex)); } }