public static bool ThemGia(GiaDTO g) { string sql = string.Format("set dateformat DMY insert into Gia values (convert(varchar(10),'{0}', 103), {1}, {2})", g.NgayADGia, g.MaTD, g.Gia); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaThucDonTheoMaTD(int maTD) { string sql = "delete ThucDon where MaThucDon = " + maTD; bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool CapNhatGia(GiaDTO g) { string sql = string.Format("set dateformat DMY update Gia set NgayADGia = '{0}', Gia = {1} where MaThucDon = {2}", g.NgayADGia, g.Gia, g.MaTD); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemThucDon(ThucDonDTO td) { string sql = string.Format("insert into ThucDon values ({0}, {1}, '{2}', '{3}')", td.MaTD, td.MaLoai, td.TenTD, td.DonViTinh); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool CapNhatThucDon(ThucDonDTO td) { string sql = string.Format("update ThucDon set MaLoai = {0}, TenThucDon = N'{1}', DonViTinh = N'{2}' where MaThucDon = {3}", td.MaLoai, td.TenTD, td.DonViTinh, td.MaTD); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaGiaTheoMaTDVaNgayAD(int maTD, DateTime ngayAD) { string sql = string.Format("set dateformat DMY delete Gia where MaThucDon = {0} and convert(varchar(10),NgayADGia, 103) = convert(varchar(10), convert(datetime,'{1}'), 103)", maTD, ngayAD); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool CapNhatSoKhach(int SoKhach, int SoHD) { string sql = string.Format("update HoaDon set SoKhach = {0} where SoHD = {1}", SoKhach, SoHD); bool kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaCTHDTheoSoHDVaMaTD(int soHD, int maTD) { bool kq; string sql = string.Format("delete ChiTietHD where SoHD = {0} and MaThucDon = {1}", soHD, maTD); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool CapNhatNhanVien(NhanVienDTO nv) { bool kq; string sql = string.Format("set dateformat DMY update NhanVien set HoTen = N'{0}', NgaySinh = convert(varchar(10),'{1}',103), TenDN = '{2}', MatKhau = '{3}', Quyen = N'{4}' where MaNV = {5}", nv.HoTen, nv.NgaySinh, nv.TenDN, nv.MatKhau, nv.Quyen, nv.MaNV); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaGoiMonTheoMaBan(int maBan) { bool kq; string sql = string.Format("delete from GoiMon where MaSoBan = {0}", maBan); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaChiTietGoiMonTheoMaCTGM(int maCTGM) { bool kq; string sql = string.Format("delete from ChiTietGoiMon where MaCTGoiMon = {0}", maCTGM); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool CapNhatChiTietGoiMonTheoMaGoiMon(ChiTietGoiMonDTO ctgm) { bool kq; string sql = string.Format("update ChiTietGoiMon set MaThucDon = {0), SoLuong = {1} where MaGoiMon where MaGoiMon = {2}", ctgm.MaTD, ctgm.SoLuong, ctgm.MaGoiMon); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaPhanCong(PhanCongDTO pc) { bool kq; string sql = string.Format("delete PhanCong where Ca = {0} and MaNV = {1} and MaSoBan = {2}", pc.Ca, pc.MsNV, pc.MsBan); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemPhanCong(PhanCongDTO pc) { bool kq; string sql = string.Format("insert into PhanCong values({0}, {1}, {2})", pc.Ca, pc.MsNV, pc.MsBan); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaNhanVien(int maNV) { bool kq; string sql = string.Format("delete from NhanVien where MaNV = {0}", maNV); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemChiTietHoaDon(CT_HoaDonDTO cthd) { bool kq; string sql = string.Format("insert into ChiTietHD values ({0}, {1}, {2}, {3})", cthd.SoHD, cthd.MaTD, cthd.SoLuong, cthd.DonGia); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool XoaHDTheoSoHD(int SoHD) { bool kq; string sql = string.Format("delete HoaDon where SoHD = {0}", SoHD); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool CapNhatLapHoaDon(HoaDonDTO hd) { string sql = string.Format("set dateformat DMY update HoaDon set ThoiGianLap = '{0}', MaNVTT = {1}, TongTien = {2} where SoHD = {3}", DateTime.Now, hd.MsNVTT, hd.TongTien, hd.SoHD); bool kq; kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool LapHoaDon(HoaDonDTO hd) { hd.SoHD = MaTuTang(); string sql = string.Format("set dateformat DMY insert into HoaDon values ({0}, '{1}', {2}, {3}, {4}, {5}, {6})", hd.SoHD, DateTime.Now, hd.MsBan, hd.SoKhach, hd.MsNVLap, hd.MsNVTT, hd.TongTien); bool kq; kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemNguoiDung(NguoiDungDTO nd) { nd.MaND = MaTuTang(); bool kq; string sql = string.Format("insert into NguoiDung values ({0}, '{1}', '{2}', '{3}', '{4}')", nd.MaND, nd.TenDN, nd.MatKhau, nd.HoTen, nd.Quyen); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemGoiMon(GoiMonDTO gm) { gm.MaGoiMon = MaTuTang(); bool kq; string sql = string.Format("insert into GoiMon values ({0}, {1})", gm.MaGoiMon, gm.MsBan); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemNhanVien(NhanVienDTO nv) { nv.MaNV = MaTuTang(); bool kq; string sql = string.Format("set dateformat DMY insert into NhanVien values ({0}, N'{1}', convert(varchar(10),'{2}',103), N'{3}', N'{4}', N'{5}')", nv.MaNV, nv.HoTen, nv.NgaySinh, nv.TenDN, nv.MatKhau, nv.Quyen); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }
public static bool ThemChiTietGoiMon(ChiTietGoiMonDTO ctgm) { bool kq; ctgm.MaCTGoiMon = MaTuTang(); string sql = string.Format("insert into ChiTietGoiMon values ({0}, {1}, {2}, {3}, {4})", ctgm.MaCTGoiMon, ctgm.MaGoiMon, ctgm.MaTD, ctgm.DonGia, ctgm.SoLuong); kq = SqlDataAccessHelper.ExecuteNonQuery(sql); return(kq); }