Exemple #1
0
        public ActionResult CreateExchangeRate(string Code = "", bool Active = true, string Name = "", float FromAmount = 0, float ToAmount = 0, string Description = "")
        {
            var exchangeRate = exchangeRateRepository.GetByCode(Code) == null ? new OnPointSport.Core.Domain.ExchangeRate() : exchangeRateRepository.GetByCode(Code);

            exchangeRate.Code        = exchangeRate.Id == 0 ? GetCode() : Code;
            exchangeRate.Name        = Name;
            exchangeRate.FromAmount  = FromAmount;
            exchangeRate.ToAmount    = ToAmount;
            exchangeRate.Active      = Active;
            exchangeRate.Description = Description;
            exchangeRateRepository.Save(exchangeRate);
            return(Json(JsonRequestBehavior.AllowGet));
        }