protected override void Execute(CodeActivityContext context)
        {
            String TO, CC, BCC, SUBJECT, BODY;

            if (TemplatePath.Get(context).Contains(".eml"))
            {
                Message emlMessage = ReadMessage(TemplatePath.Get(context).Contains(":\\") ? TemplatePath.Get(context) : System.IO.Directory.GetCurrentDirectory() + '\\' + TemplatePath.Get(context));
                TO      = emlMessage.To;
                CC      = emlMessage.CC;
                BCC     = emlMessage.BCC;
                SUBJECT = emlMessage.Subject;
                BODY    = String.IsNullOrEmpty(emlMessage.HTMLBody)?emlMessage.TextBody:emlMessage.HTMLBody;
            }
            else if (TemplatePath.Get(context).Contains(".oft") || TemplatePath.Get(context).Contains(".msg"))
            {
                try
                {
                    Outlook.Application app      = new Outlook.Application();
                    Outlook.MailItem    template = app.CreateItemFromTemplate(TemplatePath.Get(context).Contains(":\\") ? TemplatePath.Get(context) : System.IO.Directory.GetCurrentDirectory() + '\\' + TemplatePath.Get(context)) as Outlook.MailItem;
                    TO      = template.To;
                    CC      = template.CC;
                    BCC     = template.BCC;
                    SUBJECT = template.Subject;
                    BODY    = String.IsNullOrEmpty(template.HTMLBody) ? template.Body : template.HTMLBody;
                }
                catch
                {
                    throw new System.Exception("Error, .oft and .msg files can only be read if you have Outlook installed, try using a .eml as a template");
                }
            }
            else
            {
                throw new System.Exception("Invalid template format, please use a '.oft', '.msg', or '.eml' template.");
            }

            SUBJECT = String.IsNullOrEmpty(Subject.Get(context)) ? (String.IsNullOrEmpty(SUBJECT) ? "Untitled" : SUBJECT) : Subject.Get(context);
            TO      = String.IsNullOrEmpty(To.Get(context)) ? TO : To.Get(context);
            CC      = String.IsNullOrEmpty(Cc.Get(context)) ? CC : Cc.Get(context);
            BCC     = String.IsNullOrEmpty(Bcc.Get(context)) ? BCC : Bcc.Get(context);
            BODY    = BODY.Replace("{message}", String.IsNullOrEmpty(Body.Get(context))?"":Body.Get(context));
            BODY    = BODY.Replace("{table}", DT.Get(context) != null ? (DT.Get(context).Rows.Count > 0 ? GetHTMLTable(DT.Get(context)) : "") : "");
            MailMessage mail = new MailMessage(From.Get(context), TO, SUBJECT, BODY);

            mail.Bcc.Add(BCC);
            mail.IsBodyHtml = true;
            mail.CC.Add(CC);
            SmtpClient client = new SmtpClient
            {
                Port                  = Port.Get(context),
                DeliveryMethod        = SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                EnableSsl             = EnableSSL,
                Host                  = Server.Get(context),
                Credentials           = new System.Net.NetworkCredential(Email.Get(context), Password.Get(context)),
                Timeout               = 30000
            };

            client.Send(mail);
        }
示例#2
0
 public void FDE_PrintStats()
 {
     Console.WriteLine();
     Console.WriteLine("INT:{0}   REF:{1}   TECH:{2}", INT.ToString(), REF.ToString(), TECH.ToString());
     Console.WriteLine("COOL:{0}  ATTR:{1}  LUCK:{2}", COOL.ToString(), ATTR.ToString(), LUCK.ToString());
     Console.WriteLine("MA:{0}    BODY:{1}  EMP:{2}", MA.ToString(), BODY.ToString(), EMP.ToString());
     Console.WriteLine();
 }
