protected void btnSave_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(keyField.Value))//insert
        {
            DIA_DIEM_DU_LICH obj = DIA_DIEM_DU_LICH.Insert_Object(txtTenVanPhong.Text, txtDiaChi.Text, ddlTinhThanh.SelectedValue, txtSoDienThoai.Text, txtMoTa.Text.Replace("'", ""), txtURL.Text.Replace("'", ""));
            if (obj == null)
                HelpControls.ShowMsgBox(this, "Lưu dữ liệu thất bại!");
            else
            {
                InitListData();
                keyField.Value = obj.DIA_DIEM_ID;
                btnSave.Text = "Cập nhật";
            }

        }
        else
        {
            DIA_DIEM_DU_LICH dd = new DIA_DIEM_DU_LICH();
            dd.DIA_DIEM_ID = keyField.Value;
            if (dd.Save_Object(txtTenVanPhong.Text, txtDiaChi.Text, ddlTinhThanh.SelectedValue, txtSoDienThoai.Text, txtMoTa.Text.Replace("'", ""), txtURL.Text.Replace("'", "")))
            {
                InitListData();
            }
            else
            {
                HelpControls.ShowMsgBox(this, "Lưu dữ liệu thất bại!");
            }
        }
    }
        //───────────────────────────────────────────────────────────────────────────────────────
        public static DIA_DIEM_DU_LICH Insert_Object(
            string  sTEN_DIA_DIEM
            ,string  sDIA_CHI
            ,string  sTINH_THANH
            ,string  sSO_DIEN_THOAI
            ,string  sMO_TA
            ,string  sMAP_URL
            )
        {
            string tem_sTEN_DIA_DIEM=MinhTam.DataAccess.Web.SQLToolWeb.GetSaveValue(sTEN_DIA_DIEM,"nvarchar");
              string tem_sDIA_CHI=MinhTam.DataAccess.Web.SQLToolWeb.GetSaveValue(sDIA_CHI,"nvarchar");
              string tem_sTINH_THANH=MinhTam.DataAccess.Web.SQLToolWeb.GetSaveValue(sTINH_THANH,"int");
              string tem_sSO_DIEN_THOAI=MinhTam.DataAccess.Web.SQLToolWeb.GetSaveValue(sSO_DIEN_THOAI,"varchar");
              string tem_sMO_TA=MinhTam.DataAccess.Web.SQLToolWeb.GetSaveValue(sMO_TA,"ntext");
              string tem_sMAP_URL=MinhTam.DataAccess.Web.SQLToolWeb.GetSaveValue(sMAP_URL,"ntext");

             string sqlSave=" INSERT INTO DIA_DIEM_DU_LICH("+
                   "TEN_DIA_DIEM,"
            +                   "DIA_CHI,"
            +                   "TINH_THANH,"
            +                   "SO_DIEN_THOAI,"
            +                   "MO_TA,"
            +                   "MAP_URL) VALUES("
             +tem_sTEN_DIA_DIEM+","
             +tem_sDIA_CHI+","
             +tem_sTINH_THANH+","
             +tem_sSO_DIEN_THOAI+","
             +tem_sMO_TA+","
             +tem_sMAP_URL +")";
             bool OK = Exec(sqlSave)>=1?true:false;
               if (OK)
               {
              DIA_DIEM_DU_LICH newDIA_DIEM_DU_LICH= new DIA_DIEM_DU_LICH();
                 newDIA_DIEM_DU_LICH.DIA_DIEM_ID=GetTable( " SELECT TOP 1 DIA_DIEM_ID FROM DIA_DIEM_DU_LICH ORDER BY DIA_DIEM_ID DESC ").Rows[0][0].ToString();
              newDIA_DIEM_DU_LICH.TEN_DIA_DIEM=sTEN_DIA_DIEM;
              newDIA_DIEM_DU_LICH.DIA_CHI=sDIA_CHI;
              newDIA_DIEM_DU_LICH.TINH_THANH=sTINH_THANH;
              newDIA_DIEM_DU_LICH.SO_DIEN_THOAI=sSO_DIEN_THOAI;
              newDIA_DIEM_DU_LICH.MO_TA=sMO_TA;
              newDIA_DIEM_DU_LICH.MAP_URL=sMAP_URL;
            return newDIA_DIEM_DU_LICH;
               }
               else return null ;
        }