private void Edit(DataGridViewRow row) { AppState.state = Actions.EDIT; int maVe = (int)row.Cells["MaVe"].Value; int maCB = (int)row.Cells["MaCB"].Value; string tenHK = (string)row.Cells["TenHK"].Value; string cmnd = (string)row.Cells["CMND"].Value; string dienThoai = (string)row.Cells["DienThoai"].Value; DateTime thoiGian = (DateTime)row.Cells["ThoiGian"].Value; HangVe hv = (HangVe)row.Cells["HV"].Value; int giaVe = (int)row.Cells["GiaVe"].Value; Ve ve = new Ve(maVe, maCB, tenHK, cmnd, dienThoai, thoiGian, hv, giaVe); var dialog = new frmVeEditing(ve); DialogResult res = dialog.ShowDialog(); if (res == DialogResult.OK) { if (BLL_Ve.UpdateVe(dialog.ve)) { Notification.Show("Chỉnh sửa vé thành công", Status.SUCCESS); } reloadData(); } AppState.state = Actions.NOTHING; }
public override void Create() { AppState.state = Actions.ADD; var dialog = new frmVeEditing(); DialogResult res = dialog.ShowDialog(); if (res == DialogResult.OK) { int newMave = BLL_IdenMaVe.GetNewMaVe(); if (BLL_Ve.InsertVe(dialog.ve, newMave)) { Notification.Show("Bán vé thành công", Status.SUCCESS); BLL_IdenMaVe.ClearIden(); } reloadData(); } AppState.state = Actions.NOTHING; }
private void Detail(DataGridViewRow row) { int maVe = (int)row.Cells["MaVe"].Value; int maCB = (int)row.Cells["MaCB"].Value; string tenHK = (string)row.Cells["TenHK"].Value; string cmnd = (string)row.Cells["CMND"].Value; string dienThoai = (string)row.Cells["DienThoai"].Value; DateTime thoiGian = (DateTime)row.Cells["ThoiGian"].Value; HangVe hv = (HangVe)row.Cells["HV"].Value; int giaVe = (int)row.Cells["GiaVe"].Value; Ve ve = new Ve(maVe, maCB, tenHK, cmnd, dienThoai, thoiGian, hv, giaVe); var dialog = new frmVeEditing(ve); DialogResult res = dialog.ShowDialog(); if (res == DialogResult.OK) { } }