Exemplo n.º 1
0
        //Tìm khách thuê theo nghề nghiệp
        public DataTable TimKhachThueTheoNgheNghiep(KhachThue khachthue)
        {
            String sql = "select * from KHACH_THUE where NgheNghiep like N'%" + khachthue.getNgheNghiep() + "%'";

            rs = manager.executeQuery(sql);
            return(rs);
        }
Exemplo n.º 2
0
        //Sửa khách thuê
        public bool SuaKhachthue(KhachThue khachthue)
        {
            SqlParameter p1 = new SqlParameter("@makhach", khachthue.getMaKhach());
            SqlParameter p2 = new SqlParameter("@tenkhach", khachthue.getTenKhach());
            SqlParameter p3 = new SqlParameter("@phai", khachthue.getPhai());
            SqlParameter p4 = new SqlParameter("@cmnd", khachthue.getCmnd());
            SqlParameter p5 = new SqlParameter("@quequan", khachthue.getQuequan());
            SqlParameter p6 = new SqlParameter("@nghenghiep", khachthue.getNgheNghiep());


            SqlParameter[] giatri = { p1, p2, p3, p4, p5, p6 };
            return(manager.Update(@"dbo.[SuaKhachThue]", giatri));
        }
Exemplo n.º 3
0
        //thêm khách thuê
        public void ThemKhachthue(KhachThue khachthue)
        {
            SqlParameter p1 = new SqlParameter("@makhach", khachthue.getMaKhach());
            SqlParameter p2 = new SqlParameter("@tenkhach", khachthue.getTenKhach());
            SqlParameter p3 = new SqlParameter("@phai", khachthue.getPhai());
            SqlParameter p4 = new SqlParameter("@cmnd", khachthue.getCmnd());
            SqlParameter p5 = new SqlParameter("@quequan", khachthue.getQuequan());
            SqlParameter p6 = new SqlParameter("@nghenghiep", khachthue.getNgheNghiep());

            //String insert = "insert into KHACH_THUE values (@makhach, @tenkhach, @phai, @cmnd, @quequan, @nghenghiep)";

            SqlParameter[] giatri = { p1, p2, p3, p4, p5, p6 };

            manager.Update(@"dbo.[ThemKhachThue]", giatri);
        }