コード例 #1
0
        //Tìm khách thuê theo quê quán
        public DataTable TimKhachThueTheoQueQuan(KhachThue khachthue)
        {
            String sql = "select * from KHACH_THUE where QueQuan like N'%" + khachthue.getQuequan() + "%'";

            rs = manager.executeQuery(sql);
            return(rs);
        }
コード例 #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));
        }
コード例 #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);
        }