//数据收集 //为空时string 返回 “” //其他类型 一律返回dbnull.value //邓太华 2006.8.23 修改,如果数字型的值为空字符串,那么它的值修改为 DBNull.Value 而不是默认的 "0" public object GetValue() { DataTextBoxValue dtbv = new DataTextBoxValue(this); return(dtbv.GetValue()); }
// /// <summary> // /// 获取或者设置文本,如果设置了格式字符串,那么显示文本为格式化后的文本,但是内部处理的时候仍然使用格式化前的文本 // /// </summary> // public override string Text // { // get // { //// if(_BaseText==null) //// { //// if(ViewState["BaseText"]!=null) //// _BaseText=ViewState["BaseText"].ToString (); //// else //// _BaseText= base.Text; //// } //// return _BaseText; // return base.Text; // // } // set // { // if(DataFormatString!="") // base.Text =String.Format(DataFormatString,value); // else // base.Text =value; //// _BaseText=value; //// ViewState["BaseText"]=value; // } // } #endregion #region 接口方法 //呈现数据 public void SetValue(object obj) { DataTextBoxValue dtbv = new DataTextBoxValue(this); dtbv.SetValue(obj); }