public override void LoadListControl(string controlName, IDomain_Object[] all_Found_By_Searcher) { try { ListControl _myListControl = (ListControl)_myControls[controlName]; foreach (IKeyValuePair ido in (IKeyValuePair[])all_Found_By_Searcher) { AddListItemToListControl(ido.Value, ido.Key, _myListControl); } } catch (NullReferenceException) { Debug.WriteLine("Control probably was not found..."); } catch (Exception) { Debug.WriteLine("An exception in loading up the DropDownList..."); } }
public Boolean Persist(IDomain_Object domain_object) { Boolean success = true; try { Context.StartTransaction(); Context.PersistChanges(domain_object); Context.Commit(); } catch (ApplicationException ex) { success = false; Console.WriteLine(ex.Message); } return success; }