Exemplo n.º 1
0
 /// <summary>
 /// this method is used to execute the copy command, by calling each of the appropriate methods to add not only the queries, but also the data to the second table
 /// </summary>
 /// <param name="database">
 /// the name of the first database
 /// </param>
 /// <param name="database2">
 /// the name of the second database
 /// </param>
 /// <param name="connNumber">
 /// the connection number of the first database
 /// </param>
 /// <param name="connNumber2">
 /// the connection number of the second database
 /// </param>
 /// <param name="queryStep">
 /// the action we want to take every query action
 /// </param>
 /// <param name="justStructure">
 /// a boolean dictating if the user just wants to copy the structure for now (incase they want to add any fields to the database before copying the data)
 /// </param>
 /// <returns>
 /// the asyncronous task, so it does not lock the UI
 /// </returns>
 public static void ExecuteCopy(string database, string database2, int connNumber, int connNumber2, Action <string> queryStep, Boolean justStructure)
 {
     //using the opened connection...
     using (DbConnection conn = SQLConnectionHandler.GetOpenedConnection(connNumber2))
     {
         //using the opened transaction...
         using (DbTransaction sqlTran = conn.BeginTransaction())
         {
             try
             {
                 //run the queries before, after, and copy the data
                 SQLQueryHandler.RunBeforeQueries(connNumber2, conn, sqlTran, queryStep);
                 if (!justStructure)
                 {
                     SQLDataHandler.CopyData(database, database2, connNumber, connNumber2, conn, sqlTran,
                                             queryStep);
                 }
                 SQLQueryHandler.RunAfterQueries(connNumber2, conn, sqlTran, queryStep);
                 //commit the changes
                 sqlTran.Commit();
             }
             catch (Exception)
             {
                 // rollback the transaction on error
                 sqlTran.Rollback();
                 throw;
             }
         }
     }
 }
Exemplo n.º 2
0
 public SearchUser()
 {
     InitializeComponent();
     searchUser = this;
     sqlHandler = new SQLDataHandler();
     RefreshUI();
 }
 public AddBadge() {
     InitializeComponent();
     txtScanID.Focus();
     sqlHandler = new SQLDataHandler();
     _timer = new DispatcherTimer();
     _timer.Interval = new TimeSpan(0, 0, 1);
     _timer.Tick += new EventHandler(Timer_Tick);
     btnCheckIn.Visibility = Visibility.Hidden;
 }
 public SearchUser()
 {
     InitializeComponent();
     searchUser = this;
     sqlHandler = new SQLDataHandler();
     dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
     dispatcherTimer.Interval = new TimeSpan(0, 0, 15);
     RefreshUI();
 }
 public RedeemPage() {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
     _timer = new DispatcherTimer();
     _timer.Interval = new TimeSpan(0, 0, 1);
     _timer.Tick += new EventHandler(Timer_Tick);
     txtScanner = txtTicketID;
     txtTicketID.Focus();
     btnManualRedeem.Visibility = Visibility.Hidden;
 }
 public LoginWindow()
 {
     InitializeComponent();
     loginManager = new SQLDataHandler();
 }
Exemplo n.º 7
0
 public RedeemPage()
 {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
 }
Exemplo n.º 8
0
 public RegistrationPage()
 {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
 }
 public RegistrationPage() {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
     btnRegister.Focus();
 }
 public LoginWindow() {
     InitializeComponent();
     loginManager = new SQLDataHandler();
     txtUserName.Focus();
 }
 public RafflePage() {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
 }