public ActionResult CreateEdit(UCurrency currency, string Action) { if (ModelState.IsValid) { if (!currency._Currency.Id.Equals(Guid.Empty)) { currency._Currency.CountryProgrammeId = countryProg.Id; if (currencyService.EditCurrency(currency._Currency)) { currency = new UCurrency(); ModelState.Clear(); } } else { currency._Currency.CountryProgrammeId = countryProg.Id; if (currencyService.AddCurrency(currency._Currency)) { currency = new UCurrency(); ModelState.Clear(); } } } return(ListView()); }
// // GET: CreateEdit public ActionResult CreateEdit(string cid) { UCurrency currency = new UCurrency(); Guid currencyId; if (Guid.TryParse(cid, out currencyId)) { ViewBag.Action = Resources.Global_String_Update; currency._Currency = currencyService.GetCurrency(currencyId); } return(View(currency)); }