Ejemplo n.º 1
0
        public void AddCard(MyAccountPageObject obj)
        {
            global.OpenConnection(obj.MyAccountPageConnectionString);
            global.startTransaction();
            try
            {
                sql = "INSERT INTO \"Group2DB\".\"CustomerCardInfo\" (\"CustomerID\",\"CardNumber\",\"SecurityCode\",\"Balance\")" +
                      " VALUES (" + obj.MyAccountPageCustomerID + ", " + obj.MyAccountPageCardNumber + "," + obj.MyAccountPageSecurityCode + " ," + obj.MyAccountPageBalance + ") ";
                global.Datasource(sql);
                global.commitQuery();
                global.closeTransaction();
            }
            catch (Exception e)
            {
                global.rollBackQuery();

                MessageBox.Show(e.Message + "CardNumber is already taken");
            }
        }
Ejemplo n.º 2
0
        public void RemoveCard(MyAccountPageObject obj)
        {
            global.OpenConnection(obj.MyAccountPageConnectionString);
            global.startTransaction();
            try
            {
                sql = "Delete from \"Group2DB\".\"CustomerCardInfo\" where \"Group2DB\".\"CustomerCardInfo\".\"CardID\" =" + "" + obj.MyAccountPageRemoveCardSelectedID + "";
                global.Datasource(sql);
                global.commitQuery();
                global.closeTransaction();
                MessageBox.Show("Card Deleted");
            }
            catch (Exception e)
            {
                global.rollBackQuery();

                MessageBox.Show(e.Message + "CardNumber is already taken");
            }
        }
Ejemplo n.º 3
0
        public void UpdateAccountInfo(MyAccountPageObject obj)
        {
            global.OpenConnection(obj.MyAccountPageConnectionString);
            global.startTransaction();
            try
            {
                sql = "UPDATE \"Group2DB\".\"AccountInfo\"SET \"FirstName\" = '" + obj.MyAccountPageFirstName + "',\"LastName\" = '" + obj.MyAccountPageLastName + "',\"DateOfBirth\" = '" + obj.MyAccountPageDateOfBirth.Date + " ' " +
                      " " + "WHERE \"AccountID\" =  " + "" + obj.MyAccountPageAccountID + "";
                global.Datasource(sql);
                sql = "UPDATE \"Group2DB\".\"Account\" SET \"Username\" = '" + obj.MyAccountPageUsername + "'," +
                      " \"Password\"='" + obj.MyAccountPagePassword + "' WHERE(\"AccountID\" = " + obj.MyAccountPageAccountID + ")";
                global.Datasource(sql);
                global.commitQuery();
                global.closeTransaction();
                MessageBox.Show("Sucessfully Updated Profile");
            }
            catch (Exception e)
            {
                global.rollBackQuery();

                MessageBox.Show(e.Message);
            }
        }