コード例 #1
0
ファイル: MainHandler.cs プロジェクト: dcorriveau/SCS
 /// <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;
             }
         }
     }
 }
コード例 #2
0
 public SearchUser()
 {
     InitializeComponent();
     searchUser = this;
     sqlHandler = new SQLDataHandler();
     RefreshUI();
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 public SearchUser()
 {
     InitializeComponent();
     searchUser = this;
     sqlHandler = new SQLDataHandler();
     dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
     dispatcherTimer.Interval = new TimeSpan(0, 0, 15);
     RefreshUI();
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 public LoginWindow()
 {
     InitializeComponent();
     loginManager = new SQLDataHandler();
 }
コード例 #7
0
 public RedeemPage()
 {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
 }
コード例 #8
0
 public RegistrationPage()
 {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
 }
コード例 #9
0
 public RegistrationPage() {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
     btnRegister.Focus();
 }
コード例 #10
0
 public LoginWindow() {
     InitializeComponent();
     loginManager = new SQLDataHandler();
     txtUserName.Focus();
 }
コード例 #11
0
 public RafflePage() {
     InitializeComponent();
     sqlHandler = new SQLDataHandler();
 }