示例#3
0
        private static List <Record> CreateBodyParts(CreatorConfig config, bool IsMale, HashSet <BodyPart> partList)
        {
            var outputRecords   = new List <Record>();
            var symbol          = IsMale ? "m" : "f";
            var EditorIdTrimmed = config.EditorId.TrimEnd('\0');

            if (bodyParts.Contains(BodyPart.Hand))
            {
                var body = new BODY();
                body.BYDT.BodyPart  = BodyPart.Hand;
                body.FNAM.Name      = config.EditorId;
                body.MODL.ModelPath = $"{config.ModelFolderPath}_{symbol}_body1st.nif\0";
                body.BYDT.PartType  = BodyPartType.Skin;
                body.NAME.EditorId  = $"{config.EditorIdPrefix}b_n_{EditorIdTrimmed}_{symbol}_hand.1st\0";
                body.BYDT.Flags.Add(BodyPartFlag.Playable);
                if (!IsMale)
                {
                    body.BYDT.Flags.Add(BodyPartFlag.Female);
                }

                outputRecords.Add(body);
            }

            foreach (var part in bodyParts)
            {
                var body = new BODY();
                body.BYDT.BodyPart = part;
                body.FNAM.Name     = config.EditorId;

                if (part.Equals(BodyPart.Head))
                {
                    body.NAME.EditorId  = $"{config.EditorIdPrefix}b_n_{EditorIdTrimmed}_{symbol}_head01\0";
                    body.MODL.ModelPath = $"{config.ModelFolderPath}_{symbol}_head01.nif\0";
                }
                else if (part.Equals(BodyPart.Hair))
                {
                    body.NAME.EditorId  = $"{config.EditorIdPrefix}b_n_{EditorIdTrimmed}_{symbol}_hair01\0";
                    body.MODL.ModelPath = $"{config.ModelFolderPath}_{symbol}_hair01.nif\0";
                }
                else
                {
                    body.NAME.EditorId  = $"{config.EditorIdPrefix}b_n_{EditorIdTrimmed}_{symbol}_{part.ToString().ToLower()}\0";
                    body.MODL.ModelPath = $"{config.ModelFolderPath}_{symbol}_body.nif\0";
                }

                body.BYDT.PartType = BodyPartType.Skin;

                body.BYDT.Flags.Add(BodyPartFlag.Playable);
                if (!IsMale)
                {
                    body.BYDT.Flags.Add(BodyPartFlag.Female);
                }
                outputRecords.Add(body);
            }

            return(outputRecords);
        }
示例#4
0
        protected Tag MakePage(SpinneretPage page, string title, object content)
        {
            var head = new HEAD(
                new TITLE(FormatHtmlTitle(title)),
                new LINK()
            {
                rel = "stylesheet", type = "text/css", href = GetCssLink()
            }
                );

            var body = new BODY()
            {
                class_ = page.FullScreen ? "sw-full-screen" : null
            }._(
                page.FullScreen
                    ? (object)new object[] { new H1(title), content }
                    : new TABLE()
            {
                class_ = "sw-layout"
            }._(new TR()
            {
                class_ = "sw-layout"
            }._(
                    new TD()
            {
                class_ = "sw-layout-leftpane"
            }._(
                        new P(new A(GetHomeLinkBody())
            {
                href = "/"
            })
            {
                class_ = "sw-topleft-title"
            },
                        GetNavPanelTop(page),
                        GetNavLinks(page),
                        GetNavPanelBottom(page)
                        ),
                    new TD()
            {
                class_ = "sw-layout-mainpane"
            }._(
                        new DIV()
            {
                class_ = "sw-floating-links"
            }._(
                            GetFloatingLinks(page).InsertBetween <object>(" • ")
                            ),
                        new H1(title),
                        content
                        )
                    ))
                );

            return(new HTML(head, body));
        }
