protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if ((e.CommandName == "CONFIRM_PAY") && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo info2 = new DebitNoteInfo();; info2 = new DebitNoteInfo { NoteId = Globals.GetGenerateId(), OrderId = e.CommandArgument.ToString(), Operator = ManagerHelper.GetCurrentManager().UserName, Remark = "后台" + info2.Operator + "收款成功" }; OrderHelper.SaveDebitNote(info2); this.BindOrders(); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); } else { this.ShowMsg("确认订单收款失败", false); } } else if (e.CommandName == "FINISH_TRADE") { orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE); } } }
protected void btnConfirmPay_Click(object sender, EventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.orderId); if ((orderInfo != null) && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo info2; info2 = new DebitNoteInfo { NoteId = Globals.GetGenerateId(), OrderId = this.orderId, Operator = ManagerHelper.GetCurrentManager().UserName, Remark = "后台" + ManagerHelper.GetCurrentManager().UserName + "收款成功" }; OrderHelper.SaveDebitNote(info2); orderInfo.OnPayment(); this.ShowMsgAndReUrl("成功的确认了订单收款", true, "OrderDetails.aspx?OrderId=" + this.orderId + "&t=" + DateTime.Now.ToString("HHmmss")); } else { this.ShowMsg("确认订单收款失败", false); } } }
protected void btnConfirmSelPayment_Click(object sender, System.EventArgs e) { string text = ""; if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { text = base.Request["CheckBoxGroup"]; } if (text.Length <= 0) { this.ShowMsg("请先选择要批量确认付款的订单", false); return; } string[] array = text.Trim(new char[] { ',' }).Split(new char[] { ',' }); int num = 0; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text2 = array2[i]; if (!string.IsNullOrEmpty(text2)) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(text2); if (orderInfo != null && OrderHelper.ConfirmPay(orderInfo)) { num++; DebitNoteInfo debitNoteInfo = new DebitNoteInfo(); debitNoteInfo.NoteId = Globals.GetGenerateId(); debitNoteInfo.OrderId = text2; debitNoteInfo.Operator = ManagerHelper.GetCurrentManager().UserName; debitNoteInfo.Remark = "后台" + debitNoteInfo.Operator + "收款成功"; OrderHelper.SaveDebitNote(debitNoteInfo); orderInfo.OnPayment(); } } } if (num > 0) { this.BindOrders(); this.ShowMsg("成功的确认了" + num.ToString() + "个订单收款", true); } else { this.ShowMsg("确认订单收款失败", false); } this.BindOrders(); }
protected void dlstOrders_ItemCommand(object sender, DataListCommandEventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if ((e.CommandName == "CONFIRM_PAY") && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int num2 = 0; int num3 = 0; int groupBuyId = orderInfo.GroupBuyId; if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo info2 = new DebitNoteInfo(); info2.NoteId = Globals.GetGenerateId(); info2.OrderId = e.CommandArgument.ToString(); info2.Operator = ManagerHelper.GetCurrentManager().UserName; info2.Remark = "后台" + info2.Operator + "收款成功"; OrderHelper.SaveDebitNote(info2); if (orderInfo.GroupBuyId > 0) { int num4 = num2 + num3; } this.BindOrders(); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); } else { this.ShowMsg("确认订单收款失败", false); } } else if ((e.CommandName == "FINISH_TRADE") && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { MemberProcessor.RemoveUserCache(orderInfo.UserId); this.BindOrders(); DistributorsBrower.UpdateCalculationCommission(orderInfo); this.ShowMsg("成功的完成了该订单", true); } else { this.ShowMsg("完成订单失败", false); } } } }
protected void btnConfirmSelPayment_Click(object sender, EventArgs e) { string str = ""; if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { str = base.Request["CheckBoxGroup"]; } if (str.Length <= 0) { this.ShowMsg("请先选择要批量确认付款的订单", false); } else { string[] strArray = str.Trim(new char[] { ',' }).Split(new char[] { ',' }); int num = 0; foreach (string str2 in strArray) { if (!string.IsNullOrEmpty(str2)) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(str2); if ((orderInfo != null) && OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo info2 = new DebitNoteInfo();; num++; info2 = new DebitNoteInfo { NoteId = Globals.GetGenerateId(), OrderId = str2, Operator = ManagerHelper.GetCurrentManager().UserName, Remark = "后台" + info2.Operator + "收款成功" }; OrderHelper.SaveDebitNote(info2); orderInfo.OnPayment(); } } } if (num > 0) { this.BindOrders(); this.ShowMsg("成功的确认了" + num.ToString() + "个订单收款", true); } else { this.ShowMsg("确认订单收款失败", false); } this.BindOrders(); } }
protected void btnConfirmPay_Click(object sender, System.EventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.orderId); if (orderInfo != null && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo debitNoteInfo = new DebitNoteInfo(); debitNoteInfo.NoteId = Globals.GetGenerateId(); debitNoteInfo.OrderId = this.orderId; debitNoteInfo.Operator = ManagerHelper.GetCurrentManager().UserName; debitNoteInfo.Remark = "后台" + debitNoteInfo.Operator + "收款成功"; OrderHelper.SaveDebitNote(debitNoteInfo); orderInfo.OnPayment(); this.ShowMsgAndReUrl("成功的确认了订单收款", true, "OrderDetails.aspx?OrderId=" + this.orderId + "&t=" + System.DateTime.Now.ToString("HHmmss")); return; } this.ShowMsg("确认订单收款失败", false); } }
protected void dlstOrders_ItemCommand(object sender, DataListCommandEventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if ((e.CommandName == "CONFIRM_PAY") && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int maxCount = 0; int orderCount = 0; int groupBuyOerderNumber = 0; if (orderInfo.GroupBuyId > 0) { GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(orderInfo.GroupBuyId); if ((groupBuy == null) || (groupBuy.Status != GroupBuyStatus.UnderWay)) { ShowMsg("当前的订单为团购订单,此团购活动已结束,所以不能支付", false); return; } orderCount = PromoteHelper.GetOrderCount(orderInfo.GroupBuyId); maxCount = groupBuy.MaxCount; groupBuyOerderNumber = orderInfo.GetGroupBuyOerderNumber(); if (maxCount < (orderCount + groupBuyOerderNumber)) { ShowMsg("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付", false); return; } } if (OrderHelper.ConfirmPay(orderInfo)) { if ((orderInfo.GroupBuyId > 0) && (maxCount == (orderCount + groupBuyOerderNumber))) { PromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId); } BindOrders(); int userId = orderInfo.UserId; if (userId == 0x44c) { userId = 0; } Messenger.OrderPayment(Users.GetUser(userId), orderInfo.OrderId, orderInfo.GetTotal()); orderInfo.OnPayment(); ShowMsg("成功的确认了订单收款", true); } else { ShowMsg("确认订单收款失败", false); } } else if ((e.CommandName == "FINISH_TRADE") && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { BindOrders(); ShowMsg("成功的完成了该订单", true); } else { ShowMsg("完成订单失败", false); } } } }
protected void dlstOrders_ItemCommand(object sender, DataListCommandEventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if ((e.CommandName == "CONFIRM_PAY") && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int maxCount = 0; int orderCount = 0; int groupBuyOerderNumber = 0; if (orderInfo.CountDownBuyId > 0) { CountDownInfo countDownBuy = TradeHelper.GetCountDownBuy(orderInfo.CountDownBuyId); if ((countDownBuy == null) || (countDownBuy.EndDate < DateTime.Now)) { this.ShowMsg("当前的订单为限时抢购订单,此活动已结束,所以不能支付", false); return; } } if (orderInfo.GroupBuyId > 0) { GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(orderInfo.GroupBuyId); if ((groupBuy == null) || (groupBuy.Status != GroupBuyStatus.UnderWay)) { this.ShowMsg("当前的订单为团购订单,此团购活动已结束,所以不能支付", false); return; } orderCount = PromoteHelper.GetOrderCount(orderInfo.GroupBuyId); maxCount = groupBuy.MaxCount; groupBuyOerderNumber = orderInfo.GetGroupBuyOerderNumber(); if (maxCount < (orderCount + groupBuyOerderNumber)) { this.ShowMsg("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付", false); return; } } if (OrderHelper.ConfirmPay(orderInfo)) { DebitNote note = new DebitNote(); note.NoteId = Globals.GetGenerateId(); note.OrderId = e.CommandArgument.ToString(); note.Operator = HiContext.Current.User.Username; note.Remark = "后台" + note.Operator + "收款成功"; OrderHelper.SaveDebitNote(note); if ((orderInfo.GroupBuyId > 0) && (maxCount == (orderCount + groupBuyOerderNumber))) { PromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId); } this.BindOrders(); int userId = orderInfo.UserId; if (userId == 0x44c) { userId = 0; } Messenger.OrderPayment(Users.GetUser(userId), orderInfo.OrderId, orderInfo.GetTotal()); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); } else { this.ShowMsg("确认订单收款失败", false); } } else if ((e.CommandName == "FINISH_TRADE") && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); this.ShowMsg("成功的完成了该订单", true); } else { this.ShowMsg("完成订单失败", false); } } } }
public void ConfirmPay(HttpContext context) { string text = context.Request["id"]; if (string.IsNullOrWhiteSpace(text)) { throw new HidistroAshxException("错误的编号"); } OrderInfo orderInfo = new OrderDao().GetOrderInfo(text); if (orderInfo == null) { throw new HidistroAshxException("错误的编号"); } if (!orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { throw new HidistroAshxException("权限不足"); } PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("hishop.plugins.payment.bankrequest"); if (paymentMode != null) { orderInfo.Gateway = paymentMode.Gateway; orderInfo.PaymentType = paymentMode.Name; orderInfo.PaymentTypeId = paymentMode.ModeId; } else { orderInfo.Gateway = "hishop.plugins.payment.bankrequest"; orderInfo.PaymentType = "线下支付"; orderInfo.PaymentTypeId = 0; } int num = 0; int num2 = 0; int num3 = 0; if (orderInfo.CountDownBuyId > 0) { string empty = string.Empty; foreach (KeyValuePair <string, LineItemInfo> lineItem in orderInfo.LineItems) { CountDownInfo countDownInfo = TradeHelper.CheckUserCountDown(lineItem.Value.ProductId, orderInfo.CountDownBuyId, lineItem.Value.SkuId, orderInfo.UserId, orderInfo.GetAllQuantity(true), orderInfo.OrderId, out empty, orderInfo.StoreId); if (countDownInfo == null) { throw new HidistroAshxException(empty); } } } if (orderInfo.FightGroupId > 0) { string empty2 = string.Empty; foreach (KeyValuePair <string, LineItemInfo> lineItem2 in orderInfo.LineItems) { FightGroupActivityInfo fightGroupActivityInfo = VShopHelper.CheckUserFightGroup(lineItem2.Value.ProductId, orderInfo.FightGroupActivityId, orderInfo.FightGroupId, lineItem2.Value.SkuId, orderInfo.UserId, orderInfo.GetAllQuantity(true), orderInfo.OrderId, lineItem2.Value.Quantity, out empty2); if (fightGroupActivityInfo == null) { throw new HidistroAshxException(empty2); } } } if (orderInfo.GroupBuyId > 0) { GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(orderInfo.GroupBuyId); if (groupBuy == null || groupBuy.Status != GroupBuyStatus.UnderWay) { throw new HidistroAshxException("当前的订单为团购订单,此团购活动已结束,所以不能支付"); } num2 = PromoteHelper.GetOrderCount(orderInfo.GroupBuyId); num = groupBuy.MaxCount; num3 = orderInfo.GetGroupBuyOerderNumber(); if (num < num2 + num3) { throw new HidistroAshxException("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付"); } } if (orderInfo.PreSaleId > 0) { ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId); if (productPreSaleInfo == null) { throw new HidistroAshxException("预售活动不存在"); } if (!orderInfo.DepositDate.HasValue && productPreSaleInfo.PreSaleEndDate < DateTime.Now) { throw new HidistroAshxException("预售活动已结束不能支付定金,所以不能确认收款"); } } string empty3 = string.Empty; switch (TradeHelper.CheckOrderBeforePay(orderInfo, out empty3)) { case 1: throw new HidistroAshxException($"当前有商品{empty3}下架或者被删除,不能确认收款"); case 2: if ((orderInfo.PreSaleId <= 0 || orderInfo.DepositDate.HasValue) && orderInfo.PreSaleId > 0) { break; } throw new HidistroAshxException($"当前有商品{empty3}库存不足,不能确认收款"); } if (OrderHelper.ConfirmPay(orderInfo)) { if (orderInfo.GroupBuyId > 0 && num == num2 + num3) { PromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId); } if (orderInfo.ParentOrderId == "-1") { OrderQuery orderQuery = new OrderQuery(); orderQuery.ParentOrderId = orderInfo.OrderId; IList <OrderInfo> listUserOrder = MemberProcessor.GetListUserOrder(orderInfo.UserId, orderQuery); foreach (OrderInfo item in listUserOrder) { OrderHelper.OrderConfirmPaySendMessage(item); } } else { OrderHelper.OrderConfirmPaySendMessage(orderInfo); } base.ReturnSuccessResult(context, "成功的确认了订单收款", 0, true); return; } throw new HidistroAshxException("确认订单收款失败"); }
protected void rptList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { bool flag = false; OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if (e.CommandName == "CONFIRM_PAY" && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int num = 0; int num2 = 0; int arg_49_0 = orderInfo.GroupBuyId; if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo debitNoteInfo = new DebitNoteInfo(); debitNoteInfo.NoteId = Globals.GetGenerateId(); debitNoteInfo.OrderId = e.CommandArgument.ToString(); debitNoteInfo.Operator = ManagerHelper.GetCurrentManager().UserName; debitNoteInfo.Remark = "后台" + debitNoteInfo.Operator + "收款成功"; OrderHelper.SaveDebitNote(debitNoteInfo); if (orderInfo.GroupBuyId > 0) { int arg_BE_0 = num + num2; } this.BindOrders(); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); return; } this.ShowMsg("确认订单收款失败", false); return; } else if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { System.Collections.Generic.Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems; LineItemInfo lineItemInfo = new LineItemInfo(); foreach (System.Collections.Generic.KeyValuePair <string, LineItemInfo> current in lineItems) { lineItemInfo = current.Value; if (lineItemInfo.OrderItemsStatus == OrderStatus.ApplyForRefund || lineItemInfo.OrderItemsStatus == OrderStatus.ApplyForReturns) { flag = true; } } if (!flag) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); DistributorsBrower.UpdateCalculationCommission(orderInfo); foreach (LineItemInfo current2 in orderInfo.LineItems.Values) { if (current2.OrderItemsStatus.ToString() == OrderStatus.SellerAlreadySent.ToString()) { RefundHelper.UpdateOrderGoodStatu(orderInfo.OrderId, current2.SkuId, 5, current2.ID); } } this.ShowMsg("成功的完成了该订单", true); return; } this.ShowMsg("完成订单失败", false); return; } else { this.ShowMsg("订单中商品有退货(款)不允许完成!", false); } } } }
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { bool flag = false; OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if ((e.CommandName == "CONFIRM_PAY") && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int num2 = 0; int num3 = 0; int groupBuyId = orderInfo.GroupBuyId; if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo info2; info2 = new DebitNoteInfo { NoteId = Globals.GetGenerateId(), OrderId = e.CommandArgument.ToString(), Operator = ManagerHelper.GetCurrentManager().UserName, Remark = "后台" + ManagerHelper.GetCurrentManager().UserName + "收款成功" }; OrderHelper.SaveDebitNote(info2); if (orderInfo.GroupBuyId > 0) { int num6 = num2 + num3; } this.BindOrders(); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); } else { this.ShowMsg("确认订单收款失败", false); } } else if ((e.CommandName == "FINISH_TRADE") && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems; LineItemInfo info3 = new LineItemInfo(); foreach (KeyValuePair <string, LineItemInfo> pair in lineItems) { info3 = pair.Value; if ((info3.OrderItemsStatus == OrderStatus.ApplyForRefund) || (info3.OrderItemsStatus == OrderStatus.ApplyForReturns)) { flag = true; } } if (!flag) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); DistributorsBrower.UpdateCalculationCommission(orderInfo); foreach (LineItemInfo info4 in orderInfo.LineItems.Values) { if (info4.OrderItemsStatus.ToString() == OrderStatus.SellerAlreadySent.ToString()) { RefundHelper.UpdateOrderGoodStatu(orderInfo.OrderId, info4.SkuId, 5); } } this.myNotifier.updateAction = UpdateAction.OrderUpdate; this.myNotifier.actionDesc = "订单已完成"; if (orderInfo.PayDate.HasValue) { this.myNotifier.RecDateUpdate = orderInfo.PayDate.Value; } else { this.myNotifier.RecDateUpdate = DateTime.Today; } this.ShowMsg("成功的完成了该订单", true); } else { this.ShowMsg("完成订单失败", false); } } else { this.ShowMsg("订单中商品有退货(款)不允许完成!", false); } } else if (e.CommandName == "delete") { string str = e.CommandArgument.ToString(); int num4 = OrderHelper.RealDeleteOrders("'" + str.Replace(",", "','") + "'"); this.BindOrders(); this.ShowMsg(string.Format("成功删除了{0}个订单", num4), true); } else if (e.CommandName == "restore") { string str2 = e.CommandArgument.ToString(); int num5 = OrderHelper.RestoreOrders("'" + str2.Replace(",", "','") + "'"); this.BindOrders(); this.ShowMsg(string.Format("成功还原了订单", num5), true); } } }
protected void dlstOrders_ItemCommand(object sender, System.Web.UI.WebControls.DataListCommandEventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if (e.CommandName == "CONFIRM_PAY" && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int num = 0; int num2 = 0; int num3 = 0; if (orderInfo.CountDownBuyId > 0) { CountDownInfo countDownBuy = TradeHelper.GetCountDownBuy(orderInfo.CountDownBuyId); if (countDownBuy == null || countDownBuy.EndDate < System.DateTime.Now) { this.ShowMsg("当前的订单为限时抢购订单,此活动已结束,所以不能支付", false); return; } } if (orderInfo.GroupBuyId > 0) { GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(orderInfo.GroupBuyId); if (groupBuy != null) { if (groupBuy.Status == GroupBuyStatus.UnderWay) { num2 = PromoteHelper.GetOrderCount(orderInfo.GroupBuyId); num = groupBuy.MaxCount; num3 = orderInfo.GetGroupBuyOerderNumber(); if (num < num2 + num3) { this.ShowMsg("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付", false); return; } goto IL_E2; } } this.ShowMsg("当前的订单为团购订单,此团购活动已结束,所以不能支付", false); return; } IL_E2: if (OrderHelper.ConfirmPay(orderInfo)) { DebitNote debitNote = new DebitNote(); debitNote.NoteId = Globals.GetGenerateId(); debitNote.OrderId = e.CommandArgument.ToString(); debitNote.Operator = Hidistro.Membership.Context.HiContext.Current.User.Username; debitNote.Remark = "后台" + debitNote.Operator + "收款成功"; OrderHelper.SaveDebitNote(debitNote); if (orderInfo.GroupBuyId > 0 && num == num2 + num3) { PromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId); } this.BindOrders(); int num4 = orderInfo.UserId; if (num4 == 1100) { num4 = 0; } Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num4); Messenger.OrderPayment(user, orderInfo.OrderId, orderInfo.GetTotal()); orderInfo.OnPayment(); this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "sucess", string.Format("<script language=\"javascript\" >alert('确认收款成功');window.location.href=\"{0}\"</script>", System.Web.HttpContext.Current.Request.RawUrl)); return; } this.ShowMsg("确认订单收款失败", false); return; } else { if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); this.ShowMsg("成功的完成了该订单", true); return; } this.ShowMsg("完成订单失败", false); return; } else { if (e.CommandName == "Match_Order") { if (orderInfo == null) { return; } if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Success) { this.ShowMsg("当前订单为团购订单,团购活动还未成功结束,所以不能发货", false); return; } if (!orderInfo.CheckAction(OrderActions.SELLER_SEND_GOODS)) { this.ShowMsg("当前订单状态没有付款或不是等待发货的订单,所以不能发货", false); return; } if (Methods.Supplier_OrderIsFenPei(e.CommandArgument.ToString())) { this.ShowMsg("生成成功", true); return; } string text = Methods.Supplier_OrderItemSupplierUpdate(orderInfo); if (text != "true") { this.ShowMsg(text, false); return; } orderInfo.RealShippingModeId = 0; orderInfo.RealModeName = "配送方式(已实际发货单为准)"; orderInfo.ShipOrderNumber = string.Format("{0}", string.Format(" <a style=\"color:red;cursor:pointer;\" target=\"_blank\" onclick=\"{0}\">物流详细</a>", "showWindow_ShipInfoPage('" + orderInfo.OrderId + "')")); if (OrderHelper.SendGoods(orderInfo)) { Methods.Supplier_OrderItemsSupplierFenPeiOverUpdate(orderInfo.OrderId); if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && orderInfo.GatewayOrderId.Trim().Length > 0) { PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(orderInfo.PaymentTypeId); if (paymentMode != null) { PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderInfo.OrderId, orderInfo.GetTotal(), "订单发货", "订单号-" + orderInfo.OrderId, orderInfo.EmailAddress, orderInfo.OrderDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentReturn_url", new object[] { paymentMode.Gateway })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("PaymentNotify_url", new object[] { paymentMode.Gateway })), ""); paymentRequest.SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS"); } } int num5 = orderInfo.UserId; if (num5 == 1100) { num5 = 0; } Hidistro.Membership.Core.IUser user2 = Hidistro.Membership.Context.Users.GetUser(num5); Messenger.OrderShipping(orderInfo, user2); orderInfo.OnDeliver(); this.ShowMsg("生成成功", true); this.BindOrders(); return; } this.ShowMsg("发货失败", false); this.ShowMsg("生成成功", true); } } } } }
private void ConfirmPayOrder(HttpContext context) { SiteSettings currentSiteSetting = base.CurrentSiteSetting; string text = context.Request.Form["orderId"]; if (string.IsNullOrWhiteSpace(text)) { throw new HidistroAshxException("异常的参数:订单编号"); } OrderInfo orderInfo = OrderHelper.GetOrderInfo(text); if (orderInfo == null) { throw new HidistroAshxException("异常的参数:订单编号"); } if (!orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { return; } PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode("hishop.plugins.payment.bankrequest"); if (paymentMode != null) { orderInfo.Gateway = paymentMode.Gateway; orderInfo.PaymentType = paymentMode.Name; orderInfo.PaymentTypeId = paymentMode.ModeId; } else { orderInfo.Gateway = "hishop.plugins.payment.bankrequest"; orderInfo.PaymentType = "线下支付"; orderInfo.PaymentTypeId = 0; } orderInfo.IsStoreCollect = true; int num = 0; int num2 = 0; int num3 = 0; if (orderInfo.CountDownBuyId > 0) { string empty = string.Empty; foreach (KeyValuePair <string, LineItemInfo> lineItem in orderInfo.LineItems) { CountDownInfo countDownInfo = TradeHelper.CheckUserCountDown(lineItem.Value.ProductId, orderInfo.CountDownBuyId, lineItem.Value.SkuId, HiContext.Current.UserId, orderInfo.GetAllQuantity(true), orderInfo.OrderId, out empty, orderInfo.StoreId); if (countDownInfo == null) { throw new HidistroAshxException(empty); } } } if (orderInfo.GroupBuyId > 0) { GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(orderInfo.GroupBuyId); if (groupBuy == null || groupBuy.Status != GroupBuyStatus.UnderWay) { throw new HidistroAshxException("当前的订单为团购订单,此团购活动已结束,所以不能支付"); } num2 = PromoteHelper.GetOrderCount(orderInfo.GroupBuyId); num = groupBuy.MaxCount; num3 = orderInfo.GetGroupBuyOerderNumber(); if (num < num2 + num3) { throw new HidistroAshxException("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付"); } } if (orderInfo.PreSaleId > 0) { ProductPreSaleInfo productPreSaleInfo = ProductPreSaleHelper.GetProductPreSaleInfo(orderInfo.PreSaleId); if (productPreSaleInfo == null) { throw new HidistroAshxException("预售活动不存在"); } if (!orderInfo.DepositDate.HasValue && productPreSaleInfo.PreSaleEndDate < DateTime.Now) { throw new HidistroAshxException("预售活动已结束不能支付定金,所以不能确认收款"); } } if (OrderHelper.ConfirmPay(orderInfo)) { if (orderInfo.GroupBuyId > 0 && num == num2 + num3) { PromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId); } if (orderInfo.ParentOrderId == "-1") { OrderQuery orderQuery = new OrderQuery(); orderQuery.ParentOrderId = orderInfo.OrderId; IList <OrderInfo> listUserOrder = MemberProcessor.GetListUserOrder(orderInfo.UserId, orderQuery); foreach (OrderInfo item in listUserOrder) { OrderHelper.OrderConfirmPaySendMessage(item); } } else { OrderHelper.OrderConfirmPaySendMessage(orderInfo); } base.ReturnResult(context, true, "成功的确认了订单收款", 0, true); return; } throw new HidistroAshxException("确认订单收款失败"); }
protected void rptList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e) { bool flag = false; OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if (e.CommandName == "CONFIRM_PAY" && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int num = 0; int num2 = 0; int arg_49_0 = orderInfo.GroupBuyId; if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo debitNoteInfo = new DebitNoteInfo(); debitNoteInfo.NoteId = Globals.GetGenerateId(); debitNoteInfo.OrderId = e.CommandArgument.ToString(); debitNoteInfo.Operator = ManagerHelper.GetCurrentManager().UserName; debitNoteInfo.Remark = "后台" + debitNoteInfo.Operator + "收款成功"; OrderHelper.SaveDebitNote(debitNoteInfo); if (orderInfo.GroupBuyId > 0) { int arg_BE_0 = num + num2; } this.BindOrders(); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); return; } this.ShowMsg("确认订单收款失败", false); return; } else if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { System.Collections.Generic.Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems; LineItemInfo lineItemInfo = new LineItemInfo(); foreach (System.Collections.Generic.KeyValuePair <string, LineItemInfo> current in lineItems) { lineItemInfo = current.Value; if (lineItemInfo.OrderItemsStatus == OrderStatus.ApplyForRefund || lineItemInfo.OrderItemsStatus == OrderStatus.ApplyForReturns) { flag = true; } } if (!flag) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); this.myNotifier.updateAction = UpdateAction.OrderUpdate; this.myNotifier.actionDesc = "订单已完成"; if (orderInfo.PayDate.HasValue) { this.myNotifier.RecDateUpdate = orderInfo.PayDate.Value; } else { this.myNotifier.RecDateUpdate = System.DateTime.Today; } this.myNotifier.DataUpdated += new StatisticNotifier.DataUpdatedEventHandler(this.myEvent.Update); this.myNotifier.UpdateDB(); this.ShowMsg("成功的完成了该订单", true); return; } this.ShowMsg("完成订单失败", false); return; } else { this.ShowMsg("订单中商品有退货(款)不允许完成!", false); } } } }
protected void Page_Load(object sender, EventArgs e) { SortedDictionary <string, string> sPara = GetRequestGet(); if (sPara.Count > 0)//判断是否有带返回参数 { AlipayNotify aliNotify = new AlipayNotify(); bool verifyResult = aliNotify.Verify(sPara, Request.QueryString["notify_id"], Request.QueryString["sign"]); if (verifyResult)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表 //商户订单号 string out_trade_no = Request.QueryString["out_trade_no"]; //支付宝交易号 string trade_no = Request.QueryString["trade_no"]; //交易状态 string trade_status = Request.QueryString["trade_status"]; OrderInfo orderInfo = OrderHelper.GetOrderInfo(out_trade_no); if ((Request.QueryString["trade_status"] == "TRADE_FINISHED" || Request.QueryString["trade_status"] == "TRADE_SUCCESS") && orderInfo != null) { //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //如果有做过处理,不执行商户的业务程序 if (orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { if (OrderHelper.ConfirmPay(orderInfo)) { Response.Write("<script>alert('订单付款成功');location.href='/Admin/productdl/AgentOrders.aspx'</script>"); } else { Response.Write("<script>alert('订单付款失败');location.href='/Admin/productdl/AgentOrders.aspx'</script>"); } } } else { Response.Write("trade_status=" + Request.QueryString["trade_status"]); } //——请根据您的业务逻辑来编写程序(以上代码仅作参考)—— ///////////////////////////////////////////////////////////////////////////////////////////////////////////// } else//验证失败 { Response.Write("验证失败"); } } else { Response.Write("无返回参数"); } }
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { bool flag = false; OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if ((e.CommandName == "CONFIRM_PAY") && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int num2 = 0; int num3 = 0; int groupBuyId = orderInfo.GroupBuyId; if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo info2 = new DebitNoteInfo(); info2 = new DebitNoteInfo { NoteId = Globals.GetGenerateId(), OrderId = e.CommandArgument.ToString(), Operator = ManagerHelper.GetCurrentManager().UserName, Remark = "后台" + info2.Operator + "收款成功" }; OrderHelper.SaveDebitNote(info2); if (orderInfo.GroupBuyId > 0) { int num4 = num2 + num3; } this.BindOrders(); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); } else { this.ShowMsg("确认订单收款失败", false); } } else if ((e.CommandName == "FINISH_TRADE") && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems; LineItemInfo info3 = new LineItemInfo(); foreach (KeyValuePair <string, LineItemInfo> pair in lineItems) { info3 = pair.Value; if ((info3.OrderItemsStatus == OrderStatus.ApplyForRefund) || (info3.OrderItemsStatus == OrderStatus.ApplyForReturns)) { flag = true; } } if (!flag) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); this.myNotifier.updateAction = UpdateAction.OrderUpdate; this.myNotifier.actionDesc = "订单已完成"; if (orderInfo.PayDate.HasValue) { this.myNotifier.RecDateUpdate = orderInfo.PayDate.Value; } else { this.myNotifier.RecDateUpdate = DateTime.Today; } this.myNotifier.DataUpdated += new StatisticNotifier.DataUpdatedEventHandler(this.myEvent.Update); this.myNotifier.UpdateDB(); this.ShowMsg("成功的完成了该订单", true); } else { this.ShowMsg("完成订单失败", false); } } else { this.ShowMsg("订单中商品有退货(款)不允许完成!", false); } } } }
protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { bool flag = false; OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if ((e.CommandName == "CONFIRM_PAY") && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int num2 = 0; int num3 = 0; int groupBuyId = orderInfo.GroupBuyId; if (OrderHelper.ConfirmPay(orderInfo)) { DebitNoteInfo info2 = new DebitNoteInfo(); info2.NoteId = Globals.GetGenerateId(); info2.OrderId = e.CommandArgument.ToString(); info2.Operator = ManagerHelper.GetCurrentManager().UserName; info2.Remark = "后台" + info2.Operator + "收款成功"; OrderHelper.SaveDebitNote(info2); if (orderInfo.GroupBuyId > 0) { int num4 = num2 + num3; } this.BindOrders(); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); } else { this.ShowMsg("确认订单收款失败", false); } } else if ((e.CommandName == "FINISH_TRADE") && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { Dictionary <string, LineItemInfo> lineItems = orderInfo.LineItems; LineItemInfo info3 = new LineItemInfo(); foreach (KeyValuePair <string, LineItemInfo> pair in lineItems) { info3 = pair.Value; if ((info3.OrderItemsStatus == OrderStatus.ApplyForRefund) || (info3.OrderItemsStatus == OrderStatus.ApplyForReturns)) { flag = true; } } if (!flag) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); DistributorsBrower.UpdateCalculationCommission(orderInfo, wid); foreach (LineItemInfo info4 in orderInfo.LineItems.Values) { if (info4.OrderItemsStatus.ToString() == OrderStatus.SellerAlreadySent.ToString()) { RefundHelper.UpdateOrderGoodStatu(orderInfo.OrderId, info4.SkuId, 5); } } this.ShowMsg("成功的完成了该订单", true); } else { this.ShowMsg("完成订单失败", false); } } else { this.ShowMsg("订单中商品有退货(款)不允许完成!", false); } } } }
protected void dlstOrders_ItemCommand(object sender, System.Web.UI.WebControls.DataListCommandEventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(e.CommandArgument.ToString()); if (orderInfo != null) { if (e.CommandName == "CONFIRM_PAY" && orderInfo.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { int num = 0; int num2 = 0; int num3 = 0; if (orderInfo.CountDownBuyId > 0) { CountDownInfo countDownBuy = TradeHelper.GetCountDownBuy(orderInfo.CountDownBuyId); if (countDownBuy == null || countDownBuy.EndDate < System.DateTime.Now) { this.ShowMsg("当前的订单为限时抢购订单,此活动已结束,所以不能支付", false); return; } } if (orderInfo.GroupBuyId > 0) { GroupBuyInfo groupBuy = PromoteHelper.GetGroupBuy(orderInfo.GroupBuyId); if (groupBuy != null) { if (groupBuy.Status == GroupBuyStatus.UnderWay) { num2 = PromoteHelper.GetOrderCount(orderInfo.GroupBuyId); num = groupBuy.MaxCount; num3 = orderInfo.GetGroupBuyOerderNumber(); if (num < num2 + num3) { this.ShowMsg("当前的订单为团购订单,订购数量已超过订购总数,所以不能支付", false); return; } goto IL_D9; } } this.ShowMsg("当前的订单为团购订单,此团购活动已结束,所以不能支付", false); return; } IL_D9: if (OrderHelper.ConfirmPay(orderInfo)) { if (orderInfo.GroupBuyId > 0 && num == num2 + num3) { PromoteHelper.SetGroupBuyEndUntreated(orderInfo.GroupBuyId); } this.BindOrders(); int num4 = orderInfo.UserId; if (num4 == 1100) { num4 = 0; } Hidistro.Membership.Core.IUser user = Hidistro.Membership.Context.Users.GetUser(num4); Messenger.OrderPayment(user, orderInfo.OrderId, orderInfo.GetTotal()); orderInfo.OnPayment(); this.ShowMsg("成功的确认了订单收款", true); return; } this.ShowMsg("确认订单收款失败", false); return; } else { if (e.CommandName == "FINISH_TRADE" && orderInfo.CheckAction(OrderActions.SELLER_FINISH_TRADE)) { if (OrderHelper.ConfirmOrderFinish(orderInfo)) { this.BindOrders(); this.ShowMsg("成功的完成了该订单", true); return; } this.ShowMsg("完成订单失败", false); } } } }