public DataTable TraCuuKhachHang(string tenKH, string diachi)
    {
        string sql = "";

        if (tenKH.CompareTo("") != 0 && diachi.CompareTo("") != 0)
        {
            sql = "select * where TenKH LIKE @tenKH AND DChi LIKE @diachi";
        }
        else
        {
            if (tenKH.CompareTo("") != 0)
            {
                sql = "select * from Tb_KhachHang where TenKH LIKE @tenKH";
            }
            else
            {
                sql = "select * from Tb_KhachHang where DChi LIKE @diachi";
            }
        }
        SqlParameter[] thamso = { new SqlParameter("@tenKH",  "%" + tenKH + "%"),
                                  new SqlParameter("@diachi", "%" + diachi + "%") };
        DataTable      d = ConnectToDB.Truyvan_TraVe_Table_co_Thamso(sql, thamso);

        da = ConnectToDB.Truyvan_TraVe_DataAdapter_co_Thamso(sql, thamso);
        return(d);
    }
Exemple #2
0
    //Tra cuu nhan vien
    public DataTable TraCuuNhanVien(string LoaiNV, string TenTV)
    {
        string sql = "";

        if (LoaiNV.CompareTo("") != 0 && TenTV.CompareTo("") != 0)
        {
            sql = "select * from Tb_ThongTinNhanVien where MaLoaiNV=@MaLoaiNV AND TenNV LIKE @TenNV";
        }
        else
        {
            if (LoaiNV.CompareTo("") != 0)
            {
                sql = "select * from Tb_ThongTinNhanVien where MaLoaiNV=@MaLoaiNV";
            }
            else
            {
                sql = "select * from Tb_ThongTinNhanVien where TenNV LIKE @TenNV";
            }
        }
        SqlParameter[] thamso = { new SqlParameter("@MaLoaiNV", LoaiNV),
                                  new SqlParameter("@TenNV",    "%" + TenTV + "%") };
        DataTable      DT_DSNhanVien = ConnectToDB.Truyvan_TraVe_Table_co_Thamso(sql, thamso);

        return(DT_DSNhanVien);
    }
Exemple #3
0
    //Truy Van Lay ra thanh vien cham cong vao thang nam
    public DataTable LayRaChamCongThanhVien(string MaNV, int Thang, int Nam)
    {
        string sql = "select * from Tb_ChamCong where MaNV=@MaNV AND Thang=@Thang AND Nam=@Nam";

        SqlParameter[] thamso = { new SqlParameter("@MaNV",  MaNV),
                                  new SqlParameter("@Thang", Thang),
                                  new SqlParameter("@Nam",   Nam) };
        return(ConnectToDB.Truyvan_TraVe_Table_co_Thamso(sql, thamso));
    }