private void toolStripMenuItem15_Click(object sender, EventArgs e)
        {
            CommissionShop        cs          = new CommissionShop();
            List <CommissionShop> newComShops = new List <CommissionShop>();

            try
            {
                cs.picturePrice = int.Parse(toolStripTextBox1.Text);
                foreach (CommissionShop c in art.comShops)
                {
                    if (cs.picturePrice == c.picturePrice)
                    {
                        int k = art.comShops.IndexOf(c);
                        newComShops.Add(art.comShops[k]);
                        commissionShopBindingSource.DataSource = newComShops;
                    }
                }
            }
            catch
            {
                newComShops = art.comShops;
            }
            commissionShopBindingSource.ResetBindings(false);
            art.isChangeData = true;
            art.Load();
            toolStripMenuItem23.Visible = true;
        }
 //edit
 public AddCommissionShopForm(CommissionShop ComissionShop) : this()
 {
     comshop       = ComissionShop;
     textBox1.Text = ComissionShop.shopName;
     textBox2.Text = ComissionShop.shopAddress;
     textBox5.Text = ComissionShop.pictureName;
     textBox4.Text = ComissionShop.pictureYear.ToString();
     textBox3.Text = ComissionShop.picturePrice.ToString();
 }
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (comshop == null)
            {
                comshop = new CommissionShop();
            }

            comshop.shopName     = textBox1.Text;
            comshop.shopAddress  = textBox2.Text;
            comshop.pictureName  = textBox5.Text;
            comshop.pictureYear  = int.Parse(textBox4.Text);
            comshop.picturePrice = int.Parse(textBox3.Text);
        }
Ejemplo n.º 4
0
 public void AddComShop(CommissionShop cs)
 {
     comShops.Add(cs);
     isChangeData = false;
 }