public Int32 UpdateStorePaymentMethod(StorePaymentMethodObject storePaymentMethod) { try { if (storePaymentMethod == null) { return(-2); } if (_repository.Count(m => m.Name.Trim().ToLower() == storePaymentMethod.Name.Trim().ToLower() && (m.StorePaymentMethodId != storePaymentMethod.StorePaymentMethodId)) > 0) { return(-3); } var storePaymentMethodEntity = ModelCrossMapper.Map <StorePaymentMethodObject, StorePaymentMethod>(storePaymentMethod); if (storePaymentMethodEntity == null || storePaymentMethodEntity.StorePaymentMethodId < 1) { return(-2); } _repository.Update(storePaymentMethodEntity); _uoWork.SaveChanges(); return(5); } catch (Exception ex) { ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message); return(-2); } }
public long AddStorePaymentMethod(StorePaymentMethodObject storePaymentMethod) { try { if (storePaymentMethod == null) { return(-2); } if (_repository.Count(m => m.Name.Trim().ToLower() == storePaymentMethod.Name.Trim().ToLower()) > 0) { return(-3); } var storePaymentMethodEntity = ModelCrossMapper.Map <StorePaymentMethodObject, StorePaymentMethod>(storePaymentMethod); if (storePaymentMethodEntity == null || string.IsNullOrEmpty(storePaymentMethodEntity.Name)) { return(-2); } var returnStatus = _repository.Add(storePaymentMethodEntity); _uoWork.SaveChanges(); return(returnStatus.StorePaymentMethodId); } catch (Exception ex) { ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message); return(0); } }
public int UpdateStorePaymentMethod(StorePaymentMethodObject paymentMethod) { try { return(_paymentMethodRepository.UpdateStorePaymentMethod(paymentMethod)); } catch (Exception ex) { ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message); return(-2); } }