Ejemplo n.º 1
0
 private void button4_Click(object sender, EventArgs e)
 {
     //Satıcı Düzenleme Butonu
     if (!String.IsNullOrEmpty(textBox2.Text) && !String.IsNullOrEmpty(textBox3.Text) && !String.IsNullOrEmpty(textBox4.Text) && !String.IsNullOrEmpty(maskedTextBox1.Text))
     {
         Supplier sp = HelperSupplier.GetByID(Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value));
         sp.companyName         = textBox2.Text;
         sp.supplierNameSurname = textBox3.Text;
         sp.address             = textBox4.Text;
         sp.gsm = maskedTextBox1.Text;
         var degistir = HelperSupplier.CUD(sp, 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.");
     }
     textBox1.Clear();
     textBox2.Clear();
     textBox3.Clear();
     textBox4.Clear();
     maskedTextBox1.Clear();
 }
Ejemplo n.º 2
0
 private void button3_Click(object sender, EventArgs e)
 {
     //Satıcı Silme Butonu
     if (!String.IsNullOrEmpty(textBox2.Text) && !String.IsNullOrEmpty(textBox3.Text) && !String.IsNullOrEmpty(textBox4.Text) && !String.IsNullOrEmpty(maskedTextBox1.Text))
     {
         var a = MessageBox.Show(" Silmek istediğinize emin misiniz?", "Bilgilendirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (a == DialogResult.Yes)
         {
             Supplier sp = HelperSupplier.GetByID(Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value));
             sp.IsActive = false;
             var b = HelperSupplier.CUD(sp, 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 silinecek satıcıyı seçiniz.");
     }
 }
Ejemplo n.º 3
0
        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            dataGridView1.ClearSelection();
            Supplier sp = HelperSupplier.GetByID(Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value));

            textBox2.Text       = sp.companyName;
            textBox3.Text       = sp.supplierNameSurname;
            textBox4.Text       = sp.address;
            maskedTextBox1.Text = sp.gsm;
        }
Ejemplo n.º 4
0
        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            dataGridView1.ClearSelection();
            Product  p = HelperProduct.GetByID(Convert.ToInt32(dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value));
            Category c = HelperCategory.GetByID(p.categoryID);
            Supplier s = HelperSupplier.GetByID(p.supplierID);

            textBox2.Text   = p.productName;
            textBox3.Text   = p.unitPrice.ToString();
            textBox4.Text   = p.discount.ToString();
            comboBox2.Text  = s.companyName;
            comboBox3.Text  = c.categoryName;
            button6.Enabled = true;
            button7.Enabled = true;
        }