private void btnThanhToan_Click(object sender, EventArgs e) { try { using (var k = new AppCode.QuanCafe()) { var timhd = k.TimHoaDon(AppCode.STHoaDon.idHoaDon); timhd.TrangThai = true; timhd.GiamGia = TinhTien.giamgia; //MessageBox.Show(timhd.GiamGia.ToString()); k.SuaHD(timhd); var timban = k.TimBan(AppCode.STBan.idBan); //cap nhat timban.TrangThai = "Trống"; k.CapNhatBan(timban); txtGiamGia.Text = string.Empty; txtTamTinh.Text = string.Empty; txtTongTien.Text = string.Empty; flpDSBan.Controls.Clear(); LoadDSBan(); grvCTBanTest.DataSource = null; fThanhToan f = new fThanhToan(); f.ShowDialog(); } } catch { } }
//Phim tat private void fManager_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.F) { TimKiem(); } if (e.Control && e.KeyCode == Keys.E) { this.Close(); } if (e.Control && e.KeyCode == Keys.R) { hóaĐơnToolStripMenuItem_Click(sender, e); } if (e.Control && e.KeyCode == Keys.T) { try { using (var k = new AppCode.QuanCafe()) { var timhd = k.TimHoaDon(AppCode.STHoaDon.idHoaDon); timhd.TrangThai = true; timhd.GiamGia = TinhTien.giamgia; //MessageBox.Show(timhd.GiamGia.ToString()); k.SuaHD(timhd); var timban = k.TimBan(AppCode.STBan.idBan); timban.TrangThai = "Trống"; k.CapNhatBan(timban); flpDSBan.Controls.Clear(); LoadDSBan(); grvCTBanTest.DataSource = null; fThanhToan f = new fThanhToan(); f.ShowDialog(); } } catch { } } }
private void btnHuyBan_Click(object sender, EventArgs e) { if (MessageBox.Show("Bạn muốn hủy bàn này?", "Thông báo", MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk) != System.Windows.Forms.DialogResult.Cancel) { var kqtimban = XuLyDuLieu.DocDuLieu("EXEC SP_TimBan '" + AppCode.STBan.idBan + "' "); var tenban = kqtimban.Rows[0]["TenBan"].ToString(); int idban = AppCode.STBan.idBan; XuLyDuLieu.ThucThiThemXoaSua("SP_UPDATE_BAN '" + idban + "','" + tenban + "',Trống"); try { using (var k = new AppCode.QuanCafe()) { var timhd = k.TimHoaDon(AppCode.STHoaDon.idHoaDon); timhd.TrangThai = true; timhd.GiamGia = TinhTien.giamgia; //MessageBox.Show(timhd.GiamGia.ToString()); k.SuaHD(timhd); var timban = k.TimBan(AppCode.STBan.idBan); //cap nhat timban.TrangThai = "Trống"; k.CapNhatBan(timban); txtGiamGia.Text = "0"; txtTamTinh.Text = "0"; txtTongTien.Text = "0"; lblTenBan.Text = ""; grvCTBanTest.DataSource = null; } } catch { } flpDSBan.Controls.Clear(); LoadDSBan(); } }