Пример #1
0
        protected void DeleteSQL_Click(object sender, EventArgs e)
        {
            SQL_Request req = new SQL_Request().OpenConnection();

            try
            {
                //request all assets
                req.GetAllData(false);
                if (req.Tag != null)
                {
                    var cloud = req.Tag as List <Asset>;

                    foreach (var asset in cloud)
                    {
                        try
                        {
                            req.DeleteData(asset.AssetNumber, false);
                        }
                        catch { Notification.Text = "SQL Erase Error"; }
                    }

                    req.CloseConnection();
                    Notification.Text = "SQL Erase Success";
                }
            }
            catch
            {
                Notification.Text = "SQL Erase Error";
            }
            finally
            {
                req.CloseConnection();
            }
        }