Exemplo n.º 1
0
        public void updateAccount(AccountCredentials acc)
        {
            string        connectionString = @"Data Source=cdb.c1lbyzt9l8fn.us-west-2.rds.amazonaws.com,1433;" + "Initial Catalog=cis;" + "User id=sonaaaa;" + "Password=mo7senzzzz;";
            SqlConnection myConnection     = new SqlConnection(connectionString);

            myConnection.Open();
            SqlCommand myCommand = new SqlCommand();

            myCommand.CommandText = "UPDATE Accounts SET id =" + acc.getID().ToString() + ",PNumber ='" + acc.getPhoneNumber() + "',Email ='" + acc.getEmail() + "', Password ='******', FName = '" + acc.getFName() + "', LName = '" + acc.getLName() + "' WHERE id = " + acc.getID() + ";";
            myCommand.Connection  = myConnection;
            myCommand.ExecuteNonQuery();
            myConnection.Close();
        }
Exemplo n.º 2
0
        public void insertAccount(AccountCredentials acc)
        {
            string        connectionString = @"Data Source=cdb.c1lbyzt9l8fn.us-west-2.rds.amazonaws.com,1433;" + "Initial Catalog=cis;" + "User id=sonaaaa;" + "Password=mo7senzzzz;";
            SqlConnection myConnection     = new SqlConnection(connectionString);

            myConnection.Open();
            SqlCommand myCommand = new SqlCommand();

            myCommand.CommandText = "insert into Accounts (Pnumber,Email,Password,Fname,Lname) Values ('" + acc.getPhoneNumber() + "','" + acc.getEmail() + "','" + acc.getPassword() + "','" + acc.getFName() + "','" + acc.getLName() + "')  ;  ";
            myCommand.Connection  = myConnection;
            myCommand.ExecuteNonQuery();
            myConnection.Close();
        }