public void AddItemRelated(int sysno, int freightUserSysNo, DLItemInfo dlItem, int DLItemType, int updateUser) { TransactionOptions options = new TransactionOptions(); options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; options.Timeout = TransactionManager.DefaultTimeout; using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options)) { Hashtable ht = new Hashtable(); ht.Add("SysNo", sysno); ht.Add("FreightUserSysNo", freightUserSysNo); ht.Add("SetDeliveryManTime", DateTime.Now); ht.Add("DLSysNo", dlItem.DLSysNo); if (DLItemType == (int)AppEnum.DLItemType.SaleOrder) { SaleManager.GetInstance().UpdateSOMaster(ht); } else if (DLItemType == (int)AppEnum.DLItemType.RMARequest) { RMARequestManager.GetInstance().SetDeliveryMen(ht); } else if (DLItemType == (int)AppEnum.DLItemType.RMARevert) { RMARevertManager.GetInstance().SetDeliveryMen(ht); } else if (DLItemType == (int)AppEnum.DLItemType.RMAOutbound) { RMAOutBoundManager.GetInstance().SetDeliveryMen(ht); } else if (DLItemType == (int)AppEnum.DLItemType.RMASendAccessory) { RMASendAccessoryManager.GetInstance().SetDeliveryMen(ht); } else if (DLItemType == (int)AppEnum.DLItemType.StShift) { ShiftManager.GetInstance().UpdateShiftMaster(ht); } DeliveryManSetListInfo oInfo = new DeliveryManSetListInfo(); oInfo.ItemID = dlItem.ItemID; oInfo.SetUserSysNo = updateUser; oInfo.FreightUserSysNo = freightUserSysNo; oInfo.CreateTime = DateTime.Now; oInfo.DLSysNo = dlItem.DLSysNo; DeliveryManager.GetInstance().InsertDeliveryMenSetList(oInfo); DLManager.GetInstance().AddNewDLItem(dlItem); scope.Complete(); } }
public void ChangeFreight(DLInfo oDLMasterInfo) { TransactionOptions options = new TransactionOptions(); options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; options.Timeout = TransactionManager.DefaultTimeout; using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options)) { //更新DL主表信息 UpdateDLMaster(oDLMasterInfo); DLInfo oDLInfo = Load(oDLMasterInfo.SysNo); //更新各单据配送人信息 DeliveryManSetListInfo deliveryInfo = new DeliveryManSetListInfo(); deliveryInfo.SetUserSysNo = oDLMasterInfo.UpdateFreightManUserSysNo; deliveryInfo.FreightUserSysNo = oDLMasterInfo.FreightUserSysNo; deliveryInfo.CreateTime = DateTime.Now; deliveryInfo.DLSysNo = oDLMasterInfo.SysNo; foreach (DLItemInfo oItem in oDLInfo.ItemHash.Values) { if (oItem.ItemType == (int)AppEnum.DLItemType.SaleOrder) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(1))); SaleManager.GetInstance().UpdateSOMaster(ht); } else if (oItem.ItemType == (int)AppEnum.DLItemType.RMARequest) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2))); RMARequestManager.GetInstance().SetDeliveryMen(ht); } else if (oItem.ItemType == (int)AppEnum.DLItemType.RMARevert) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2))); RMARevertManager.GetInstance().SetDeliveryMen(ht); } else if (oItem.ItemType == (int)AppEnum.DLItemType.RMAOutbound) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2))); RMAOutBoundManager.GetInstance().SetDeliveryMen(ht); } else if (oItem.ItemType == (int)AppEnum.DLItemType.RMASendAccessory) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2))); RMASendAccessoryManager.GetInstance().SetDeliveryMen(ht); } deliveryInfo.ItemID = oItem.ItemID; DeliveryManager.GetInstance().InsertDeliveryMenSetList(deliveryInfo); } scope.Complete(); } }
/// <summary> /// 获得用户的订单列表 /// </summary> /// <param name="customSysNo"></param> /// <param name="pageNum"></param> /// <returns></returns> public static string GetCustomerOrderList(int customSysNo, int pageNum) { string orderListHTML = String.Empty; int pageCount = int.Parse(YoeJoyConfig.MyOrderProductListPagedCount); List <OrderModuel> orderList = OrderService.GetMyOrder(customSysNo, pageNum, pageCount); if (orderList != null) { StringBuilder strb = new StringBuilder(); string tabRowHTMLTemplate = @" <tr class='orderList'> <td> <img src='{0}'> </td> <td> <p><a href='{1}'>{2}</a></p> <p><b>¥{3}</b>X{4}</p> </td> <th> <a class='reBuy' href='{5}'>再次购买</a><br> <a class='reBuy' href='{6}'>发表评论</a> </th> </tr>"; foreach (var orderListItem in orderList) { strb.Append(@"<table class='order' cellSpacing='0' cellPadding='0'><tbody>"); string orderDetailDeeplink = String.Concat(YoeJoyConfig.SiteBaseURL, "User/MyOrderDetail.aspx?ID=", orderListItem.SysNo); string orderUpdateDeeplink = String.Concat(YoeJoyConfig.SiteBaseURL, "User/MyOrderDetail.aspx?action=update&ID=", orderListItem.SysNo); string orderCancelDeeplink = String.Concat(YoeJoyConfig.SiteBaseURL, "User/MyOrderDetail.aspx?action=cancel&ID=", orderListItem.SysNo); bool IsNet = (orderListItem.IsNet == (int)AppEnum.YNStatus.Yes) ? true : false; bool IsPayWhenRecv = (orderListItem.IsPayWhenEcv == (int)AppEnum.YNStatus.Yes) ? true : false; strb.Append("<tr><th class='orderNum' rowSpan='3'>"); strb.Append("<p>订单编号:<a href='" + orderDetailDeeplink + "'>" + orderListItem.SysNo + "</a></p>"); strb.Append("<p>订购日期:" + orderListItem.OrderDate.ToString("yyyy-mm-dd") + "</p>"); if (IsNet) { strb.Append("<p>付款方式:在线支付</p>"); } if (IsPayWhenRecv) { strb.Append("<p>订单总计:¥" + orderListItem.TotalCash.ToString("#####0.00") + "</p>"); } strb.Append("<p>使用积分:" + orderListItem.PointPay + "</p>"); strb.Append("<p>可获积分:" + orderListItem.Pointamt + "</p>"); strb.Append("<p><a href='" + orderDetailDeeplink + "'>订单详情</a></p>"); strb.Append("</th><td colSpan='3'><h2 class='ordertitlts'><span class='l'><b>"); strb.Append(AppEnum.GetSOStatus(Util.TrimIntNull(orderListItem.Status))); strb.Append("</b></span><span class='r'>"); bool isPayed = NetPayManager.GetInstance().IsPayed(orderListItem.SysNo); if (orderListItem.Status == (int)AppEnum.SOStatus.Origin && !isPayed) { strb.Append("<a href='MyOrderDetail.aspx?action=cancel&ID=" + orderListItem.SysNo + "'>作废订单</a>"); strb.Append("<a href='MyOrderDetail.aspx?action=update&ID=" + orderListItem.SysNo + "'>修改订单</a>"); } if (orderListItem.Status == (int)AppEnum.SOStatus.Origin || orderListItem.Status == (int)AppEnum.SOStatus.WaitingPay || orderListItem.Status == (int)AppEnum.SOStatus.WaitingManagerAudit) { if (Util.TrimNull(orderListItem.PagementPage) != AppConst.StringNull && !isPayed && Util.TrimIntNull(orderListItem.IsNet) == (int)AppEnum.YNStatus.Yes) { strb.Append("<a href='../Shopping/" + Util.TrimNull(orderListItem.PagementPage) + "?id=" + orderListItem.SysNo + "&sono=" + orderListItem.SoId + "&soamt=" + orderListItem.TotalCash.ToString("#####0.00") + "'>支付货款</a>"); } } DataTable dt = RMARequestManager.GetInstance().GetRMABySO(orderListItem.SysNo); if (dt != null) { strb.Append("<a href='../Account/RMAQuery.aspx?Type=single&ID=" + orderListItem.SysNo + "'>查看返修信息</a>"); } strb.Append("<a href='MyOrderDetail.aspx?ID=" + orderListItem.SysNo + "'>查看订单明细</a>"); if (Util.TrimNull(orderListItem.Memo) != String.Empty) { strb.Append("<tr><td height=25px align=right bgcolor=#E7F9F9>备注信息:</td><td colspan=5 bgcolor=#ffffff>" + orderListItem.Memo + "</td></tr>"); } strb.Append(" </span></h2></td>"); strb.Append("</tr>"); if (orderListItem.ProductList != null) { foreach (var productListItem in orderListItem.ProductList) { string deeplink = String.Concat(YoeJoyConfig.SiteBaseURL, "Pages/Product.aspx?c1=", productListItem.C1SysNo, "&c2=", productListItem.C2SysNo, "&c3=", productListItem.C3SysNo, "&pid=", productListItem.ProductSysNo); string image = String.Concat(YoeJoyConfig.ImgVirtualPathBase, productListItem.ImgPath); strb.Append(String.Format(tabRowHTMLTemplate, image, deeplink, productListItem.ProductBriefName, productListItem.Cost, productListItem.Quantity, deeplink, deeplink)); } } strb.Append("</tbody></table>"); } orderListHTML = strb.ToString(); } return(orderListHTML); }