Example #1
0
 /// <summary>
 /// 处理回发数据
 /// </summary>
 /// <param name="postDataKey">回发数据键</param>
 /// <param name="postCollection">回发数据集</param>
 /// <returns>回发数据是否改变</returns>
 public bool LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
 {
     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;
             XState.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;
                 XState.BackupPostDataProperty("Checked");
                 return(true);
             }
         }
     }
     return(false);
 }
Example #2
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 postValue = postCollection[postDataKey];

            if (SelectedValue != postValue)
            {
                ListItem item = Items.FindByValue(postValue);
                if (item != null)
                {
                    SelectedValue = postValue;
                    XState.BackupPostDataProperty("SelectedValue");
                    return(true);
                }
                else
                {
                    if (!ForceSelection)
                    {
                        SelectedValue = null;
                        XState.BackupPostDataProperty("SelectedValue");

                        Text = postValue;
                        XState.BackupPostDataProperty("Text");
                        return(true);
                    }
                }
            }
            return(false);
        }
Example #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)
        {
            bool postCollapsed = Convert.ToBoolean(postCollection[CollapsedHiddenFieldID]);

            if (Collapsed != postCollapsed)
            {
                Collapsed = postCollapsed;
                XState.BackupPostDataProperty("Collapsed");
                return(true);
            }

            return(false);
        }
Example #4
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[ActiveTabIndexHiddenFieldID];

            int postActiveTabIndex = Convert.ToInt32(postValue);

            if (ActiveTabIndex != postActiveTabIndex)
            {
                ActiveTabIndex = postActiveTabIndex;
                XState.BackupPostDataProperty("ActiveTabIndex");
                return(true);
            }
            return(false);
        }
Example #5
0
File: Tab.cs Project: xlfj5211/esb
        /// <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;
                XState.BackupPostDataProperty("Hidden");
                return(true);
            }

            return(false);
        }
Example #6
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);

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

            return(false);
        }
Example #7
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;
                    XState.BackupPostDataProperty("Pressed");
                    return(true);
                }
            }

            return(false);
        }
Example #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 postValue = postCollection[postDataKey];

            if (postValue != null && SelectedValue != postValue)
            {
                RadioItem item = Items.FindByValue(postValue);
                if (item != null)
                {
                    SelectedValue = postValue;
                    XState.BackupPostDataProperty("SelectedValue");
                    return(true);
                }
            }
            return(false);
        }
Example #9
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;
                    XState.BackupPostDataProperty("SelectedDate");
                    return(true);
                }
            }

            return(false);
        }
Example #10
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;
                XState.BackupPostDataProperty("Text");
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #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)
        {
            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;
                    XState.BackupPostDataProperty("Text");
                    return(true);
                }
            }
            return(false);
        }
Example #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[postDataKey];

            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();
            if (!StringUtil.CompareStringArray(selectedValueArray, SelectedValueArray))
            {
                SelectedValueArray = selectedValueArray;
                XState.BackupPostDataProperty("SelectedValueArray");
                return(true);
            }

            /*
             * if (postValue != null && SelectedValue != postValue)
             * {
             *  CheckItem item = Items.FindByValue(postValue);
             *  if (item != null)
             *  {
             *      SelectedValue = postValue;
             *      XState.BackupPostDataProperty("SelectedValue");
             *      return true;
             *  }
             * }
             */
            return(false);
        }