当前位置: 首页>>代码示例>>C#>>正文


C# Helpers.sendEmail方法代码示例

本文整理汇总了C#中Helpers.sendEmail方法的典型用法代码示例。如果您正苦于以下问题:C# Helpers.sendEmail方法的具体用法?C# Helpers.sendEmail怎么用?C# Helpers.sendEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Helpers的用法示例。


在下文中一共展示了Helpers.sendEmail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: parseXML

    protected void parseXML(XmlDocument xml)
    {
        string track = "";
        string logic = "";
        string ex = "";
        string excost = "";

        XmlNodeList details = xml.GetElementsByTagName("TransactionDetails");

        foreach (XmlNode node in details)
        {
            if (node["ChargeCategoryDetailCode"].InnerText == "ADC ")
            {
                string flip = node.OuterXml;
                XmlDocument newxml = new XmlDocument();
                newxml.LoadXml(flip);

                XmlNodeList shipments = newxml.GetElementsByTagName("Shipment");

                if (shipments.Count > 0)
                {
                    try
                    {
                        for (int i = 0; i < shipments.Count; i++)
                        {
                            for (int ii = 0; ii < shipments[i].ChildNodes.Count; ii++)
                            {
                                string temp = shipments[i].ChildNodes[ii].InnerText;
                                string name = shipments[i].ChildNodes[ii].Name;

                                switch (name)
                                {
                                    case "LeadShipmentNumber":
                                        track = temp;
                                        lbl_found.Text += "TrackingNumber: " + track + "<br />";
                                        break;
                                    case "Package":
                                        excost = shipments[i].ChildNodes[ii]["ChargeDetails"]["Charge"]["ChargeInformation"]["NetAmount"].InnerXml;
                                        lbl_found.Text += "ExceptionCost: $" + excost + "<br />";
                                        ex = shipments[i].ChildNodes[ii]["ChargeDetails"]["Charge"]["ChargeInformation"]["DescriptionOfCharges"].InnerXml;
                                        lbl_found.Text += "ExceptionDetail: " + ex + "<br />";
                                        break;
                                    case "ShipmentReferences":
                                        if (Convert.ToInt32(shipments[i].ChildNodes[ii]["Reference"]["Sequence"].InnerXml.ToString()) == 2)
                                        {
                                            logic = shipments[i].ChildNodes[ii]["Reference"]["ReferenceNumber"].InnerXml;
                                            lbl_found.Text += "Logic JobN: " + logic + "<br />";
                                        }
                                        break;
                                }
                            }
                            lbl_found.Text += "<br />";

                            int result = 0;

                            if ((track != null) && (track.Length > 0))
                            {
                                result = updateException_track(Convert.ToDecimal(excost), track);
                            }

                            if (result == 0)
                            {
                                result = updateException_ship(Convert.ToDecimal(excost), getShipmentFromTrackingNumber(track));
                            }

                            if (result == 0)
                            {
                                Helpers help = new Helpers();
                                help.sendEmail("[email protected]", "<h1>UPS File Processer</h1><h3>Tracking#: " + track + "</h3><h3>Cost: $" + excost + "</h3><h3>Desc#: " + ex + "</h3><h3>Logic#: " + logic + "</h3>");
                                lbl_found.Text += "Email sent to [email protected] for outlier handling.<br />";
                            }

                            lbl_found.Text += result + " rows updated in ExceptionLog<br /><br />";

                        }
                    }

                    catch (Exception err)
                    {
                        status_red("Error: " + err.Message);
                    }
                }
            }
        }
    }
开发者ID:FinelinePrintingGroup,项目名称:_DevelopmentSource,代码行数:85,代码来源:consume.aspx.cs

示例2: btn_submit_Click

    protected void btn_submit_Click(object sender, EventArgs e)
    {
        Int32.TryParse(txt_jobN.Text, out this.ref1);
        this.ref2 = txt_cc.Text;
        this.ref3 = txt_cv2.Text;

        try
        {
            insertRefRecord(this.ref1, this.ref2, this.ref3);
            lbl_status.ForeColor = System.Drawing.Color.Green;
            lbl_status.Text = "Success!";
            lbl_status0.Text = lbl_status.Text;
            txt_cc.Text = "";
            txt_cv2.Text = "";
            txt_jobN.Text = "";
        }
        catch (Exception ex)
        {
            lbl_status.ForeColor = System.Drawing.Color.Red;
            lbl_status.Text = "Error, contact [email protected]";
            lbl_status0.Text = lbl_status.Text;
            Helpers help = new Helpers();
            help.sendEmail("[email protected]", String.Format("JobN: {0}<br />CC#: {1}<br />[email protected]: {2}<br />Error: {3}", this.ref1, this.ref2, this.ref3, ex.ToString()));

        }
    }
开发者ID:FinelinePrintingGroup,项目名称:_DevelopmentSource,代码行数:26,代码来源:CreditCardEntry.aspx.cs


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