public ActionResult JoinCountryUnion(int idCountry, string nameUnion, bool status) { Country country = mappingController.settingsData.catalog.countryList.Find(item => item.ID == idCountry); CountryUnion union = mappingController.settingsData.catalog.countryUnionList.Find(item => item.Name == nameUnion); if ((country != null) & (union != null)) { country.Load(); union.Load(); if (status) { if (country.UnionList.Find(item => item.ID == union.ID) == null) { country.UnionList.AddElement(country, union); } } else { if (country.UnionList.Find(item => item.ID == union.ID) != null) { country.UnionList.RemoveElement(country, union); } } country.Load(); union.Load(); } return(Json("")); }
public ActionResult FindCountryUnion(int id) { CountryUnion union = mappingController.settingsData.catalog.countryUnionList.Find(item => item.ID == id); if (union != null) { union.Load(); } return(Json(union)); }