public int Update_KhuCanHo(KhuCanHoDAL kch)
        {
            //Check bieu thuc chinh quy
            string query = "UPDATE KHUCANHO SET tenKhu='" + kch.tenKhu + "', soTang=" + kch.soTang + ", soCanHo=" + kch.soCan + ",diaChi=N'" + kch.diaChi + "' where maKhu='" + kch.maKhu + "'";

            return(DataProvider.Instance.ExcuteNonQuery(query));
            //Return Thong bao loi hoac thanh cong
        }
Ejemplo n.º 2
0
 public EditKhuCanHo(KhuCanHoDAL kch)
 {
     InitializeComponent();
     soCan_suaKhuCanHo.Text  = kch.soCan.ToString();
     soTang_suaKhuCanHo.Text = kch.soTang.ToString();
     diaChi_suaKhuCanHo.Text = kch.diaChi;
     maKhu_suaKhuCanHo.Text  = kch.maKhu;
     tenKhu_suaKhuCanHo.Text = kch.tenKhu;
 }
        public int Del_KhuCanHo(KhuCanHoDAL kch)
        {
            string query = "DELETE KHUCANHO WHERE maKhu='" + kch.maKhu + "'";

            return(DataProvider.Instance.ExcuteNonQuery(query));
        }
        public int Add_KhuCanHo(KhuCanHoDAL kch)
        {
            string query = "insert into KHUCANHO values('" + kch.maKhu + "', '" + kch.tenKhu + "', " + kch.soCan + ", " + kch.soTang + ", N'" + kch.diaChi + "');";

            return(DataProvider.Instance.ExcuteNonQuery(query));
        }