示例#5
0
        public Application(string templatePath, string subject, string to, string cc, string bcc, string body, string from, int port, DataTable dt, bool ssl, string host, string email, string password, List <string> inputs)
        {
            EMAIL    = email;
            PASSWORD = password;
            HOST     = host;
            SSL      = ssl;
            Port     = port;
            FROM     = from;
            Inputs   = inputs;
            if (templatePath.Contains(".eml"))
            {
                Message emlMessage = ReadMessage(templatePath.Contains(":\\") ? templatePath : System.IO.Directory.GetCurrentDirectory() + '\\' + templatePath);
                TO      = emlMessage.To;
                CC      = emlMessage.CC;
                BCC     = emlMessage.BCC;
                SUBJECT = emlMessage.Subject;
                BODY    = String.IsNullOrEmpty(emlMessage.HTMLBody) ? emlMessage.TextBody : emlMessage.HTMLBody;
            }
            else if (templatePath.Contains(".oft") || templatePath.Contains(".msg"))
            {
                try
                {
                    Outlook.Application app      = new Outlook.Application();
                    Outlook.MailItem    template = app.CreateItemFromTemplate(templatePath.Contains(":\\")
                                                ? templatePath
                                                : System.IO.Directory.GetCurrentDirectory() + '\\' + templatePath) as Outlook.MailItem;
                    TO      = template.To;
                    CC      = template.CC;
                    BCC     = template.BCC;
                    SUBJECT = template.Subject;
                    BODY    = String.IsNullOrEmpty(template.HTMLBody) ? template.Body : template.HTMLBody;
                }
                catch (IOException)
                {
                    throw;
                }
                catch
                {
                    throw new System.Exception("Error, .oft and .msg files can only be read if you have Outlook installed, try using a .eml as a template");
                }
            }
            else
            {
                throw new System.Exception("Invalid template format, please use a '.oft', '.msg', or '.eml' template.");
            }

            SUBJECT = String.IsNullOrEmpty(subject) ? (String.IsNullOrEmpty(SUBJECT) ? "Untitled" : SUBJECT) : subject;
            TO      = String.IsNullOrEmpty(to) ? TO : to;
            CC      = String.IsNullOrEmpty(cc)? CC : cc;
            BCC     = String.IsNullOrEmpty(bcc) ? BCC :bcc;
            BODY    = BODY.Replace("{message}", String.IsNullOrEmpty(body) ? "" : body);
            BODY    = BODY.Replace("{table}", dt != null ? (dt.Rows.Count > 0 ? GetHTMLTable(dt) : "") : "");
        }
示例#6
0
        protected Tag MakePage(SpinneretPage page, string title, object content)
        {
            var head = new HEAD(
                new TITLE(FormatHtmlTitle(title)),
                GetCssLinks().Select(link => new LINK()
            {
                rel = "stylesheet", type = "text/css", href = link
            })
                );

            var body = new BODY()
            {
                class_ = page.FullScreen ? "sw-full-screen" : null
            }._(
                page.FullScreen
                    ? (object)new object[] { new H1(title), content }
                    : new[]
            {
                new DIV()
                {
                    id = "mainbar"
                }._(
                    new DIV()
                {
                    id = "header"
                }._(new H1(title)),
                    new DIV()
                {
                    id = "content"
                }._(content)
                    ),
                new DIV()
                {
                    id = "sidebar"
                }._(
                    GetFloatingLinks(page).InsertBetween <object>(" • "),

                    new P(new A(GetHomeLinkBody())
                {
                    href = "/"
                }),
                    GetNavPanelTop(page),
                    GetNavLinks(page),
                    GetNavPanelBottom(page)
                    ),
            }
                );

            return(new HTML(head, body));
        }
示例#7
0
 /// <summary>
 /// 2.60.	鉴权开户结果查询
 /// </summary>
 public AuthenticationToOpenAccountCheckRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#8
0
 /// <summary>
 /// 资金变动查证接口
 /// </summary>
 public BTrsVeriAmountRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#9
0
 /// <summary>
 /// 提现,五万以上,北京银联单笔代付
 /// </summary>
 public BJUnionPayPaymentRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#10
0
 /// <summary>
 /// 电子账户余额查询
 /// </summary>
 public BCifAcNoAmountRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
 /// <summary>
 /// 身份证上传
 /// </summary>
 public UploadIdCardImageRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#12
0
 /// <summary>
 /// 对账
 /// </summary>
 public BFinFundServiceReqRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
 /// <summary>
 /// 2.49.	冻结状态查询接口
 /// </summary>
 public QueryFreezeCombinationRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#14
0
 /// <summary>
 /// 解冻
 /// </summary>
 public UnfrozenFixedDepositRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#15
0
 /// <summary>
 /// 冻结
 /// </summary>
 public CurrentFundFreezeRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#16
0
 /// <summary>
 /// 提现,五万以下,普通提现
 /// </summary>
 public EComGAmountRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#17
0
 /// <summary>
 /// 充值
 /// </summary>
 public BTrsInRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }
示例#18
0
 /// <summary>
 /// 开户
 /// </summary>
 public BCifAcctNoOpenRequest()
 {
     Head = new HEAD();
     Body = new BODY();
 }