Exemplo n.º 1
0
        void DeclineGiftVoucherOrder(OrdersDS.OrdersRow order)
        {
            UpdateOrderStatus(order.OrderId, OrderStatus.Canceled);

            GiftVouchers gf = new GiftVouchers();

            OrdersDS.GiftVoucherOrdersRow voucher =
                (OrdersDS.GiftVoucherOrdersRow)gf.GetGiftVoucherByOrder(order.OrderId);

            NameValueCollection dic = new NameValueCollection();

            dic["From"]        = voucher.FirstName + " " + voucher.LastName;
            dic["FromEmail"]   = voucher.Email;
            dic["To"]          = voucher.ToName;
            dic["ToEmail"]     = voucher.ToEmail;
            dic["status"]      = "Declined";
            dic["Amount"]      = string.Format("{0:c}", voucher.Amount);
            dic["VoucherCode"] = voucher.VoucherCode;
            dic["Message"]     = order.Description;

            Mail m = new Mail("Gift-Voucher-Notif");

            m.Data = dic;
            m.Send();
        }
Exemplo n.º 2
0
        void ConfirmGiftVoucherOrder(OrdersDS.OrdersRow order)
        {
            UpdateOrderStatus(order.OrderId, OrderStatus.Shipped);


            GiftVouchers gf = new GiftVouchers();

            OrdersDS.GiftVoucherOrdersRow voucher =
                (OrdersDS.GiftVoucherOrdersRow)gf.GetGiftVoucherByOrder(order.OrderId);
            try
            {
                NameValueCollection dic = new NameValueCollection();
                dic["From"]        = voucher.FirstName + " " + voucher.LastName;
                dic["FromEmail"]   = voucher.Email;
                dic["To"]          = voucher.ToName;
                dic["ToEmail"]     = voucher.ToEmail;
                dic["status"]      = "Verified";
                dic["Amount"]      = string.Format("{0:c}", voucher.Amount);
                dic["VoucherCode"] = voucher.VoucherCode;
                dic["Message"]     = order.Description;

                Mail m = new Mail("Gift-Voucher-Notif");
                m.Data = dic;
                m.Send();

                m         = new Mail("Gift Card Receiver");
                m.To      = dic["ToEmail"].ToString();
                m.Subject = m.Subject.Replace("{FromName}", dic["From"].ToString());
                m.Data    = dic;
                m.Send();

                m      = new Mail("Gift Card Sender");
                m.To   = dic["FromEmail"].ToString();
                m.Data = dic;
                m.Send();
            }
            catch
            {
            }
        }