• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CmsData.EmailQueueTo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CmsData.EmailQueueTo的典型用法代码示例。如果您正苦于以下问题:C# EmailQueueTo类的具体用法?C# EmailQueueTo怎么用?C# EmailQueueTo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EmailQueueTo类属于CmsData命名空间,在下文中一共展示了EmailQueueTo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: NextMeetingDate0

        private string NextMeetingDate0(string code, EmailQueueTo emailqueueto)
        {
            if (!emailqueueto.OrgId.HasValue)
                return code;

            var mt = (from mm in db.Meetings
                      where mm.OrganizationId == emailqueueto.OrgId
                      where mm.MeetingDate > DateTime.Now
                      orderby mm.MeetingDate
                      select mm.MeetingDate).FirstOrDefault() ?? DateTime.MinValue;
            return mt == DateTime.MinValue ? "none" : mt.ToString("g");
        }
开发者ID:peclecl,项目名称:bvcms,代码行数:12,代码来源:EmailReplacements.cs


示例2: DoVoteLinkAnchorStyle

        private string DoVoteLinkAnchorStyle(string text, EmailQueueTo emailqueueto)
        {
            var list = new Dictionary<string, OneTimeLink>();
            const string VoteLinkRE = @"{votelink(?<inside>[^}]*)}";
            var re = new Regex(VoteLinkRE, RegexOptions.Singleline | RegexOptions.Multiline);
            Match match = re.Match(text);
            while (match.Success)
            {
                string votelink = match.Value;
                string anchor = "<a " + match.Groups["inside"].Value + ">text</a>";
                anchor = anchor.Replace("&quot;", "\"");
                anchor = anchor.Replace("&rdquo;", "\"");
                anchor = anchor.Replace("&ldquo;", "\"");

                var doc = new HtmlDocument();
                doc.LoadHtml(anchor);
                HtmlNode ele = doc.DocumentNode.Element("a");
                Dictionary<string, string> d = ele.Attributes.ToDictionary(aa => aa.Name.ToString(), aa => aa.Value);
                string txt = "click here";
                if (d.ContainsKey("text"))
                    txt = d["text"];

                string msg = "Thank you for responding.";
                if (d.ContainsKey("message"))
                    msg = d["message"];

                string confirm = "false";
                if (d.ContainsKey("confirm"))
                    confirm = d["confirm"];

                if (!d.ContainsKey("smallgroup"))
                    throw new Exception("Votelink: no smallgroup attribute");
                string smallgroup = d["smallgroup"];
                string pre = "";
                string[] a = smallgroup.SplitStr(":");
                if (a.Length > 1)
                    pre = a[0];

                var id = GetId(d, "VoteLink");

                string url = VoteLinkUrl(text, emailqueueto, list, votelink, id, msg, confirm, smallgroup, pre);
                text = text.Replace(votelink, @"<a href=""{0}"">{1}</a>".Fmt(url, txt));

                match = match.NextMatch();
            }
            return text;
        }
开发者ID:rossspoon,项目名称:bvcms,代码行数:47,代码来源:DoReplacements.cs


