public ActionResult CreateEdit(UCountrySubOffice ctrySubOffice) { if (ModelState.IsValid) { if (!ctrySubOffice.Id.Equals(Guid.Empty)) { ctrySubOffice._countrySubOffice.CountryProgrammeId = countryProg.Id; if (ctrySubOfficeService.EditCountrySubOffice(ctrySubOffice._countrySubOffice)) { ModelState.Clear(); ctrySubOffice = new UCountrySubOffice(); } } else { ctrySubOffice._countrySubOffice.CountryProgrammeId = countryProg.Id; if (ctrySubOfficeService.AddCountrySubOffice(ctrySubOffice._countrySubOffice)) { ModelState.Clear(); ctrySubOffice = new UCountrySubOffice(); } } } return(ListView()); }
public ActionResult Edit(Guid id) { UCountrySubOffice ctrySubOffice = new UCountrySubOffice(); ctrySubOffice.LocationSelect = new SelectList(ctrySubOfficeService.LocationObj.GetLocations(countryId: countryProg.CountryId), "Id", "Name"); ViewBag.Action = "Update"; ctrySubOffice._countrySubOffice = ctrySubOfficeService.GetCountrySubOffice(id); return(View("CreateEdit", ctrySubOffice)); }
// // GET: CreateEdit public ActionResult Create() { UCountrySubOffice ctrySubOffice = new UCountrySubOffice(); ctrySubOffice.LocationSelect = new SelectList(ctrySubOfficeService.LocationObj .GetLocations(countryId: countryProg.CountryId), "Id", "Name"); return(View("CreateEdit", ctrySubOffice)); }
public ActionResult AddSubOffice(Guid countryProgId) { UCountrySubOffice ctrySubOffice = new UCountrySubOffice(); ctrySubOffice._countrySubOffice.CountryProgrammeId = countryProgId; ctrySubOffice.LocationSelect = new SelectList(ctrySubOfficeService.LocationObj.GetLocations(countryProgId), "Id", "Name"); return(View(ctrySubOffice)); }
public ActionResult AddSubOffice(UCountrySubOffice model) { ctrySubOfficeService.AddCountrySubOffice(model._countrySubOffice); return(Details(model._countrySubOffice.CountryProgrammeId.HasValue ? model._countrySubOffice.CountryProgrammeId.Value : Guid.Empty)); }