public static List <M_OrderList> OrdersCheck(M_Payment payMod) { B_OrderList val = new B_OrderList(); if (payMod.Status != 1) { function.WriteErrMsg("Incorrect order payment condition"); return(null); } if (payMod.IsDel == 1) { function.WriteErrMsg("The order has been deleted"); return(null); } string[] array = payMod.PaymentNum.Split(','); List <M_OrderList> list = new List <M_OrderList>(); for (int i = 0; i < array.Length; i++) { M_OrderList val2 = val.SelModelByOrderNo(array[i]); SnsHelper.CheckIsCanPay(val2); list.Add(val2); } return(list); }
/// <summary> /// 发送系统邮件 /// </summary> public static void SendOrderEmailByType(int oid, string type, string email = "") { M_OrderList orderMod = new B_OrderList().SelReturnModel(oid); if (string.IsNullOrEmpty(email)) { M_Order_Contact conMod = new B_Order_Contact().SelModelByOid(oid); email = conMod.Email; } switch (type) { case "order": //下单后(暂只用于测试) { StringWriter sw = new StringWriter(); HttpContext.Current.Server.Execute("/Common/MailTlp/Order_Payed.aspx?ID=" + oid, sw); string title2 = "We received your order!"; string html2 = sw.ToString(); //throw new Exception(conMod.Email); SendToEmail(email, title2, html2, ""); } break; case "pay": //付款后 { OrderFinish(orderMod, null); } break; case "exp": { StringWriter sw = new StringWriter(); HttpContext.Current.Server.Execute("/Common/MailTlp/Order_Send.aspx?ID=" + oid, sw); string title = "Order has been shipped"; string html = sw.ToString(); SendToEmail(email, title, html, ""); SnsHelper.UpdateOrderField(oid, "EMail_Exp", "1"); } break; case "after": { DataTable orderDT = DBCenter.Sel("ZL_OrderInfo", "ID=" + oid); string title = "Order Notify"; string html = Tlp_Read("订单后期调查"); html = EventDeal.TlpDeal(html, orderDT); SendToEmail(email, title, html, ""); SnsHelper.UpdateOrderField(orderMod.id, "EMail_After", "1"); SendToEmail(SiteConfig.SiteInfo.WebmasterEmail, title, html, ""); } break; } }
//仅负责将邮件再发送出去 public static void OrderFinish(M_OrderList mod, M_Payment pinfo) { //DataTable orderDT = DBCenter.Sel(mod.TbName, "ID=" + mod.id); //DataTable contactDT = DBCenter.Sel("ZL_Order_Contact", "OrderID=" + mod.id); //DataTable cartDT = DBCenter.JoinQuery("A.*,B.PreviewImg", "ZL_CartPro", // "ZL_Logo_Design", "A.Attribute=B.ID", "A.OrderListID="+mod.id+" AND (A.Attribute IS NOT NULL AND A.Attribute !='')"); //string userHtml = Tlp_Read("订单付款后_用户"); //userHtml = TlpDeal(userHtml, contactDT); //userHtml = TlpDeal(userHtml, orderDT); ////替换购物车列表 //string cartHead = "<table><tr><td>Name</td><td>Image</td><td>Unit Price</td><td>Quantity</td><td>Total</td></tr>"; //string cartHtml = ""; //string cartEnd = "</table>"; //foreach (DataRow dr in cartDT.Rows) //{ // var cartTlp = "<tr>" // + "<td>" // + "<div>{Proname}</div>" // + "<div>{ProInfo}</div>" // + "</td>" // + "<td><img src=\"{PreviewImg}\" width=\"160\" height=\"100\"/></td>" // + "<td>{Shijia}</td>" // + "<td>{Pronum}</td>" // + "<td>{AllMoney}</td>" // + "</tr>"; // cartHtml += TlpDeal(cartTlp, cartDT, dr); //} //cartHtml = cartHead + cartHtml + cartEnd; //userHtml = userHtml.Replace("{CartList}", cartHtml); ////发送邮件给双方 //SendToEmail(mod.Email, "Order Prompt", userHtml, mod.id+""); ////----------------------发送邮件通知管理员 //string adminHtml = Tlp_Read("订单付款后_管理员"); //adminHtml = TlpDeal(userHtml, contactDT); //adminHtml = TlpDeal(userHtml, orderDT); //adminHtml = adminHtml.Replace("{CartList}", cartHtml); StringWriter sw = new StringWriter(); HttpContext.Current.Server.Execute("/Common/MailTlp/Order_Payed.aspx?ID=" + mod.id, sw); string title = "We received your order!"; string html = sw.ToString(); SendToEmail(mod.Email, title, html, mod.id.ToString()); SendToEmail(SiteConfig.SiteInfo.WebmasterEmail, title, html, mod.id.ToString()); SnsHelper.UpdateOrderField(mod.id, "EMail_Pay", "1"); }
public static M_Arrive_Result CheckArrive(string code, string pwd, double money) { M_Arrive_Result result = new M_Arrive_Result(); if (string.IsNullOrEmpty(code)) { result.err = "The coupon number cannot be empty"; } //else if (string.IsNullOrEmpty(pwd)) //{ // result.err = "The coupon password cannot be empty"; //} else if (money < 1.0) { result.err = "Incorrect order amount"; } B_Arrive avBll = new B_Arrive(); M_Arrive avMod = SnsHelper.AV_SelModel(code); result.money = money; if (avMod == null || avMod.ID < 1) { result.err = "Coupon do not exist"; } else if (avMod.State == 10) { result.err = "Coupon have been used"; } else if (avMod.State == 0) { result.err = "Coupon have not been activated"; } else if (avMod.Amount < 1.0) { result.err = "Abnormal value of coupon[" + avMod.Amount.ToString("N") + "]"; } else if (avMod.EndTime < DateTime.Now) { result.err = "Coupon have expired"; } else if (avMod.AgainTime > DateTime.Now) { result.err = "Coupon have not yet reached the available time"; } if (!string.IsNullOrEmpty(result.err)) { return(result); } result.flow = avMod.Flow; avMod.MaxAmount = avMod.MaxAmount == 0 ? 5000000 : avMod.MaxAmount; if (avMod.MinAmount > money) { result.err = "No minimum amount of use limit"; return(result); } if (avMod.MaxAmount < money) { result.err = "More than maximum use limit"; return(result); } money -= avMod.Amount; money = ((money < 0.0) ? 0.0 : money); result.money = money; result.amount = avMod.Amount; result.enabled = true; return(result); }