private void toolStripMenuItem15_Click(object sender, EventArgs e)
        {
            OwnCollection        oc = new OwnCollection();
            List <OwnCollection> newOwnCollections = new List <OwnCollection>();

            try
            {
                oc.placeBuy = toolStripTextBox1.Text;
                foreach (OwnCollection owc in art.ownCollections)
                {
                    if (oc.placeBuy == owc.placeBuy)
                    {
                        int k = art.ownCollections.IndexOf(owc);
                        newOwnCollections.Add(art.ownCollections[k]);
                        ownCollectionBindingSource.DataSource = newOwnCollections;
                    }
                }
            }
            catch
            {
                newOwnCollections = art.ownCollections;
            }
            ownCollectionBindingSource.ResetBindings(false);
            art.isChangeData = true;
            art.Load();
            toolStripMenuItem23.Visible = true;
        }
 //edit
 public AddOwnCollectionForm(OwnCollection OwnCollection) : this()
 {
     ownCollection  = OwnCollection;
     textBox1.Text  = OwnCollection.myCollectionName;
     textBox2.Text  = OwnCollection.pictureName;
     textBox4.Text  = OwnCollection.pictureYear.ToString();
     comboBox2.Text = OwnCollection.pictureType;
     textBox3.Text  = OwnCollection.placeBuy;
 }
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (ownCollection == null)
            {
                ownCollection = new OwnCollection();
            }

            ownCollection.myCollectionName = textBox1.Text;
            ownCollection.pictureName      = textBox2.Text;
            ownCollection.pictureYear      = int.Parse(textBox4.Text);
            ownCollection.pictureType      = comboBox2.Text;
            ownCollection.placeBuy         = textBox3.Text;
        }
Example #4
0
 public void AddOwnCollection(OwnCollection oc)
 {
     ownCollections.Add(oc);
     isChangeData = false;
 }