public int Add(Investor aType) { int returnValue = -1; returnValue = new InvestorDataHelper().Insert(aType); return(returnValue); }
public BindingList <Investor> Show(Investor aType) { try { var myList = new InvestorDataHelper().SelectAll(); var bindingList = new BindingList <Investor>(myList); return(bindingList); } catch (ArgumentNullException) { throw new DataExistence("No Data Found! No Investor is yet added."); } }
public BindingSource GetList() { InvestorDataHelper DH = new InvestorDataHelper(); BindingSource BS = new BindingSource(); Hashtable HT = new Hashtable(); List <Investor> myList = DH.SelectAll(); if (myList != null) { foreach (var item in myList) { if (item.State == EntityState.Enabled) { HT.Add(item.ID, item.Name); } } } HT.Add(-1, "Select Investor"); BS.DataSource = HT; return(BS); }