public static void Insert(DTO.CTHD item) { string sql = "insert into CHITIETHOADON(idHoaDon, idMonAn, SoLuong) values ('" + item.IdHoaDon + "', '" + item.IdMonAn + "', " + item.SoLuong + ")"; KetNoiCSDL.NonQuery(sql); }
public static void Save(string idChamCong, string idNhanVien, string GioBatDau, string GioKetThuc) { string sql = "insert into CHAMCONGNHANVIEN (idChamCong, idNhanVien, GioBatDau, GioKetThuc) values ('" + idChamCong + "', '" + idNhanVien + "', '" + GioBatDau + "', '" + GioKetThuc + "')"; KetNoiCSDL.NonQuery(sql); }
public static void Update(string idChamCong, string idNhanVien, string GioKetThuc) { string sql = "update CHAMCONGNHANVIEN set GioKetThuc='" + GioKetThuc + "' where idChamCong = '" + idChamCong + "' and idNhanVien= '" + idNhanVien + "'"; KetNoiCSDL.NonQuery(sql); }
public static void LuuBanAN() { string sql = "insert into BANAN(TrangThaiBan) Values (0)"; KetNoiCSDL.NonQuery(sql); }
public static void SuaNhanVien(Employee emp) { string sql = "Update NHANVIEN set TenNhanVien= N'" + emp.TenNhanVien + "' ,NgaySinh='" + String.Format("{0:MM/dd/yyyy}", emp.NgaySinh) + "', DiaChi=N'" + emp.DiaChi + "', Sdt='" + emp.Sdt + "', TenTaiKhoan='" + emp.TenTaiKhoan + "', idChucVu='" + emp.IdChucVu + "' where id ='" + emp.Id + "'"; KetNoiCSDL.NonQuery(sql); }
public static void XoaTK(Account acc) { string sql = "Delete from TAIKHOAN where TenNguoiDung=N'" + acc.TenNguoiDung + "' "; KetNoiCSDL.NonQuery(sql); }
public static void SuaTK(Account acc) { string sql = "Update TAIKHOAN set TenHienThi=N'" + acc.TenHienThi + "', LoaiTK= N'" + acc.LoaiTK + "' where TenNguoiDung=N'" + acc.TenNguoiDung + "' "; KetNoiCSDL.NonQuery(sql); }
public static void UpdateLoaiSP(DTO.Category loai) { string sql = "update LOAIMON set TenLoai = N'" + loai.TenLoai + "' where id = '" + loai.Id + "'"; KetNoiCSDL.NonQuery(sql); }
public static void DeleteLoaiSP(string id) { string sql = "delete from LOAIMON where id = '" + id + "'"; KetNoiCSDL.NonQuery(sql); }
public static void UpdateTableOfHoaDon(string idTable, string idHoaDon) { string sql = "update HOADON set idTable = " + idTable + " where id = " + idHoaDon; KetNoiCSDL.NonQuery(sql); }
public static void InsertLoaiSP(string tenLoai) { string sql = "Insert into LOAIMON(TenLoai) Values (N'" + tenLoai + "')"; KetNoiCSDL.NonQuery(sql); }
public static void UpdateStatusHoaDon(string idHoaDon, string bit) { string sql = "update HOADON set TrangThaiHoaDon = " + bit + " where id = " + idHoaDon; KetNoiCSDL.NonQuery(sql); }
public static void InsertBill(int idTable, int idNhanVien) { string sql = "insert into HOADON(ThoiGianVao, ThoiGianRa, idTable, idNhanVien, TrangThaiHoaDon)values('" + String.Format("{0:MM/dd/yyyy}", DateTime.Now) + "', '" + String.Format("{0:MM/dd/yyyy}", DateTime.Now) + "', " + idTable + ", " + idNhanVien + ", 0)"; KetNoiCSDL.NonQuery(sql); }
public static void XoaNhanVien(int id) { string sql = "Delete from NHANVIEN where id='" + id + "' "; KetNoiCSDL.NonQuery(sql); }
public static void Update(DTO.CTHD item) { string sql = "update CHITIETHOADON set SoLuong = SoLuong + " + item.SoLuong + " where idHoaDon = '" + item.IdHoaDon + "' and idMonAn = '" + item.IdMonAn + "'"; KetNoiCSDL.NonQuery(sql); }
public static void InsertSanPham(DTO.Food food) { string sql = "Insert into MONAN(TenMon, idLoaiMon, GiaTien) Values (N'" + food.TenMon + "', " + food.IdLoaiMon + ", " + food.GiaTien + ")"; KetNoiCSDL.NonQuery(sql); }
public static void Delete(string idHoaDon, string idMonAn) { string sql = "delete from CHITIETHOADON where idHoaDon = '" + idHoaDon + "' and idMonAn = '" + idMonAn + "'"; KetNoiCSDL.NonQuery(sql); }
public static void UpdateSanPham(DTO.Food food) { string sql = "update MONAN set TenMon = N'" + food.TenMon + "', idLoaiMon = '" + food.IdLoaiMon + "', GiaTien = '" + food.GiaTien + "' where id = '" + food.Id + "'"; KetNoiCSDL.NonQuery(sql); }
//Thêm-xóa-sửa public static void ThemTK(Account acc) { string sql = "INSERT INTO TAIKHOAN (TenNguoiDung, TenHienThi, MatKhau, LoaiTK) VALUES (N'" + acc.TenNguoiDung + "', N'" + acc.TenHienThi + "', HASHBYTES('SHA2_256', N'" + acc.MatKhau + "'), N'" + acc.LoaiTK + "' ) "; KetNoiCSDL.NonQuery(sql); }
public static void DeleteSanPham(string id) { string sql = "delete from MONAN where id = '" + id + "'"; KetNoiCSDL.NonQuery(sql); }
// Thay đổi trạng thái bàn public static void ChangeTableStatus(string id, string bit) { string sql = "update BANAN set TrangThaiBan = '" + bit + "' where id = '" + id + "'"; KetNoiCSDL.NonQuery(sql); }
public static void Save(string date) { string sql = "insert into CHAMCONG (Ngay) values ('" + date + "')"; KetNoiCSDL.NonQuery(sql); }
public static void XoaBanAn(string id) { string sql = "Delete from BANAN where id='" + id + "' "; KetNoiCSDL.NonQuery(sql); }
//Thêm-xóa-sửa public static void ThemNhanVien(Employee emp) { string sql = "Insert into NHANVIEN(TenNhanVien, NgaySinh, DiaChi, Sdt, TenTaiKhoan, idChucVu)values (N'" + emp.TenNhanVien + "', '" + String.Format("{0:MM/dd/yyyy}", emp.NgaySinh) + "', N'" + emp.DiaChi + "', '" + emp.Sdt + "', '" + emp.TenTaiKhoan + "', '" + emp.IdChucVu + "') "; KetNoiCSDL.NonQuery(sql); }