/// <summary>
        /// 获取权限列表
        /// </summary>
        private void GetRole()
        {
            List <SeatManage.ClassModel.SysRolesDicInfo> rolelist = SeatManage.Bll.SysRolesDic.GetRoleList(null, null);

            foreach (SeatManage.ClassModel.SysRolesDicInfo roleinfo in rolelist)
            {
                FineUI.CheckItem ci = new FineUI.CheckItem();
                ci.Text  = roleinfo.RoleName;
                ci.Value = roleinfo.RoleID;
                clbRole.Items.Add(ci);
            }
            //clbRole.DataTextField = "RoleName";
            //clbRole.DataValueField = "RoleID";
            //clbRole.DataSource = rolelist;
            //clbRole.DataBind();
            List <SeatManage.ClassModel.ReadingRoomInfo> roomlist = SeatManage.Bll.T_SM_ReadingRoom.GetReadingRooms(null, null, null);

            foreach (SeatManage.ClassModel.ReadingRoomInfo room in roomlist)
            {
                FineUI.CheckItem ci = new FineUI.CheckItem();
                ci.Text  = (room.Name + "(" + room.No + ")");
                ci.Value = room.No;
                clbroom.Items.Add(ci);
            }
            //clbroom.DataTextField = "Name";
            //clbroom.DataValueField = "No";
            //clbroom.DataSource = roomlist;
            //clbroom.DataBind();
        }
Ejemplo n.º 2
0
        private CheckItem CreateCheckItem(Object obj)
        {
            CheckItem item = new CheckItem();

            if (obj is string)
            {
                item.Text  = obj.ToString();
                item.Value = obj.ToString();
            }
            else
            {
                if (!String.IsNullOrEmpty(DataTextField))
                {
                    if (!String.IsNullOrEmpty(DataTextFormatString))
                    {
                        item.Text = String.Format(DataTextFormatString, GetPropertyValue(obj, DataTextField));
                    }
                    else
                    {
                        item.Text = GetPropertyValue(obj, DataTextField);
                    }
                }
                else
                {
                    item.Text = obj.ToString();
                }

                if (!String.IsNullOrEmpty(DataValueField))
                {
                    item.Value = GetPropertyValue(obj, DataValueField);
                }
                else
                {
                    item.Value = obj.ToString();
                }
            }
            return(item);
        }
Ejemplo n.º 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[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);
        }
Ejemplo n.º 4
0
        private CheckItem CreateCheckItem(Object obj)
        {
            CheckItem item = new CheckItem();
            if (obj is string)
            {
                item.Text = obj.ToString();
                item.Value = obj.ToString();
            }
            else
            {
                if (!String.IsNullOrEmpty(DataTextField))
                {
                    if (!String.IsNullOrEmpty(DataTextFormatString))
                    {
                        item.Text = String.Format(DataTextFormatString, GetPropertyValue(obj, DataTextField));
                    }
                    else
                    {
                        item.Text = GetPropertyValue(obj, DataTextField);
                    }
                }
                else
                {
                    item.Text = obj.ToString();
                }

                if (!String.IsNullOrEmpty(DataValueField))
                {
                    item.Value = GetPropertyValue(obj, DataValueField);
                }
                else
                {
                    item.Value = obj.ToString();
                }
            }
            return item;
        }