Example #1
0
        //CRUD

        public override ProcessResult Delete(int id)
        {
            try
            {
                _repository.Delete(id);
                return(ServiceResultsHelper.FillProcessResult(null));
            }
            catch (Exception ex)
            {
                return(ServiceResultsHelper.FillProcessResultForError(ex));
            }
        }
Example #2
0
        public ProcessResult DelteUser(CPMUserBM user)
        {
            try
            {
                _repo.DeleteRecord(Mapper.Map <CPMUserEntity>(user));

                return(ServiceResultsHelper.FillProcessResult());
            }
            catch (Exception ex)
            {
                return(ServiceResultsHelper.FillProcessResultForError(ex));
            }
        }
Example #3
0
 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));
     }
 }
Example #4
0
        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));
            }
        }