private void Update() { IBusinessLayer businessLayer = new BuinessLayer(); if (OperationType == OperationType.Insert) { businessLayer.AddCities(new Cities { Number = CitiesId, Name = Name, Region = Region, IsRegionCenter = IsRegionCenter, }); Container.CitiesList = Container.GetCitiess(); } else if (OperationType == OperationType.Update) { businessLayer.UpdateCities(new Cities { Number = CitiesId, Name = Name, Region = Region, IsRegionCenter = IsRegionCenter }); _originalValue = (CitiesViewModel)MemberwiseClone(); } }
public CitiesViewModel(Cities c) { CitiesId = c.Number; Name = c.Name; Region = c.Region; IsRegionCenter = c.IsRegionCenter; _originalValue = (CitiesViewModel)MemberwiseClone(); }