示例#1
0
        /// <summary>
        /// 绑定办理人
        /// </summary>
        private void BindReplyUserList()
        {
            //获取到所拥有这个权限的用户ID
            string         content    = "Advice.Handle";
            List <string>  accountIDs = AdviceHelper.GetAllReceivers(AdviceTypeID, content);
            List <Account> account    = new List <Account>();

            this.ddlToOtherHandleUserID.Items.Clear();
            foreach (string aID in accountIDs)
            {
                if (aID != "")
                {
                    Account a = AccountHelper.GetAccount(aID, new string[] { "ID", "DepartmentID", "LoginName", "LastName" });
                    if (a != null)
                    {
                        Department dp   = AccountHelper.GetDepartment(a.DepartmentID, new string[] { "Name" });
                        string     text = a.LastName;
                        if (string.IsNullOrEmpty(text))
                        {
                            text = a.LoginName;
                        }
                        if (dp != null && !string.IsNullOrEmpty(dp.Name))
                        {
                            text = dp.Name + " - " + text;
                        }
                        ListItem lsTemp = new ListItem(text, a.ID);
                        if (!this.ddlToOtherHandleUserID.Items.Contains(lsTemp))
                        {
                            this.ddlToOtherHandleUserID.Items.Add(lsTemp);
                        }
                    }
                }
            }
        }
示例#2
0
        protected override void Initialize()
        {
            //获取到所拥有这个权限的用户ID
            string         content    = "Advice.Handle";
            List <string>  accountIDs = AdviceHelper.GetAllReceivers(AdviceTypeID, content);
            List <Account> account    = new List <Account>();

            foreach (string aID in accountIDs)
            {
                if (aID != "")
                {
                    account.Add(AccountHelper.GetAccount(aID, new string[] { "LoginName", "DepartmentID" }));
                }
            }
            if (SearchTextBox.Text.Trim() != "" && SearchTextBox.Text != null)
            {
                List <Account> at = new List <Account>();
                for (int i = 0; i < account.Count; i++)
                {
                    if (account[i].LoginName == SearchTextBox.Text)
                    {
                        at.Add(account[i]);
                    }
                }
                DetailGridView.DataSource = at;
            }
            else
            {
                DetailGridView.DataSource = account;
            }
            DetailGridView.DataBind();
            UpdateAdviceTag();
        }