private void button4_Click(object sender, RoutedEventArgs e)
        {
            ChooseAccount window = new ChooseAccount();

            window.Show();
            this.Hide();
        }
        private void button2_Click(object sender, RoutedEventArgs e) //add
        {
            App.Current.Properties["mode"] = "other";
            ChooseAccount window = new ChooseAccount();

            window.Show();
            this.Hide();
        }
Ejemplo n.º 3
0
        private void list_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) //pick
        {
            ListView lv   = sender as ListView;
            Border   item = (Border)lv.SelectedItem;

            if (item != null && lv.SelectedIndex != 0)
            {
                if (!refresh())
                {
                    return;
                }

                TextBlock idcontainer = (TextBlock)((Border)((StackPanel)item.Child).Children[0]).Child;
                string    id          = idcontainer.Text;

                if (mode == "loan")
                {
                    TextBlock namecontainer = (TextBlock)((Border)((StackPanel)item.Child).Children[1]).Child;
                    string    name          = namecontainer.Text;

                    App.Current.Properties["loancid"]   = id;
                    App.Current.Properties["loancname"] = name;

                    ChooseAccount window = new ChooseAccount();
                    window.Show();
                    this.Hide();
                }
                else
                {
                    SqlCommand cmd = new SqlCommand("INSERT INTO CLIENT_ACCOUNTS (aid, cid) VALUES (" + editing.ID.ToString() + ", " + id + ")");
                    cmd.Connection = cn;
                    cmd.ExecuteNonQuery();

                    AccountDetails window = new AccountDetails();
                    window.Show();
                    this.Hide();
                }
            }
        }