public static bool DeleteProducts(int[] productIds)
        {
            List <string>           ids      = new List <string>();
            IDatabaseSessionManager database = AbleContext.Current.Database;

            database.BeginTransaction();
            foreach (int pid in productIds)
            {
                ProductDataSource.Delete(pid);
            }
            database.CommitTransaction();
            return(true);
        }
        protected void DeleteButton_Click(object sender, EventArgs e)
        {
            List <object> values = PG.GetSelectedDataKeyValues();

            if (values.Count > 0)
            {
                List <int> productIds = values.ConvertAll <int>(delegate(object value) { return(Convert.ToInt32(value)); });
                foreach (int productId in productIds)
                {
                    ProductDataSource.Delete(productId);
                }
            }

            PG.DataBind();
        }