예제 #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in lstwProducts.SelectedItems)
            {
                pro = item.Tag as Entity.Products;
            }
            pro.ProductName  = txtProductName.Text;
            pro.UnitPrice    = nudUnitPrice.Value;
            pro.UnitsInStock = int.Parse(nudUnitsInStock.Value.ToString());
            pro.id           = pro.id;

            Entity.Categories seciliCat = cbCategori.SelectedItem as Entity.Categories;
            pro.CategoryID = seciliCat.id;

            Entity.Suppliers seciliSup = cbSupplier.SelectedItem as Entity.Suppliers;
            pro.SupplierID = seciliSup.id;

            int result = proDAL.Update(pro);

            MessageBox.Show(result.ToString() + " satır etkilendi.");
            pro.ListViewDoldur(lstwProducts);
            Entity.Entity en = new Entity.Entity();
            en.Temizle(groupBox1);
            en.Temizle(groupBox2);
        }
예제 #2
0
        private void frmSaveProducts_Load(object sender, EventArgs e)
        {
            Entity.Categories cat = new Entity.Categories();
            cat.ComboboxDoldur(cbCategori);

            Entity.Suppliers sup = new Entity.Suppliers();
            sup.ComboboxDoldur(cbSupplier);
        }
예제 #3
0
 private void lstwSuppliers_SelectedIndexChanged(object sender, EventArgs e)
 {
     foreach (ListViewItem li in lstwSuppliers.SelectedItems)
     {
         sup = li.Tag as Entity.Suppliers;
         txtCompanyName.Text  = sup.CompanyName;
         txtContactName.Text  = sup.ContactName;
         txtContactTitle.Text = sup.ContactTitle;
         txtCity.Text         = sup.City;
         txtCountry.Text      = sup.Country;
         txtAddress.Text      = sup.Adress;
         mtxtPhone.Text       = sup.Phone;
     }
 }
        private void silToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult answer = MessageBox.Show("Silmek istediğinize emin misiniz", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Stop);

            if (answer == DialogResult.Yes)
            {
                foreach (ListViewItem li in lstwSuppliers.SelectedItems)
                {
                    sup = li.Tag as Entity.Suppliers;
                }
                int result = supDAL.Delete(sup.id);
                MessageBox.Show(result + " satır silindi.");
                sup.listVieweDoldur(lstwSuppliers);
            }
        }
예제 #5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Entity.Suppliers sup = new Entity.Suppliers();
            sup.CompanyName  = txtCompanyName.Text;
            sup.ContactName  = txtContactName.Text;
            sup.ContactTitle = txtContactTitle.Text;
            sup.City         = txtCity.Text;
            sup.Country      = txtCountry.Text;
            sup.Adress       = txtAddress.Text;
            sup.Phone        = mtxtPhone.Text;
            DAL.SuppliersDAL supDAL = new DAL.SuppliersDAL();
            int result = supDAL.Save(sup);

            MessageBox.Show(result + " satır eklendi.");
            Entity.Entity en = new Entity.Entity();
            en.Temizle(groupBox1);
            en.Temizle(groupBox2);
        }
예제 #6
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem li in lstwSuppliers.SelectedItems)
            {
                sup = li.Tag as Entity.Suppliers;
            }
            sup.CompanyName  = txtCompanyName.Text;
            sup.ContactName  = txtContactName.Text;
            sup.ContactTitle = txtContactTitle.Text;
            sup.City         = txtCity.Text;
            sup.Country      = txtCountry.Text;
            sup.Adress       = txtAddress.Text;
            sup.Phone        = mtxtPhone.Text;
            int result = supDAL.Update(sup);

            MessageBox.Show(result + " satır güncellendi.");
            sup.listVieweDoldur(lstwSuppliers);
            Entity.Entity en = new Entity.Entity();
            en.Temizle(groupBox1);
            en.Temizle(groupBox2);
        }
예제 #7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Entity.Products pro = new Entity.Products();
            pro.ProductName  = txtProductName.Text;
            pro.UnitPrice    = nudUnitPrice.Value;
            pro.UnitsInStock = int.Parse(nudUnitsInStock.Value.ToString());

            Entity.Categories seciliCat = cbCategori.SelectedItem as Entity.Categories;
            pro.CategoryID = seciliCat.id;

            Entity.Suppliers seciliSup = cbSupplier.SelectedItem as Entity.Suppliers;
            pro.SupplierID = seciliSup.id;

            DAL.ProductsDal proDAL = new DAL.ProductsDal();
            int             result = proDAL.Save(pro);

            MessageBox.Show(result.ToString() + " satır etkilendi.");
            Entity.Entity en = new Entity.Entity();
            en.Temizle(groupBox1);
            en.Temizle(groupBox2);
        }
예제 #8
0
 private void frmListSuppliers_Load(object sender, EventArgs e)
 {
     Entity.Suppliers sup = new Entity.Suppliers();
     sup.listVieweDoldur(lstwSuppliers);
 }