public int Add(AgentGroup aType)
        {
            int returnValue = -1;

            returnValue = new AgentGroupDataHelper().Insert(aType);
            return(returnValue);
        }
 public BindingList <AgentGroup> Show(AgentGroup aType)
 {
     try
     {
         var myList      = new AgentGroupDataHelper().SelectAll();
         var bindingList = new BindingList <AgentGroup>(myList);
         return(bindingList);
     }
     catch (ArgumentNullException)
     {
         throw new DataExistence("No Data Found! No groups are yet added.");
     }
 }
        public BindingSource GetList()
        {
            AgentGroupDataHelper DH = new AgentGroupDataHelper();
            BindingSource        BS = new BindingSource();
            Hashtable            HT = new Hashtable();

            List <AgentGroup> 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 Agent Group");

            BS.DataSource = HT;
            return(BS);
        }
        public AgentGroup Show(int searchByID)
        {
            var mySingleItem = new AgentGroupDataHelper().SelectByID(searchByID);

            return(mySingleItem);
        }