コード例 #1
0
        // Deletes user on click
        private void deleteUser_Btn(object sender, RoutedEventArgs e)
        {
            conn = new DBconn();

            conn.deleteUser(name);

            this.Close();
        }
コード例 #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);
        }
コード例 #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");
        }
コード例 #4
0
        private void remove_button(object sender, RoutedEventArgs e)
        {
            DBconn conn = new DBconn();

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

            conn.removeCard(s);
            this.Close();
        }
コード例 #5
0
        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();
        }
コード例 #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);
            }
        }
コード例 #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);
            }
        }
コード例 #8
0
        //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);
        }
コード例 #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;
        }