示例#1
0
        private void TypeBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable dt = WindowHandler.controllerObj.ViewAccounts(TypeBox.SelectedIndex + 1);

            dataGridView1.DataSource = dt;
            if (TypeBox.Text == "Customers")
            {
                InsertGroup.Hide();
                panel3.Hide();
                dataGridView1.Width = Convert.ToInt32(WindowHandler.cmain.Width * 0.63);
            }
            else
            {
                InsertGroup.Show();
                dataGridView1.Width = Convert.ToInt32(WindowHandler.cmain.Width * 0.37);
                InsertGroup.Text    = "Insert " + TypeBox.Text;
                InsertGroup.Text    = InsertGroup.Text.Remove(InsertGroup.Text.Length - 1);
                if (TypeBox.Text == "Managers")
                {
                    panel3.Hide();
                }
                else
                {
                    panel3.Show();
                }
            }
        }
示例#2
0
        private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            DataTable dt = WindowHandler.controllerObj.ViewSupply(TypeBox.Text);

            dataGridView1.DataSource = dt;
            if (TypeBox.Text == "ALL")
            {
                InsertGroup.Hide();
                dataGridView1.Width = Convert.ToInt32(WindowHandler.cmain.Width * 0.63);
            }
            else
            {
                InsertGroup.Show();
                dataGridView1.Width     = Convert.ToInt32(WindowHandler.cmain.Width * 0.37);
                InsertGroup.Text        = "Insert " + TypeBox.Text;
                NameCombo.DataSource    = dt;
                NameCombo.DisplayMember = "name";
                checkBox1.Checked       = false;
                checkBox2.Checked       = false;
            }
        }