private void buttonUpdate_Click(object sender, EventArgs e) { PhuongPhapNo updated = gridViewMain.GetFocusedRow() as PhuongPhapNo; updated.TenPPNo = textBoxTenPPNo.Text; updated.MaCongTruong = textBoxMaCongTruong.Text; if (textBoxHeSoKienCo.Text != String.Empty) { updated.HeSoKienCo = double.Parse(textBoxHeSoKienCo.Text); } if (textBoxHeSoPPNo.Text != String.Empty) { updated.HeSoPPNo = double.Parse(textBoxHeSoPPNo.Text); } try { BS_PhuongPhapNo.CapNhatPhuongPhapNo(updated); } catch (Exception exc) { MessageBox.Show("Lỗi - " + exc.Message); } ShowPanel(1); HienThiDuLieu_PhuongPhapNo(); }
private void buttonInsert_Click(object sender, EventArgs e) { PhuongPhapNo inserted = new PhuongPhapNo(); inserted.MaPPNo = textBoxMaPPNo2.Text; inserted.TenPPNo = textBoxTenPPNo2.Text; inserted.MaCongTruong = textBoxMaCongTruong2.Text; if (textBoxHeSoKienCo2.Text != String.Empty) { inserted.HeSoKienCo = double.Parse(textBoxHeSoKienCo2.Text); } if (textBoxHeSoPPNo2.Text != String.Empty) { inserted.HeSoPPNo = double.Parse(textBoxHeSoPPNo2.Text); } try { BS_PhuongPhapNo.ThemPhuongPhapNo(inserted); } catch (Exception exc) { MessageBox.Show("Lỗi - " + exc.Message); } ShowPanel(1); HienThiDuLieu_PhuongPhapNo(); }
private void gridViewMain_DoubleClick(object sender, EventArgs e) { ShowPanel(3); PhuongPhapNo focusedRow = gridViewMain.GetFocusedRow() as PhuongPhapNo; textBoxMaPPNo.Text = focusedRow.MaPPNo; textBoxTenPPNo.Text = focusedRow.TenPPNo; textBoxMaCongTruong.Text = focusedRow.MaCongTruong; textBoxHeSoKienCo.Text = focusedRow.HeSoKienCo.ToString(); textBoxHeSoPPNo.Text = focusedRow.HeSoPPNo.ToString(); }