Ejemplo n.º 1
0
        //CRUD

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

                return(ServiceResultsHelper.FillProcessResult());
            }
            catch (Exception ex)
            {
                return(ServiceResultsHelper.FillProcessResultForError(ex));
            }
        }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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));
            }
        }