예제 #1
0
        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);
        }
예제 #4
0
        public static void LuuBanAN()
        {
            string sql = "insert into BANAN(TrangThaiBan) Values (0)";

            KetNoiCSDL.NonQuery(sql);
        }
예제 #5
0
        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);
        }
예제 #6
0
        public static void XoaTK(Account acc)
        {
            string sql = "Delete from TAIKHOAN where TenNguoiDung=N'" + acc.TenNguoiDung + "' ";

            KetNoiCSDL.NonQuery(sql);
        }
예제 #7
0
        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);
        }
예제 #10
0
        public static void UpdateTableOfHoaDon(string idTable, string idHoaDon)
        {
            string sql = "update HOADON set idTable = " + idTable + " where id = " + idHoaDon;

            KetNoiCSDL.NonQuery(sql);
        }
예제 #11
0
        public static void InsertLoaiSP(string tenLoai)
        {
            string sql = "Insert into LOAIMON(TenLoai) Values (N'" + tenLoai + "')";

            KetNoiCSDL.NonQuery(sql);
        }
예제 #12
0
        public static void UpdateStatusHoaDon(string idHoaDon, string bit)
        {
            string sql = "update HOADON set TrangThaiHoaDon = " + bit + " where id = " + idHoaDon;

            KetNoiCSDL.NonQuery(sql);
        }
예제 #13
0
        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);
        }
예제 #14
0
        public static void XoaNhanVien(int id)
        {
            string sql = "Delete from NHANVIEN where id='" + id + "' ";

            KetNoiCSDL.NonQuery(sql);
        }
예제 #15
0
        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);
        }
예제 #16
0
        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);
        }
예제 #17
0
        public static void Delete(string idHoaDon, string idMonAn)
        {
            string sql = "delete from CHITIETHOADON where idHoaDon = '" + idHoaDon + "' and idMonAn = '" + idMonAn + "'";

            KetNoiCSDL.NonQuery(sql);
        }
예제 #18
0
        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);
        }
예제 #19
0
        //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);
        }
예제 #20
0
        public static void DeleteSanPham(string id)
        {
            string sql = "delete from MONAN where id = '" + id + "'";

            KetNoiCSDL.NonQuery(sql);
        }
예제 #21
0
        // 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);
        }
예제 #22
0
        public static void Save(string date)
        {
            string sql = "insert into CHAMCONG (Ngay) values ('" + date + "')";

            KetNoiCSDL.NonQuery(sql);
        }
예제 #23
0
        public static void XoaBanAn(string id)
        {
            string sql = "Delete from BANAN where id='" + id + "' ";

            KetNoiCSDL.NonQuery(sql);
        }
예제 #24
0
        //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);
        }