示例3: RegisterTagUrl

 private string RegisterTagUrl(string text,
                               EmailQueueTo emailqueueto,
                               Dictionary<string, OneTimeLink> list,
                               string votelink,
                               string id,
                               bool showfamily = false)
 {
     string qs = "{0},{1},{2}".Fmt(id, emailqueueto.PeopleId, emailqueueto.Id);
     OneTimeLink ot;
     if (list.ContainsKey(qs))
         ot = list[qs];
     else
     {
         ot = new OneTimeLink
             {
                 Id = Guid.NewGuid(),
                 Querystring = qs
             };
         OneTimeLinks.InsertOnSubmit(ot);
         SubmitChanges();
         list.Add(qs, ot);
     }
     string url = Util.URLCombine(CmsHost, "/OnlineReg/RegisterLink/{0}".Fmt(ot.Id.ToCode()));
     if (showfamily)
         url += "?showfamily=true";
     return url;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:27,代码来源:DoReplacements.cs


示例4: DoRegisterTag2

        private string DoRegisterTag2(string text, EmailQueueTo emailqueueto)
        {
            var list = new Dictionary<string, OneTimeLink>();
            const string VoteLinkRE = @"&lt;registertag .*?&gt;(?<inside>.+?)&lt;/registertag&gt;";
            var re = new Regex(VoteLinkRE, RegexOptions.Singleline | RegexOptions.Multiline);
            Match match = re.Match(text);
            while (match.Success)
            {
                string tag = match.Value;
                string inside = HttpUtility.HtmlDecode(match.Groups["inside"].Value);

                var doc = new HtmlDocument();
                doc.LoadHtml(tag);
                HtmlNode ele = doc.DocumentNode.Element("registertag");
                Dictionary<string, string> d = ele.Attributes.ToDictionary(aa => aa.Name.ToString(), aa => aa.Value);

                var id = GetId(d, "RegisterTag");

                string url = RegisterTagUrl(text, emailqueueto, list, tag, id);
                text = text.Replace(tag, @"<a href=""{0}"">{1}</a>".Fmt(url, inside));
                match = match.NextMatch();
            }
            return text;
        }
开发者ID:rossspoon,项目名称:bvcms,代码行数:24,代码来源:DoReplacements.cs


示例5: DoSmallGroups

 private string DoSmallGroups(string text, EmailQueueTo emailqueueto)
 {
     const string RE = @"\{smallgroups(:\[(?<prefix>[^\]]*)\]){0,1}\}";
     var re = new Regex(RE, RegexOptions.Singleline);
     Match match = re.Match(text);
     while (match.Success && emailqueueto.OrgId.HasValue)
     {
         string tag = match.Value;
         string prefix = match.Groups["prefix"].Value;
         var q = from mm in OrgMemMemTags
                 where mm.OrgId == emailqueueto.OrgId
                 where mm.PeopleId == emailqueueto.PeopleId
                 where mm.MemberTag.Name.StartsWith(prefix) || prefix == null || prefix == ""
                 orderby mm.MemberTag.Name
                 select mm.MemberTag.Name.Substring(prefix.Length);
         text = text.Replace(tag, string.Join("<br/>\n", q));
         match = match.NextMatch();
     }
     return text;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:20,代码来源:DoReplacements.cs


示例6: DoExtraValueData

 private string DoExtraValueData(string text, EmailQueueTo emailqueueto)
 {
     const string RE = @"{extra(?<type>.*?):(?<field>.*?)}";
     var re = new Regex(RE, RegexOptions.Singleline);
     Match match = re.Match(text);
     while (match.Success)
     {
         string tag = match.Value;
         string field = match.Groups["field"].Value;
         string type = match.Groups["type"].Value;
         var ev =
             PeopleExtras.SingleOrDefault(ee => ee.Field == field && emailqueueto.PeopleId == ee.PeopleId);
         string value = "";
         switch (type)
         {
             case "value":
                 value = ev.StrValue;
                 break;
             case "data":
                 value = ev.Data;
                 break;
             case "date":
                 value = ev.DateValue.FormatDate();
                 break;
             case "int":
                 value = ev.IntValue.ToString();
                 break;
         }
         text = text.Replace(tag, value);
         match = match.NextMatch();
     }
     return text;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:33,代码来源:DoReplacements.cs


示例7: DoRegisterLink

        private string DoRegisterLink(string text, EmailQueueTo emailqueueto)
        {
            var list = new Dictionary<string, OneTimeLink>();
            const string VoteLinkRE = "<a[^>]*?href=\"https{0,1}://(?<rlink>registerlink2{0,1})/{0,1}\"[^>]*>.*?</a>";
            var re = new Regex(VoteLinkRE, RegexOptions.Singleline | RegexOptions.Multiline | RegexOptions.IgnoreCase);
            Match match = re.Match(text);
            while (match.Success)
            {
                string tag = match.Value;
                string rlink = match.Groups["rlink"].Value.ToLower();

                var doc = new HtmlDocument();
                doc.LoadHtml(tag);
                HtmlNode ele = doc.DocumentNode.Element("a");
                string inside = ele.InnerHtml;
                Dictionary<string, string> d = ele.Attributes.ToDictionary(aa => aa.Name.ToString(), aa => aa.Value);

                var id = GetId(d, "RegisterLink");

                string url = RegisterTagUrl(text, emailqueueto, list, tag, id,
                                            showfamily: rlink == "registerlink2");
                text = text.Replace(tag, @"<a href=""{0}"">{1}</a>".Fmt(url, inside));
                match = match.NextMatch();
            }
            return text;
        }
开发者ID:rossspoon,项目名称:bvcms,代码行数:26,代码来源:DoReplacements.cs


示例8: RegText

        private string RegText(string code, EmailQueueTo emailqueueto)
        {
            var match = regTextRe.Match(code);
            if (!match.Success)
                return code;
            var field = match.Groups["field"].Value;
            var type = match.Groups["type"].Value;
            var answer = (from qa in db.ViewOnlineRegQAs
                          where qa.Question == field
                          where qa.Type == type
                          where qa.PeopleId == emailqueueto.PeopleId
                          where qa.OrganizationId == emailqueueto.OrgId
                          select qa.Answer).SingleOrDefault();

            return answer;
        }
开发者ID:peclecl,项目名称:bvcms,代码行数:16,代码来源:EmailReplacements.cs


示例9: RsvpLink

        private string RsvpLink(string code, EmailQueueTo emailqueueto)
        {
            //<a dir="ltr" href="http://rsvplink" id="798" rel="meetingid" title="This is a message">test</a>
            var list = new Dictionary<string, OneTimeLink>();

            var doc = new HtmlDocument();
            doc.LoadHtml(code);
            var ele = doc.DocumentNode.Element("a");
            var inside = ele.InnerHtml.Replace("{last}", person.LastName);
            var d = ele.Attributes.ToDictionary(aa => aa.Name.ToString(), aa => aa.Value);

            var msg = "Thank you for responding.";
            if (d.ContainsKey("title"))
                msg = d["title"];

            string confirm = "false";
            if (d.ContainsKey("dir") && d["dir"] == "ltr")
                confirm = "true";

            string smallgroup = null;
            if (d.ContainsKey("rel"))
                smallgroup = d["rel"];

            var id = GetId(d, "RsvpLink");

            string qs = $"{id},{emailqueueto.PeopleId},{emailqueueto.Id},{smallgroup}";
            OneTimeLink ot;
            if (list.ContainsKey(qs))
                ot = list[qs];
            else
            {
                ot = new OneTimeLink
                {
                    Id = Guid.NewGuid(),
                    Querystring = qs
                };
                db.OneTimeLinks.InsertOnSubmit(ot);
                db.SubmitChanges();
                list.Add(qs, ot);
            }
            var url = db.ServerLink(
                $"/OnlineReg/RsvpLinkSg/{ot.Id.ToCode()}?confirm={confirm}&message={HttpUtility.UrlEncode(msg)}");

            var href = d["href"];
            if (href.Contains("regretslink", ignoreCase: true))
                url = url + "&regrets=true";

            return [email protected]"<a href=""{url}"">{inside}</a>";
        }
开发者ID:peclecl,项目名称:bvcms,代码行数:49,代码来源:EmailReplacements.cs


示例10: RegisterLinkHref

        private string RegisterLinkHref(string code, EmailQueueTo emailqueueto)
        {
            var list = new Dictionary<string, OneTimeLink>();

            var match = RegisterHrefReId.Match(code);
            if (!match.Success)
                return code;
            var id = match.Groups["id"].Value.ToInt();

            var showfamily = code.Contains("registerlink2", ignoreCase: true);
            string qs = $"{id},{emailqueueto.PeopleId},{emailqueueto.Id}";
            OneTimeLink ot;
            if (list.ContainsKey(qs))
                ot = list[qs];
            else
            {
                ot = new OneTimeLink
                {
                    Id = Guid.NewGuid(),
                    Querystring = qs
                };
                db.OneTimeLinks.InsertOnSubmit(ot);
                db.SubmitChanges();
                list.Add(qs, ot);
            }
            string url = db.ServerLink($"/OnlineReg/RegisterLink/{ot.Id.ToCode()}");
            if (showfamily)
                url += "?showfamily=true";
            return $"href=\"{url}\"";
        }
开发者ID:peclecl,项目名称:bvcms,代码行数:30,代码来源:EmailReplacements.cs


示例11: RegisterTag

 private string RegisterTag(string code, EmailQueueTo emailqueueto)
 {
     var doc = new HtmlDocument();
     if (code.Contains("&lt;"))
         code = HttpUtility.HtmlDecode(code);
     doc.LoadHtml(code);
     var ele = doc.DocumentNode.FirstChild;
     var inside = ele.InnerHtml.Replace("{last}", person.LastName);
     var id = ele.Id.ToInt();
     var url = RegisterLinkUrl(db, id, emailqueueto.PeopleId, emailqueueto.Id, "registerlink");
     return [email protected]"<a href=""{url}"">{inside}</a>";
 }
开发者ID:peclecl,项目名称:bvcms,代码行数:12,代码来源:EmailReplacements.cs


示例12: OrgMember

        private string OrgMember(string code, EmailQueueTo emailqueueto)
        {
            var match = orgMemberRe.Match(code);
            if (!match.Success)
                return code;
            var divid = match.Groups["divid"].Value.ToInt();
            var type = match.Groups["type"].Value;
            var org = (from om in db.OrganizationMembers
                       where om.PeopleId == emailqueueto.PeopleId
                       where om.Organization.DivOrgs.Any(dd => dd.DivId == divid)
                       select om.Organization).FirstOrDefault();

            if (org == null)
                return "?";

            switch (type.ToLower())
            {
                case "location":
                    return org.Location;
                case "pendinglocation":
                case "pendingloc":
                    return org.PendingLoc;
                case "orgname":
                case "name":
                    return org.OrganizationName;
                case "leader":
                    return org.LeaderName;
            }
            return code;
        }
开发者ID:peclecl,项目名称:bvcms,代码行数:30,代码来源:EmailReplacements.cs


示例13: OrgExtra

 private string OrgExtra(string code, EmailQueueTo emailqueueto)
 {
     var match = orgExtraRe.Match(code);
     if (!match.Success || !emailqueueto.OrgId.HasValue)
         return code;
     var field = match.Groups["field"].Value;
     var ev = db.OrganizationExtras.SingleOrDefault(ee => ee.Field == field && ee.OrganizationId == db.CurrentOrg.Id);
     if (ev == null || !ev.Data.HasValue())
         return null;
     return ev.Data;
 }
开发者ID:peclecl,项目名称:bvcms,代码行数:11,代码来源:EmailReplacements.cs


示例14: OrgBarcode

 private string OrgBarcode(string code, EmailQueueTo emailqueueto)
 {
     var oid = code.StartsWith("{orgbarcode:")
         ? code.Substring(12).TrimEnd('}').ToInt()
         : emailqueueto.OrgId;
     return [email protected]"<img src='{db.ServerLink($"/Track/Barcode/{oid}-{emailqueueto.PeopleId}")}' width='95%' />";
 }
开发者ID:peclecl,项目名称:bvcms,代码行数:7,代码来源:EmailReplacements.cs


示例15: DoAddSmallGroup

 private string DoAddSmallGroup(string text, EmailQueueTo emailqueueto)
 {
     const string RE = @"\{addsmallgroup:\[(?<group>[^\]]*)\]\}";
     var re = new Regex(RE, RegexOptions.Singleline);
     Match match = re.Match(text);
     if (match.Success && emailqueueto.OrgId.HasValue)
     {
         string tag = match.Value;
         string group = match.Groups["group"].Value;
         OrganizationMember om = (from mm in OrganizationMembers
                                  where mm.OrganizationId == emailqueueto.OrgId
                                  where mm.PeopleId == emailqueueto.PeopleId
                                  select mm).SingleOrDefault();
         if (om != null)
             om.AddToGroup(this, group);
         text = text.Replace(tag, "");
     }
     return text;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:19,代码来源:DoReplacements.cs


示例16: SendLink

        private string SendLink(string code, EmailQueueTo emailqueueto)
        {
            var list = new Dictionary<string, OneTimeLink>();

            var doc = new HtmlDocument();
            doc.LoadHtml(code);
            var ele = doc.DocumentNode.Element("a");
            var inside = ele.InnerHtml.Replace("{last}", person.LastName);
            var d = ele.Attributes.ToDictionary(aa => aa.Name.ToString(), aa => aa.Value);

            var id = GetId(d, "SendLink");

            var showfamily = code.Contains("sendlink2", ignoreCase: true);
            var qs = $"{id},{emailqueueto.PeopleId},{emailqueueto.Id},{(showfamily ? "registerlink2" : "registerlink")}";

            OneTimeLink ot;
            if (list.ContainsKey(qs))
                ot = list[qs];
            else
            {
                ot = new OneTimeLink
                {
                    Id = Guid.NewGuid(),
                    Querystring = qs
                };
                db.OneTimeLinks.InsertOnSubmit(ot);
                db.SubmitChanges();
                list.Add(qs, ot);
            }
            var url = db.ServerLink($"/OnlineReg/SendLink/{ot.Id.ToCode()}");
            return [email protected]"<a href=""{url}"">{inside}</a>";
        }
开发者ID:peclecl,项目名称:bvcms,代码行数:32,代码来源:EmailReplacements.cs


示例17: DoCreateUserTag

 private string DoCreateUserTag(EmailQueueTo emailqueueto)
 {
     User user = (from u in Users
                  where u.PeopleId == emailqueueto.PeopleId
                  select u).FirstOrDefault();
     if (user != null)
     {
         user.ResetPasswordCode = Guid.NewGuid();
         user.ResetPasswordExpires = DateTime.Now.AddHours(Setting("ResetPasswordExpiresHours", "24").ToInt());
         string link = Util.URLCombine(CmsHost, "/Account/SetPassword/" + user.ResetPasswordCode.ToString());
         SubmitChanges();
         return @"<a href=""{0}"">Set password for {1}</a>".Fmt(link, user.Username);
     }
     var ot = new OneTimeLink
         {
             Id = Guid.NewGuid(),
             Querystring = emailqueueto.PeopleId.ToString()
         };
     OneTimeLinks.InsertOnSubmit(ot);
     SubmitChanges();
     string url = Util.URLCombine(CmsHost, "/Account/CreateAccount/{0}".Fmt(ot.Id.ToCode()));
     return @"<a href=""{0}"">Create Account</a>".Fmt(url);
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:23,代码来源:DoReplacements.cs


示例18: SmallGroup

        private string SmallGroup(string code, EmailQueueTo emailqueueto)
        {
            var match = smallGroupRe.Match(code);
            if (!match.Success || !emailqueueto.OrgId.HasValue)
                return code;

            var prefix = match.Groups["prefix"].Value;
            var def = match.Groups["def"].Value;
            var sg = (from mm in db.OrgMemMemTags
                      where mm.OrgId == emailqueueto.OrgId
                      where mm.PeopleId == emailqueueto.PeopleId
                      where mm.MemberTag.Name.StartsWith(prefix)
                      select mm.MemberTag.Name).FirstOrDefault();
            if (!sg.HasValue())
                sg = def;
            return sg;
        }
开发者ID:peclecl,项目名称:bvcms,代码行数:17,代码来源:EmailReplacements.cs


示例19: DoMeetingDate

 private string DoMeetingDate(string text, EmailQueueTo emailqueueto)
 {
     DateTime mt = (from aa in Attends
                    where aa.OrganizationId == emailqueueto.OrgId
                    where aa.PeopleId == emailqueueto.PeopleId
                    where aa.Commitment == AttendCommitmentCode.Attending
                    where aa.MeetingDate > DateTime.Now
                    orderby aa.MeetingDate
                    select aa.MeetingDate).FirstOrDefault();
     text = text.Replace("{nextmeetingtime}", mt.ToString("g"));
     return text;
 }
开发者ID:rossspoon,项目名称:bvcms,代码行数:12,代码来源:DoReplacements.cs


示例20: SmallGroups

        private string SmallGroups(string code, EmailQueueTo emailqueueto)
        {
            const string RE = @"\{smallgroups(:\[(?<prefix>[^\]]*)\]){0,1}\}";
            var re = new Regex(RE, RegexOptions.Singleline);
            var match = re.Match(code);
            if (!match.Success || !emailqueueto.OrgId.HasValue)
                return code;

            var prefix = match.Groups["prefix"].Value;
            var q = from mm in db.OrgMemMemTags
                    where mm.OrgId == emailqueueto.OrgId
                    where mm.PeopleId == emailqueueto.PeopleId
                    where mm.MemberTag.Name.StartsWith(prefix) || prefix == null || prefix == ""
                    orderby mm.MemberTag.Name
                    select mm.MemberTag.Name.Substring(prefix.Length);
            return string.Join("<br/>\n", q);
        }
开发者ID:peclecl,项目名称:bvcms,代码行数:17,代码来源:EmailReplacements.cs



注:本文中的CmsData.EmailQueueTo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CmsData.Family类代码示例发布时间:2022-05-24
下一篇:
C# CmsData.CMSDataContext类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap