private void button2Powrot_Click(object sender, EventArgs e) { this.Close(); this.Hide(); Czesc Czesc = new Czesc(this.database); Czesc.ShowDialog(); }
private void btnCzesc_Click(object sender, EventArgs e) { this.Hide(); this.Close(); Czesc czesc = new Czesc(this.database); czesc.ShowDialog(); }
private void button1_Click(object sender, EventArgs e) { Czesc frm = (Czesc)Application.OpenForms["Czesc"]; int row = Convert.ToInt32(frm.dgvCzesc.CurrentRow.Cells[0].Value); DM_Czesc toUpdate = this.database.DM_Czesc.Where(czesc => czesc.Id_czesci == row).First(); toUpdate.Nazwa = textBox1.Text; toUpdate.Id_model_maszyny = Convert.ToInt32(comboBox1.SelectedValue); toUpdate.Ilosc_poczatkowa = Convert.ToInt32(textBox2Ilosc.Text); database.SaveChanges(); frm.dgvCzesc.DataSource = this.database.vDM_Czesc.ToList(); this.Close(); }