Beispiel #1
0
        private void btnAddBrand_Click(object sender, EventArgs e)
        {
            String Name = tbBrandName.Text;

            if (Name != "")
            {
                if (!CheckBrandId(Name))
                {
                    var   db    = new ThriftShopContext.ThriftShopDataContext();
                    Brand brand = new ThriftShopContext.Brand();
                    brand.BrandName = Name;
                    db.Brands.InsertOnSubmit(brand);
                    db.SubmitChanges();
                    dgvBrand.Rows.Add(Name, "0");
                }
                else
                {
                    tbBrandName.Text      = "Brand is already exist";
                    tbBrandName.ForeColor = Color.Red;
                }
            }
        }
 partial void DeleteBrand(Brand instance);
 partial void UpdateBrand(Brand instance);
 partial void InsertBrand(Brand instance);