Ejemplo n.º 1
0
        public ActionResult CreateEdit(UExchangeRate exRate, string Action = "")
        {
            if (ModelState.IsValid)
            {
                if (!exRate.Id.Equals(Guid.Empty))
                {
                    exRate._ExchangeRate.CountryProgrammeId = countryProg.Id;
                    if (exchangeRateService.EditExchangeRate(exRate._ExchangeRate))
                    {
                        ModelState.Clear();
                        exRate = new UExchangeRate();
                    }
                }
                else
                {
                    exRate._ExchangeRate.CountryProgrammeId = countryProg.Id;
                    if (exchangeRateService.AddExchangeRate(exRate._ExchangeRate))
                    {
                        ModelState.Clear();
                        exRate = new UExchangeRate();
                    }
                }
            }

            exRate.CurrencySelect = new SelectList(exchangeRateService.CurrencyObj.GetCurrencies(countryProg.Id), "Id", "Name");
            return(ListView());
        }