Beispiel #1
0
        private void MediaSubsetCommit_Click(object sender, RoutedEventArgs e)
        {
            using (Proc MediaSubset_Commit = new Proc("MediaSubset_Commit"))
                using (DataView SelectedFiles = GetSelectedFiles())
                    using (DataTable UploadFiles = SqlClientHelpers.NewTableFromDataView(SelectedFiles, "FullPath", "ModifiedDate", "Size"))
                    {
                        MediaSubset_Commit["@BackupProfileID"] = (int)cbxBackupProfiles.SelectedValue;
                        MediaSubset_Commit["@Files"]           = UploadFiles;
                        MediaSubset_Commit.ExecuteNonQuery();
                    }

            ResetAllCounters();
        }
Beispiel #2
0
        protected void FilterChanged()
        {
            var dv = (gridReturns.ItemsSource as DataView);

            if (dv == null)
            {
                return;
            }
            dv.RowFilter = SqlClientHelpers.BuildRowFilter(
                FilterReturned ? "Status = 'UnReturned'" : null,
                FilterFiled ? "Status <> 'Filed'" : null,
                FilterLocalOffice ? "TaxOfficeId = " + SettingsModel.TaxOfficeId.ToString(CultureInfo.InvariantCulture) : null
                );
        }
    private void DoMessageCallback(string message, string prefix = null)
    {
        if (message == null)
        {
            return;
        }

        if (MessageCallback != null)
        {
            MessageCallback(prefix + SqlClientHelpers.SqlErrorTextCleaner(message));
        }
        else
        {
            throw (new Exception(message));
        }
    }
 public bool ExecuteNonQuery(object label, bool displaySuccess)
 {
     try
     {
         ExecuteNonQuery();
         if (displaySuccess)
         {
             ReflectionHelpers.PropertySetter(label, "Text", "Saved Successfully");
         }
         return(true);
     }
     catch (Exception ex)
     {
         if (!ReflectionHelpers.PropertySetter(label, "Text", SqlClientHelpers.SqlErrorTextCleaner(ex.Message)))
         {
             throw;
         }
         return(false);
     }
 }
    public DataSet ExecuteDataSet(object label) //actually any object with a .Text propertyName will suffice :)
    {
        ReflectionHelpers.PropertySetter(label, "Success", true);

        try
        {
            return(ExecuteDataSet().DataSet);
        }
        catch (Exception ex) {
            ReflectionHelpers.PropertySetter(label, "Success", false);

            //if the caller has provided a way to display the error then do so
            if (ReflectionHelpers.PropertySetter(label, "Text", SqlClientHelpers.SqlErrorTextCleaner(ex.Message)))
            {
                return(null);
            }
            //otherwise rethrow so that we can see the buggy that caused the exception and fix it
            throw;
        }
    }
Beispiel #6
0
 public bool ExecuteNonQuery(ExecuteMessageCallback callback, String ExecuteMessagePrefix, bool DisplaySuccess)
 {
     try
     {
         ExecuteNonQuery();
         if (DisplaySuccess && callback != null)
         {
             callback(ExecuteMessagePrefix + "Saved Successfully");
         }
         return(true);
     }
     catch (Exception ex)
     {
         if (callback != null)
         {
             callback(ExecuteMessagePrefix + SqlClientHelpers.SqlErrorTextCleaner(ex.Message));
         }
         return(false);
     }
 }
 public NameValueCollection ExecuteNameValueCollection(NameValueCollection vals = null)
 {
     return(SqlClientHelpers.DataTableToNameValueCollection(Table0, vals));
 }