Пример #1
0
        //private void AfterDataBind()
        //{
        //    //// 必须重新计算模拟数的数据
        //    //mustReCalculateSimulateTreeData = true;
        //}

        #endregion

        #region IPostBackDataHandler Members

        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            string postText  = postCollection[postDataKey];
            string postValue = postCollection[SelectedValueHiddenFieldID];

            ListItem item = Items.FindByValue(postValue);

            if (item != null && item.Text == postText)
            {
                // 本次选中的是下拉项
                if (SelectedValue != postValue)
                {
                    SelectedValue = postValue;
                    FState.BackupPostDataProperty("SelectedValue");
                    return(true);
                }
            }
            else
            {
                // 本次是用户输入的值
                if (Text != postText)
                {
                    SelectedValue = null;
                    FState.BackupPostDataProperty("SelectedValue");

                    Text = postText;
                    FState.BackupPostDataProperty("Text");
                    return(true);
                }
            }


            return(false);
        }
Пример #2
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public virtual bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            bool postCollapsed = Convert.ToBoolean(postCollection[CollapsedHiddenFieldID]);

            if (Collapsed != postCollapsed)
            {
                Collapsed = postCollapsed;
                FState.BackupPostDataProperty("Collapsed");
            }

            return(false);
        }
Пример #3
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public virtual bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            string postValue = postCollection[ActiveTabIndexHiddenFieldID];

            int postActiveTabIndex = Convert.ToInt32(postValue);

            if (ActiveTabIndex != postActiveTabIndex)
            {
                ActiveTabIndex = postActiveTabIndex;
                FState.BackupPostDataProperty("ActiveTabIndex");
            }

            return(false);
        }
Пример #4
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            if (EnablePress)
            {
                bool pressed = Convert.ToBoolean(postCollection[PressedHiddenFieldID]);
                if (pressed != Pressed)
                {
                    Pressed = pressed;
                    FState.BackupPostDataProperty("Pressed");
                }
            }

            return(false);
        }
Пример #5
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public virtual bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            //string postValue = postCollection[postDataKey];
            string[] selectedValueArray = StringUtil.GetStringListFromString(postCollection[SelectedValueArrayHiddenFieldID]).ToArray();
            string   postValue          = selectedValueArray.Length > 0 ? selectedValueArray[0] : String.Empty;

            if (SelectedValue != postValue)
            {
                SelectedValue = postValue;
                FState.BackupPostDataProperty("SelectedValue");
                return(true);
            }
            return(false);
        }
Пример #6
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public override bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            base.LoadPostData(postDataKey, postCollection);

            bool postHidden = Convert.ToBoolean(postCollection[HiddenHiddenFieldID]);

            if (Hidden != postHidden)
            {
                Hidden = postHidden;
                FState.BackupPostDataProperty("Hidden");
            }

            return(false);
        }
Пример #7
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            //string postValue = postCollection[postDataKey];
            //bool postChecked = !String.IsNullOrEmpty(postValue);
            bool postChecked = Convert.ToBoolean(postCollection[CheckedHiddenFieldID]);

            if (Checked != postChecked)
            {
                Checked = postChecked;
                FState.BackupPostDataProperty("Checked");
                return(true);
            }

            return(false);
        }
Пример #8
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public virtual bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            string postSelectedDateStr = postCollection[SelectedDateHiddenFieldID];

            if (!String.IsNullOrEmpty(postSelectedDateStr))
            {
                DateTime currentSelectedDate = DateTime.ParseExact(postSelectedDateStr, DateFormatString, CultureInfo.InvariantCulture);
                if (currentSelectedDate != SelectedDate)
                {
                    SelectedDate = currentSelectedDate;
                    FState.BackupPostDataProperty("SelectedDate");
                }
            }

            return(false);
        }
Пример #9
0
        /// <summary>
        /// 处理回发数据
        /// 回发到服务器,判断控件的属性是否变化,
        /// 如果变化返回true,则RaisePostDataChangedEvent
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            string postValue = postCollection[UniqueID];

            //// Extjs4.0.1 没能正确的设置 htmleditor 的提交隐藏字段,这个在更高版本中可能要删除
            //string postValue = postCollection[ClientID + "_Text"];

            if (postValue != null && Text != postValue)
            {
                Text = postValue;
                FState.BackupPostDataProperty("Text");
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #10
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            // 不管单选框是否在分组中,每个单选框的Checked都在POST参数中
            bool postChecked = Convert.ToBoolean(postCollection[CheckedHiddenFieldID]);

            if (Checked != postChecked)
            {
                Checked = postChecked;
                FState.BackupPostDataProperty("Checked");
                return(true);
            }

            //if (String.IsNullOrEmpty(GroupName))
            //{
            //    // This radio button is not in a group
            //    string postValue = postCollection[postDataKey];
            //    bool postChecked = !String.IsNullOrEmpty(postValue);
            //    if (Checked != postChecked)
            //    {
            //        Checked = postChecked;
            //        FState.BackupPostDataProperty("Checked");
            //        return true;
            //    }
            //}
            //else
            //{
            //    // This radio is in a group
            //    string postValue = postCollection[GroupName];
            //    if (!String.IsNullOrEmpty(postValue))
            //    {
            //        bool postChecked = (ClientID == postValue) ? true : false;
            //        if (Checked != postChecked)
            //        {
            //            Checked = postChecked;
            //            FState.BackupPostDataProperty("Checked");
            //            return true;
            //        }
            //    }
            //}

            return(false);
        }
Пример #11
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public virtual bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            //List<string> selectedValues = new List<string>();
            //for (int i = 0, count = Items.Count; i < count; i++)
            //{
            //    if (!String.IsNullOrEmpty(postCollection[postDataKey + "_" + i.ToString()]))
            //    {
            //        CheckItem item = Items[i];
            //        selectedValues.Add(item.Value);
            //    }
            //}
            //string[] selectedValueArray = selectedValues.ToArray();

            string[] selectedValueArray = StringUtil.GetStringListFromString(postCollection[SelectedValueArrayHiddenFieldID]).ToArray();
            if (!StringUtil.CompareStringArray(selectedValueArray, SelectedValueArray))
            {
                SelectedValueArray = selectedValueArray;
                FState.BackupPostDataProperty("SelectedValueArray");
                return(true);
            }

            return(false);
        }
Пример #12
0
        /// <summary>
        /// 处理回发数据
        /// </summary>
        /// <param name="postDataKey">回发数据键</param>
        /// <param name="postCollection">回发数据集</param>
        /// <returns>回发数据是否改变</returns>
        public virtual bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
            string postValue = postCollection[UniqueID];

            // 只有启用表单控件时,才判断Text是否改变
            // 对于TextBox,如果禁用了(disabled="disabled")则postValue == null,也就是说此表单字段不会提交到服务器(这是浏览器行为)。
            if (Enabled)
            {
                // If post value is empty, null or equals to the EmptyText property, we can consider it to be String.Empty.
                if (String.IsNullOrEmpty(postValue) || postValue == EmptyText)
                {
                    postValue = String.Empty;
                }

                if (Text != postValue)
                {
                    Text = postValue;
                    FState.BackupPostDataProperty("Text");
                    return(true);
                }
            }
            return(false);
        }