public bool Them(KhachHang khachhang)
        {
            string strSql = string.Format("insert into KhachHang (TenKH, SDT, GioiTinh, DiaChi, SoDiem) values(N'{0}', '{1}', N'{2}', N'{3}', {4})",
                                          khachhang.TenKH, khachhang.SDT, khachhang.GioiTinh, khachhang.DiaChi, khachhang.SoDiem);

            return(_dbConnect.ExecuteNonQuery(strSql));
        }
        public bool Them(NhanVien nhanvien)
        {
            string strSql = string.Format("insert into NhanVien (TenNV, GioiTinh, DiaChi, SDT, MatKhau, ChucDanh, Luong)  values (N'{0}', N'{1}', N'{2}', '{3}', '{4}', N'{5}', {6})",
                                          nhanvien.TenNV, nhanvien.GioiTinh, nhanvien.DiaChi, nhanvien.SDT, nhanvien.MatKhau, nhanvien.ChucDanh, nhanvien.Luong);

            MessageBox.Show(strSql, "Thong bao", MessageBoxButtons.OK);
            return(_dbConnect.ExecuteNonQuery(strSql));
        }
        public bool Them(HangHoa hang)
        {
            string strSql = string.Format("insert into HangHoa (TenHH, DonGia, SoLuong, DVCungCap, NgayNhapHang, NgayHetHan) values(N'{0}', {1}, {2}, N'{3}', '{4}', '{5}')", hang.TenHH, hang.DonGia, hang.SoLuong, hang.DVCungCap, hang.NgayNhapHang.ToString("yyyy-MM-dd"), hang.NgayHetHan.ToString("yyyy-MM-dd"));

            return(_dbConnect.ExecuteNonQuery(strSql));
        }
Exemplo n.º 4
0
        public bool Them(HoaDon hoadon)
        {
            string strSql = string.Format("insert into HoaDon (MaKH, MaNV, NgayLap,Tong) values({0}, {1}, '{2}',{3})", hoadon.MaKH, hoadon.MaNV, hoadon.Ngay.ToString("yyyy-MM-dd"), hoadon.Tong);

            return(_dbConnect.ExecuteNonQuery(strSql));
        }
        public bool Them(ChiTietHoaDon chitietHD)
        {
            string strSql = string.Format("insert into ChiTietHoaDon values({0}, {1}, {2}, {3})", chitietHD.MaHD, chitietHD.MaHH, chitietHD.DonGia, chitietHD.SoLuong);

            return(_dbConnect.ExecuteNonQuery(strSql));
        }