private void LoadPurok() { var puroks = _repository.Purok.GetRange(); foreach (var purok in puroks) { var purokmodel = new PurokModel(purok, _repository); purokmodel.LoadRelatedInfo(); PurokList.Add(purokmodel); } }
private void SavePurokProc() { if (NewPurokModel == null) { return; } if (!NewPurokModel.HasChanges) { return; } try { _repository.Purok.Add(NewPurokModel.ModelCopy); var purokmodel = new PurokModel(NewPurokModel.ModelCopy, _repository); purokmodel.LoadRelatedInfo(); PurokList.Add(purokmodel); _addPurokWindow.Close(); } catch (Exception e) { MessageBox.Show("Unable to Save!", "Add Purok"); } }