Beispiel #1
0
        /// <summary>
        /// Pozwala edytować już zapisane dane
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button2_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in this.dataGridView1.SelectedRows)
            {
                Produkty produkty = row.DataBoundItem as Produkty;
                if (produkty != null)
                {
                    NewProductForm ProductForm = new NewProductForm();
                    ProductForm.MdiParent = this.ParentForm;
                    ProductForm.Show();

                }
            }
        }
Beispiel #2
0
 private void dodajProduktToolStripMenuItem_Click(object sender, EventArgs e)
 {
     NewProductForm newproductForm = new NewProductForm();
     newproductForm.MdiParent = this;
     newproductForm.Show();
 }
Beispiel #3
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     NewProductForm newproductForm = new NewProductForm();
     newproductForm.MdiParent = this;
     newproductForm.Show();
 }
Beispiel #4
0
        /// <summary>
        /// Inmportowanie danych z pliku XML
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void inmportujDaneProduktówToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.Title = "Import danych produktu";
                openFileDialog.Filter = "Pliki formatu Xml (*.xml)|*.xml|Wszystkie pliki (*.*)|*.*";
                openFileDialog.Multiselect = false;
                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    Produkty data = ProductXmlSerializer.Deserialize(openFileDialog.FileName);

                    NewProductForm productForm = new NewProductForm(data);
                    productForm.MdiParent = this;
                    productForm.Show();
                }
            }
            catch (Exception x)
            {
                MessageBox.Show("Podczas importu danych wystąpił błąd: " + x.Message);
            }
        }
Beispiel #5
0
 /// <summary>
 /// metoda Wywołyje formularz Produktów
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button1_Click(object sender, EventArgs e)
 {
     NewProductForm newProductForm = new NewProductForm();
     newProductForm.MdiParent = this.ParentForm;
     newProductForm.Show();
 }