コード例 #1
0
        protected void UpdateButton_Click(object sender, EventArgs e)
        {
            int Priority1 = Convert.ToInt32(Priority1DropDownList.SelectedItem.Value);
            int Priority2 = Convert.ToInt32(Priority2DropDownList.SelectedItem.Value);
            int Priority3 = Convert.ToInt32(Priority3DropDownList.SelectedItem.Value);

            try
            {
                ItemID = ItemDropDownList.SelectedItem.Value;
                SupplierBizLogic.UpdateItemSupplier(ItemID, Priority1, Priority2, Priority3);
                //Response.Redirect("Default2.aspx?username="******"<script>alert('Suppliers Priority has been updated !');</script>");
                Label1.Text = "";
                Label2.Text = "";
                Label3.Text = "";
                Label4.Text = "";
                Label5.Text = "";
                Label6.Text = "";
                ItemDropDownList.SelectedIndex = 0;
                Priority1DropDownList.Visible  = false;
                Priority2DropDownList.Visible  = false;
                Priority3DropDownList.Visible  = false;

                //send mail to clerk
                String        from      = "*****@*****.**";
                List <String> toAddress = MailBizLogic.ClerkEmail();
                String        subject   = "[Auto Notification] Item supplier update";
                String        body      = String.Format("Supplier's priority has been changed for item {0}. Check website for further details." +
                                                        "\n\nNote: This is an auto-generated email.  Please do not reply to this email." +
                                                        "\n\nThis email is confidential and may be privileged.If you are not the intended recipient, " +
                                                        "please delete it and notify us immediately; you should not copy or use it for any purpose, " +
                                                        "nor disclose its contents to any other person.\n\nThank you.", ItemID);

                foreach (String to in toAddress)
                {
                    MailBizLogic.sendMail(from, to, subject, body);
                }
            }
            catch (Exception exp)
            {
                Response.Write(exp.ToString());
            }
        }