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 AddSubOffice(UCountrySubOffice model) { ctrySubOfficeService.AddCountrySubOffice(model._countrySubOffice); return(Details(model._countrySubOffice.CountryProgrammeId.HasValue ? model._countrySubOffice.CountryProgrammeId.Value : Guid.Empty)); }