Exemplo n.º 1
0
        /// <summary>
        /// get agents show in dropdown list
        /// </summary>
        /// <param name="strAgentID">selected agentid</param>
        /// <param name="hasExtraHeader"> whether has 指定なし </param>
        /// <param name="isShowDisplayName">AgentID + Agent Display name</param>
        protected void GetAgentListForDDL(string strAgentID, bool hasExtraHeader, bool isShowDisplayName)
        {
            List <SelectListItem>       lstItem  = new List <SelectListItem>();
            List <uspWFMGetAgentResult> lstAgent = new List <uspWFMGetAgentResult>();

            if (hasExtraHeader)
            {
                lstItem.Insert(0, new SelectListItem {
                    Text = "指定なし", Value = ""
                });
            }

            using (WFMDBDataContext db = new WFMDBDataContext())
            {
                lstAgent = db.uspWFMGetAgent(this.TenantID).ToList();
            }
            foreach (var item in lstAgent)
            {
                if (!isShowDisplayName)
                {
                    lstItem.Add(new SelectListItem {
                        Text = item.vLogin, Value = item.vLogin, Selected = (item.vLogin.Equals(strAgentID))
                    });
                }
                else
                {
                    lstItem.Add(new SelectListItem {
                        Text = item.vLogin + "_" + item.vDisplayName, Value = item.vLogin, Selected = (item.vLogin.Equals(strAgentID))
                    });
                }
            }
            ViewData["lstAgent"] = lstItem;
        }
Exemplo n.º 2
0
        /// <summary>
        /// get agents show in dropdown list 
        /// </summary>
        /// <param name="strAgentID">selected agentid</param>
        /// <param name="hasExtraHeader"> whether has 指定なし </param>
        /// <param name="isShowDisplayName">AgentID + Agent Display name</param>
        protected void GetAgentListForDDL(string strAgentID, bool hasExtraHeader, bool isShowDisplayName)
        {
            List<SelectListItem> lstItem = new List<SelectListItem>();
            List<uspWFMGetAgentResult> lstAgent = new List<uspWFMGetAgentResult>();
            if (hasExtraHeader)
            {
                lstItem.Insert(0, new SelectListItem { Text = "指定なし", Value = "" });
            }

            using (WFMDBDataContext db = new WFMDBDataContext())
            {
                lstAgent = db.uspWFMGetAgent(this.TenantID).ToList();
            }
            foreach (var item in lstAgent)
            {
                if (!isShowDisplayName)
                    lstItem.Add(new SelectListItem { Text = item.vLogin, Value = item.vLogin, Selected = (item.vLogin.Equals(strAgentID)) });
                else
                    lstItem.Add(new SelectListItem { Text = item.vLogin + "_" + item.vDisplayName, Value = item.vLogin, Selected = (item.vLogin.Equals(strAgentID)) });
            }
            ViewData["lstAgent"] = lstItem;
        }