Ejemplo n.º 1
0
        // Deletes user on click
        private void deleteUser_Btn(object sender, RoutedEventArgs e)
        {
            conn = new DBconn();

            conn.deleteUser(name);

            this.Close();
        }
Ejemplo n.º 2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            DBconn conn = new DBconn();
            string name = nameTextBox.Text;
            int cardID = Int32.Parse(cardTextBox.Text);

            conn.addCardToUser(name, cardID);
        }
Ejemplo n.º 3
0
        private void button_Click_Create(object sender, RoutedEventArgs e)
        {
            DBconn conn = new DBconn();

            conn.createUser(usertextBox.Text, passwordBox.Password);

            MessageBox.Show("User Created");
        }
        private void remove_button(object sender, RoutedEventArgs e)
        {
            DBconn conn = new DBconn();

            int s = Int32.Parse(textBox.Text);

            conn.removeCard(s);
            this.Close();
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            DBconn conn = new DBconn();
            string name, newName;

            name = textBox1.Text;
            newName = textBox.Text;

            conn.editUsername(name, newName);

            this.Close();
        }
Ejemplo n.º 6
0
        public void addCardsToList()
        {
            conn = new DBconn();

            Binder binder;

            binder = conn.viewUser(name);

            foreach (card c in binder.cardList)
            {

                //this.listView.Items.Add(new CollectableCard { Name = c.Name, Friendship = c.Friendship, Bravery = c.Bravery, Humor = c.Humor, StarFactor = c.StarFactor });
                this.listView.Items.Add(c);
            }
        }
Ejemplo n.º 7
0
        public void addCardsToList()
        {
            conn = new DBconn();

            List<card> allCards;

            allCards = conn.getCards();

            foreach (card c in allCards)
            {

                //this.listView.Items.Add(new CollectableCard { Name = c.Name, Friendship = c.Friendship, Bravery = c.Bravery, Humor = c.Humor, StarFactor = c.StarFactor });
                this.listView.Items.Add(c);
            }
        }
        //opens a new window with the card information
        private void binderbutton_Click(object sender, RoutedEventArgs e)
        {
            string name, imagepath;
            int f, b, h, s;
            name = namebox.Text;
            imagepath = imagepathbox.Text;
            f = Int32.Parse(friendbox.Text);
            b = Int32.Parse(bravebox.Text);
            h = Int32.Parse(humorbox.Text);
            s = Int32.Parse(starbox.Text);

            DBconn conn = new DBconn();

            conn.createCard(name, imagepath, f, b, h, s);
        }
Ejemplo n.º 9
0
        private void findUser(string username)
        {
            conn = new DBconn();

            User u = conn.findUser(username);
            if (u == null)
                displayuserlabel.Content = "No user found";
            else
                displayuserlabel.Content = u.Username;
        }