public static void SaveList(List <HCMIS.Desktop.DirectoryServices.SubAccount> list)
        {
            BLL.SubAccount bv = new BLL.SubAccount();
            foreach (HCMIS.Desktop.DirectoryServices.SubAccount v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v.ID.Value);

                // if the entry doesn't exist, create it
                if (bv.RowCount == 0)
                {
                    bv.AddNew();
                }
                // populate the contents of v on the to the database list
                if (v.ID.HasValue)
                {
                    bv.ID = v.ID.Value;
                }
                if (v.Name != "" && v.Name != null)
                {
                    bv.Name = v.Name;
                }
                if (v.Description != "" && v.Description != null)
                {
                    bv.Descriptiont = v.Description;
                }
                if (v.AccountID.HasValue)
                {
                    bv.StoreGroupID = v.AccountID.Value;
                }

                bv.Save();
            }
        }
 public static void DeleteList(List <int> list)
 {
     BLL.SubAccount bv = new BLL.SubAccount();
     foreach (int v in list)
     {
         // try to load by primary key
         bv.LoadByPrimaryKey(v);
         // if the entry doesn't exist, create it
         if (bv.RowCount > 0)
         {
             bv.MarkAsDeleted();
             bv.Save();
         }
         // populate the contents of v on the to the database list
     }
 }
        public static void DeleteList(List<int> list)
        {
            BLL.SubAccount bv = new BLL.SubAccount();
            foreach (int v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v);
                // if the entry doesn't exist, create it
                if (bv.RowCount > 0)
                {
                    bv.MarkAsDeleted();
                    bv.Save();
                }
                // populate the contents of v on the to the database list

            }
        }
        public static void SaveList(List<HCMIS.Desktop.DirectoryServices.SubAccount> list)
        {
            BLL.SubAccount bv = new BLL.SubAccount();
            foreach (HCMIS.Desktop.DirectoryServices.SubAccount v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v.ID.Value);

                // if the entry doesn't exist, create it
                if (bv.RowCount == 0)
                {
                    bv.AddNew();
                }
                // populate the contents of v on the to the database list
              if( v.ID.HasValue )
                   bv.ID = v.ID.Value;
              if( v.Name != "" && v.Name != null )
                   bv.Name = v.Name;
              if( v.Description != "" && v.Description != null )
                   bv.Descriptiont = v.Description;
              if( v.AccountID.HasValue )
                   bv.StoreGroupID = v.AccountID.Value;

                bv.Save();
            }
        }