Exemplo n.º 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     //Kasiyer Silme Butonu
     if (!String.IsNullOrEmpty(textBox2.Text) && !String.IsNullOrEmpty(textBox3.Text) && !String.IsNullOrEmpty(textBox4.Text) && !String.IsNullOrEmpty(maskedTextBox1.Text) && !String.IsNullOrEmpty(textBox5.Text) && !String.IsNullOrEmpty(textBox6.Text) && !String.IsNullOrEmpty(textBox7.Text) && !String.IsNullOrEmpty(textBox8.Text))
     {
         if (String.IsNullOrEmpty(dataGridView1.CurrentRow.Index.ToString()))
         {
             MessageBox.Show("Kasiyer seçmediniz!!!");
         }
         else
         {
             var a = MessageBox.Show(" Silmek istediğinize emin misiniz?", "Bilgilendirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
             if (a == DialogResult.Yes)
             {
                 Cashier m = HelperCashier.GetByID(Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value));
                 m.IsActive = false;
                 var b = HelperCashier.CUD(m, System.Data.Entity.EntityState.Modified);
                 if (b.Item2)
                 {
                     MessageBox.Show("Silme işlemi başarılı");
                 }
                 else
                 {
                     MessageBox.Show("Silme yapılamadı");
                 }
             }
             Yenile();
         }
     }
     else
     {
         MessageBox.Show("Lütfen seçim yapınız.");
     }
 }
Exemplo n.º 2
0
        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            dataGridView1.ClearSelection();
            Cashier c = HelperCashier.GetByID(Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value));

            textBox2.Text       = c.name;
            textBox3.Text       = c.surname;
            textBox4.Text       = c.tcNo;
            maskedTextBox1.Text = c.gsm;
            textBox5.Text       = c.address;
            textBox6.Text       = c.salary.ToString();
            textBox7.Text       = c.userName;
            textBox8.Text       = c.password;
            button3.Enabled     = true;
            button4.Enabled     = true;
        }
Exemplo n.º 3
0
 private void button4_Click(object sender, EventArgs e)
 {
     //Kasiyer Düzenleme butonu
     if (!String.IsNullOrEmpty(textBox2.Text) && !String.IsNullOrEmpty(textBox3.Text) && !String.IsNullOrEmpty(textBox4.Text) && !String.IsNullOrEmpty(maskedTextBox1.Text) && !String.IsNullOrEmpty(textBox5.Text) && !String.IsNullOrEmpty(textBox6.Text) && !String.IsNullOrEmpty(textBox7.Text) && !String.IsNullOrEmpty(textBox8.Text))
     {
         Cashier c = HelperCashier.GetByID(Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value));
         c.name     = textBox2.Text;
         c.surname  = textBox3.Text;
         c.tcNo     = textBox4.Text;
         c.gsm      = maskedTextBox1.Text;
         c.address  = textBox5.Text;
         c.salary   = Convert.ToInt32(textBox6.Text);
         c.userName = textBox7.Text;
         c.password = textBox8.Text;
         var degistir = HelperCashier.CUD(c, System.Data.Entity.EntityState.Modified);
         if (degistir.Item2)
         {
             MessageBox.Show("Güncelleme başarılı.");
         }
         else
         {
             MessageBox.Show("Güncelleme yapılamadı.");
         }
         Yenile();
     }
     else
     {
         MessageBox.Show("Lütfen tüm alanları doldurunuz.");
     }
     textBox2.Clear();
     textBox3.Clear();
     textBox4.Clear();
     maskedTextBox1.Clear();
     textBox5.Clear();
     textBox6.Clear();
     textBox7.Clear();
     textBox8.Clear();
 }