Exemple #1
0
 /// <summary>
 /// 多箭头选择按钮事件(右移)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSelectAll_Click(object sender, EventArgs e)
 {
     List<ListItem> listItem = new List<ListItem>();
     foreach (ListItem item in this.lbSource.Items)
     {
         listItem.Add(item);
     }
     foreach (ListItem item in listItem)
     {
         this.lbTarget.Items.Add(item);
         this.lbSource.Items.Remove(item);
     }
 }
Exemple #2
0
        /// <summary>
        /// 单箭头选择按钮事件(右移)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSelect_Click(object sender, EventArgs e)
        {
            if (this.lbSource.SelectedItem == null)
                return;
            List<ListItem> listItem = new List<ListItem>();
            foreach (ListItem item in this.lbSource.Items)
            {
                if (item.Selected == true)
                {
                    listItem.Add(item);

                }
            }
            foreach (ListItem item in listItem)
            {
                this.lbTarget.Items.Add(item);
                this.lbSource.Items.Remove(item);
            }
        }
Exemple #3
0
        /// <summary>
        /// 操作角色对应的功能模块
        /// </summary>
        private void SaveOperate(int intID)
        {
            //先删除对应的功能
            Business.RoleRelOperate.RemoveByRoleID(intID);

            if (Request.Params["idList"] != null)
            {
                //重新添加
                string strList = Request.Params["idList"];
                String[] strArray = strList.Split(',');
                List<DTO.RoleRelOperate> listUser = new List<DTO.RoleRelOperate>();

                for (int i = 0; i < strArray.Length; i++)
                {
                    DTO.RoleRelOperate model = new DTO.RoleRelOperate();
                    model.OperateID = Convert.ToInt32(strArray[i]);
                    model.RoleID = intID;
                    Business.RoleRelOperate.Add(model);
                }
            }
        }