Пример #1
0
        /// <summary>
        ///     字典下拉框
        /// </summary>
        /// <param name="htmlHelper"></param>
        /// <param name="input">下拉实体</param>
        /// <returns></returns>
        public static MvcHtmlString DropDownListDictionary(this HtmlHelper htmlHelper,
                                                           DropDownListDictionaryInput input)
        {
            var dictionaryBusiness = new SystemDictionaryLogic();
            var dictionaries       = Task.Run(async() => await dictionaryBusiness.GetDictionaryByCode(input.Code)).Result;
            var list = new List <SelectListItem>();

            if (input.NeedDefault)
            {
                list.Add(new SelectListItem
                {
                    Value = "",
                    Text  = @"===请选择==="
                });
            }
            list.AddRange(dictionaries.Select(o => new SelectListItem {
                Text = o.Name, Value = o.DictionaryId.ToString()
            }));
            if (input.SelectedVal != null)
            {
                var item = list.Find(o => o.Value == input.SelectedVal.ToString() || o.Text == input.SelectedVal.ToString());
                if (item != null)
                {
                    item.Selected = true;
                }
            }
            return(htmlHelper.DropDownList(input.Name, list, input.HtmlAttributes));
        }
Пример #2
0
        //            腾讯QQ邮箱
        //接收服务器:pop.qq.com
        //发送服务器:smtp.qq.com

        //网易126邮箱
        //接收服务器:pop3.126.com
        //发送服务器:smtp.126.com

        //网易163免费邮
        //接收服务器:pop.163.com
        //发送服务器:smtp.163.com

        //网易163VIP邮箱
        //接收服务器:pop.vip.163.com
        //发送服务器:smtp.vip.163.com

        //网易188财富邮
        //接收服务器:pop.188.com
        //发送服务器:smtp.188.com

        //网易yeah.net邮箱
        //接收服务器:pop.yeah.net
        //发送服务器:smtp.yeah.net

        //网易netease.com邮箱
        //接收服务器:pop.netease.com
        //发送服务器:smtp.netease.com

        //新浪收费邮箱
        //接收服务器:pop3.vip.sina.com
        //发送服务器:smtp.vip.sina.com

        //新浪免费邮箱
        //接收服务器:pop3.sina.com.cn
        //发送服务器:smtp.sina.com.cn

        //搜狐邮箱
        //接收服务器:pop3.sohu.com
        //发送服务器:smtp.sohu.com

        //21cn快感邮
        //接收服务器:vip.21cn.com
        //发送服务器:vip.21cn.com

        //21cn经济邮
        //接收服务器:pop.21cn.com
        //发送服务器:smtp.21cn.com

        //tom邮箱
        //接收服务器:pop.tom.com
        //发送服务器:smtp.tom.com

        //263邮箱
        //接收服务器:263.net
        //发送服务器:smtp.263.net

        //网易163.com邮箱
        //接收服务器:rwypop.china.com
        //发送服务器:rwypop.china.com

        //雅虎邮箱
        //接收服务器:pop.mail.yahoo.com
        //发送服务器:smtp.mail.yahoo.com

        //Gmail邮箱
        //接收服务器:pop.gmail.com
        //发送服务器:smtp.gmail.com
        /// <summary>
        /// </summary>
        /// <param name="htmlHelper"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        public static MvcHtmlString DropDownListEmailServer(this HtmlHelper htmlHelper,
                                                            DropDownListDictionaryInput input)
        {
            var list = new List <SelectListItem>();

            if (input.NeedDefault)
            {
                list.Add(new SelectListItem
                {
                    Value = "",
                    Text  = @"===请选择==="
                });
            }
            list.Add(new SelectListItem
            {
                Value = "10.10.16.2",
                Text  = @"HiDM Mail Server"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.qq.com",
                Text  = @"腾讯QQ邮箱(smtp.qq.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.126.com",
                Text  = @"网易126邮箱(smtp.126.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.163.com",
                Text  = @"网易163免费邮(smtp.163.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.vip.163.com",
                Text  = @"网易163VIP邮箱(smtp.vip.163.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.vip.163.com",
                Text  = @"网易188财富邮(smtp.188.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.yeah.net",
                Text  = @"网易yeah.net邮箱(smtp.yeah.net)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.netease.com",
                Text  = @"网易netease.com邮箱(smtp.netease.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.vip.sina.com",
                Text  = @"新浪收费邮箱(smtp.vip.sina.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.sina.com.cn",
                Text  = @"新浪免费邮箱(smtp.vip.sina.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.sohu.com",
                Text  = @"搜狐邮箱(smtp.sohu.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "vip.21cn.com",
                Text  = @"21cn快感邮(vip.21cn.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.21cn.com",
                Text  = @"21cn经济邮(smtp.21cn.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.tom.com",
                Text  = @"tom邮箱(smtp.tom.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.263.net",
                Text  = @"263邮箱(smtp.263.net)"
            });
            list.Add(new SelectListItem
            {
                Value = "rwypop.china.com",
                Text  = @"网易163.com邮箱(rwypop.china.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.mail.yahoo.com",
                Text  = @"雅虎邮箱(smtp.mail.yahoo.com)"
            });
            list.Add(new SelectListItem
            {
                Value = "smtp.gmail.com",
                Text  = @"Gmail邮箱(smtp.gmail.com)"
            });
            if (input.SelectedVal != null)
            {
                var item = list.Find(o => o.Value == input.SelectedVal.ToString());
                if (item != null)
                {
                    item.Selected = true;
                }
            }
            return(htmlHelper.DropDownList(input.Name, list, input.HtmlAttributes));
        }