Esempio n. 1
0
        public int Add(Deal aType)
        {
            int returnValue = -1;

            returnValue = new DealDataHelper().Insert(aType);
            return(returnValue);
        }
Esempio n. 2
0
 public BindingList <Deal> Show(Deal aType)
 {
     try
     {
         var myList      = new DealDataHelper().SelectAll();
         var bindingList = new BindingList <Deal>(myList);
         return(bindingList);
     }
     catch (ArgumentNullException)
     {
         throw new DataExistence("No Data Found! No Deals are yet added.");
     }
 }
Esempio n. 3
0
        public BindingSource GetList()
        {
            DealDataHelper DH = new DealDataHelper();
            BindingSource  BS = new BindingSource();
            Hashtable      HT = new Hashtable();

            List <Deal> 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 Deal");
            BS.DataSource = HT;
            return(BS);
        }