Exemplo n.º 1
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.º 2
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);
        }