Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //kasiyer arama butonu
            dataGridView1.Rows.Clear();
            List <Cashier> c = new List <Cashier>();

            if (comboBox1.SelectedIndex == 0)
            {
                c = HelperCashier.GetListByName(textBox1.Text);
            }
            else if (comboBox1.SelectedIndex == 1)
            {
                c = HelperCashier.GetListBySurname(textBox1.Text);
            }
            else if (comboBox1.SelectedIndex == 2)
            {
                c = HelperCashier.GetListByTc(textBox1.Text);
            }
            else if (comboBox1.SelectedIndex == 3)
            {
                c = HelperCashier.GetListByUserName(textBox1.Text);
            }
            foreach (var item in c)
            {
                if (item.IsActive == true)
                {
                    dataGridView1.Rows.Add(item.cashierID, item.name, item.surname, item.tcNo, item.gsm, item.address, item.salary, item.userName, item.password);
                }
            }
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            textBox4.Clear();
            maskedTextBox1.Clear();
            textBox5.Clear();
            textBox6.Clear();
            textBox7.Clear();
            textBox8.Clear();
        }