private void btnSendGoods_Click(object sender, EventArgs e) { if (this.grdOrderGoods.Rows.Count <= 0) { this.ShowMsg("没有要进行发货的订单。", false); } else { DropdownColumn column = (DropdownColumn)this.grdOrderGoods.Columns[4]; ListItemCollection selectedItems = column.SelectedItems; DropdownColumn column2 = (DropdownColumn)this.grdOrderGoods.Columns[5]; ListItemCollection items2 = column2.SelectedItems; int num = 0; for (int i = 0; i < selectedItems.Count; i++) { string orderId = (string)this.grdOrderGoods.DataKeys[this.grdOrderGoods.Rows[i].RowIndex].Value; TextBox box = (TextBox)this.grdOrderGoods.Rows[i].FindControl("txtShippOrderNumber"); ListItem item = selectedItems[i]; ListItem item2 = items2[i]; int result = 0; int.TryParse(item.Value, out result); if ((!string.IsNullOrEmpty(box.Text.Trim()) && !string.IsNullOrEmpty(item.Value)) && ((int.Parse(item.Value) > 0) && !string.IsNullOrEmpty(item2.Value))) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(orderId); if ((((orderInfo.GroupBuyId <= 0) || (orderInfo.GroupBuyStatus == GroupBuyStatus.Success)) && (((orderInfo.OrderStatus == OrderStatus.WaitBuyerPay) && (orderInfo.Gateway == "hishop.plugins.payment.podrequest")) || (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid))) && (((result > 0) && !string.IsNullOrEmpty(box.Text.Trim())) && (box.Text.Trim().Length <= 20))) { ShippingModeInfo shippingMode = SalesHelper.GetShippingMode(result, true); orderInfo.RealShippingModeId = shippingMode.ModeId; orderInfo.RealModeName = shippingMode.Name; orderInfo.ExpressCompanyAbb = item2.Value; orderInfo.ExpressCompanyName = item2.Text; orderInfo.ShipOrderNumber = box.Text; if (OrderHelper.SendGoods(orderInfo)) { SendNoteInfo info3 = new SendNoteInfo(); info3.NoteId = Globals.GetGenerateId() + num; info3.OrderId = orderId; info3.Operator = ManagerHelper.GetCurrentManager().UserName; info3.Remark = "后台" + info3.Operator + "发货成功"; OrderHelper.SaveSendNote(info3); if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && (orderInfo.GatewayOrderId.Trim().Length > 0)) { if (orderInfo.Gateway == "hishop.plugins.payment.ws_wappay.wswappayrequest") { PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(orderInfo.PaymentTypeId); if (paymentMode != null) { 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 })), "").SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS"); } } if (orderInfo.Gateway == "hishop.plugins.payment.weixinrequest") { SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PayClient client = new PayClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, masterSettings.WeixinPaySignKey); DeliverInfo deliver = new DeliverInfo { TransId = orderInfo.GatewayOrderId, OutTradeNo = orderInfo.OrderId, OpenId = MemberHelper.GetMember(orderInfo.UserId).OpenId }; client.DeliverNotify(deliver); } } orderInfo.OnDeliver(); num++; } } } } if (num == 0) { this.ShowMsg("批量发货失败!", false); } else if (num > 0) { this.BindData(); this.ShowMsg(string.Format("批量发货成功!发货数量{0}个", num), true); } } }
protected void Page_Load(object sender, System.EventArgs e) { this.userid = ManagerHelper.GetCurrentManager().SiteId; this.ListImage1.ImageUrl = "/Templates/common/images/user.png"; DistributorsQuery distributorsQuery = new DistributorsQuery(); distributorsQuery.UserId = this.userid; distributorsQuery.ReferralStatus = -1; distributorsQuery.PageIndex = 1; distributorsQuery.PageSize = 1; distributorsQuery.SortOrder = SortAction.Desc; distributorsQuery.SortBy = "userid"; Globals.EntityCoding(distributorsQuery, true); DbQueryResult distributors = VShopHelper.GetDistributors(distributorsQuery, null, null); System.Data.DataTable dataTable = new System.Data.DataTable(); if (distributors.Data != null) { dataTable = (System.Data.DataTable)distributors.Data; } else { this.Page.Response.Redirect("DistributorList.aspx"); } if (dataTable.Rows[0]["UserHead"] != System.DBNull.Value && dataTable.Rows[0]["UserHead"].ToString().Trim() != "") { this.ListImage1.ImageUrl = dataTable.Rows[0]["UserHead"].ToString(); } this.txtCellPhone.InnerText = ((dataTable.Rows[0]["CellPhone"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["CellPhone"])); this.txtMicroName.InnerText = (string)dataTable.Rows[0]["UserName"]; this.txtUserBindName.InnerText = ((dataTable.Rows[0]["UserBindName"] == System.DBNull.Value) ? "" : dataTable.Rows[0]["UserBindName"].ToString()); this.txtRealName.InnerText = ((dataTable.Rows[0]["RealName"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["RealName"])); this.txtCreateTime.InnerText = ((System.DateTime)dataTable.Rows[0]["CreateTime"]).ToString("yyyy-MM-dd HH:mm:ss"); this.txtName.InnerText = ((dataTable.Rows[0]["Name"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["Name"])); string text = Globals.HostPath(System.Web.HttpContext.Current.Request.Url) + "/Default.aspx?ReferralId=" + distributorsQuery.UserId; this.txtUrl.InnerText = text; this.StoreCode.ImageUrl = "http://s.jiathis.com/qrcode.php?url=" + text; this.OrdersTotal.InnerText = "¥" + System.Convert.ToDouble(dataTable.Rows[0]["OrdersTotal"]).ToString("0.00"); this.ReferralOrders.InnerText = dataTable.Rows[0]["ReferralOrders"].ToString(); this.ReferralBlance.InnerText = "¥" + System.Convert.ToDouble(dataTable.Rows[0]["ReferralBlance"]).ToString("0.00"); this.ReferralRequestBalance.InnerText = "¥" + System.Convert.ToDouble(dataTable.Rows[0]["ReferralRequestBalance"]).ToString("0.00"); this.ucFlashUpload1.Value = ((dataTable.Rows[0]["BannerURL"] == System.DBNull.Value) ? "" : dataTable.Rows[0]["BannerURL"].ToString()); decimal num = decimal.Parse(dataTable.Rows[0]["ReferralBlance"].ToString()) + decimal.Parse(dataTable.Rows[0]["ReferralRequestBalance"].ToString()); this.TotalReferral.InnerText = "¥" + System.Convert.ToDouble(num.ToString()).ToString("0.00"); this.BindData(distributorsQuery.UserId); if (!IsPostBack) { txtSiteName.Text = this.txtStoreName.InnerText = (string)dataTable.Rows[0]["StoreName"]; txtSiteTel.Text = this.SiteTel.InnerText = ((dataTable.Rows[0]["SiteTel"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["SiteTel"])); this.SiteAddress.InnerText = ((dataTable.Rows[0]["SiteAddress"] == System.DBNull.Value) ? "" : Hidistro.Entities.RegionHelper.GetFullRegion(Convert.ToInt32(dataTable.Rows[0]["SiteRegionId"]), " ") + " " + ((string)dataTable.Rows[0]["SiteAddress"])); txtSiteAddress.Text = ((dataTable.Rows[0]["SiteAddress"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["SiteAddress"])); if (dataTable.Rows[0]["SiteRegionId"] != System.DBNull.Value) { this.dropRegion.SetSelectedRegionId(Convert.ToInt32(dataTable.Rows[0]["SiteRegionId"])); } txtStoreDescription.Text = this.StoreDescription.InnerText = ((dataTable.Rows[0]["StoreDescription"] == System.DBNull.Value) ? "" : ((string)dataTable.Rows[0]["StoreDescription"])); } this.btnUpload.Click += new System.EventHandler(this.btnUpload_Click); this.EditSave.Click += new System.EventHandler(this.EditSave_Click); this.BtnSavePicture.Click += new System.EventHandler(this.BtnSavePicture_Click); }
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) { this.ShowMsg("订单中商品有退货(款)不允许完成!", false); return; } 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.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.ShowMsg("成功的完成了该订单", true); return; } this.ShowMsg("完成订单失败", false); return; } else { if (e.CommandName == "delete") { string text = e.CommandArgument.ToString(); text = "'" + text.Replace(",", "','") + "'"; int num3 = OrderHelper.RealDeleteOrders(text); this.BindOrders(); this.ShowMsg(string.Format("成功删除了{0}个订单", num3), true); return; } if (e.CommandName == "restore") { string text2 = e.CommandArgument.ToString(); text2 = "'" + text2.Replace(",", "','") + "'"; int num4 = OrderHelper.RestoreOrders(text2); this.BindOrders(); this.ShowMsg(string.Format("成功还原了订单", num4), true); } } } }
private void weipaySend_Click(object sender, EventArgs e) { int serialid = Globals.ToNum(this.HiddenSid.Value); decimal num2 = decimal.Parse(this.hdreferralblance.Value); MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(serialid); if (amountRequestDetail != null) { if (amountRequestDetail.State == RequesState.已发放) { this.ShowMsg("该申请已经支付,请检查", false); } else if (amountRequestDetail.State == RequesState.驳回) { this.ShowMsg("该申请已经驳回,请检查", false); } else if (string.IsNullOrEmpty(amountRequestDetail.RedpackId)) { this.ShowMsg("商户订单ID为空,请重试!", false); } else { WeiPayResult result = OutPayHelp.SingleWeiPay((int)(num2 * 100M), "用户余额发放!", amountRequestDetail.AccountCode, amountRequestDetail.AccountName, amountRequestDetail.RedpackId, amountRequestDetail.UserId); if (result.result_code == "SUCCESS") { int[] serialids = new int[] { serialid }; MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, "微信企业付款", "", ManagerHelper.GetCurrentManager().UserName); int userId = amountRequestDetail.UserId; string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + amountRequestDetail.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(amountRequestDetail, url); } catch { } this.LoadParameters(); this.BindData(); this.ShowMsg("支付成功!", true); } else { if (((result.err_code == "OPENID_ERROR") || (result.err_code == "NAME_MISMATCH")) || (result.return_msg.Contains("openid字段") || (result.err_code == "FATAL_ERROR"))) { MemberAmountProcessor.SetAmountRequestStatus(new int[] { serialid }, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + result.return_msg, num2.ToString(), ManagerHelper.GetCurrentManager().UserName); this.LoadParameters(); this.BindData(); } else { MemberAmountProcessor.SetAmountRequestStatus(new int[] { serialid }, 1, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + result.return_msg, num2.ToString(), ManagerHelper.GetCurrentManager().UserName); } this.ShowMsg("微信企业付款失败," + result.return_msg, false); } } } else { this.ShowMsg("参数错误!", false); } }
protected void BatchPass_Click(object sender, EventArgs e) { string str = ""; if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { str = base.Request["CheckBoxGroup"]; } else { this.ShowMsg("参数错误!", false); return; } int[] serialids = Array.ConvertAll <string, int>(str.Split(new char[] { ',' }), s => Globals.ToNum(s)); Dictionary <int, int> mulAmountRequestStatus = MemberAmountProcessor.GetMulAmountRequestStatus(serialids); ArrayList list = new ArrayList(); foreach (int num in serialids) { if (mulAmountRequestStatus.ContainsKey(num) && (mulAmountRequestStatus[num] == 0)) { list.Add(num); } } if (list.Count == 0) { this.ShowMsg("没有未审核状态的数据,操作终止!", false); } else { serialids = (int[])list.ToArray(typeof(int)); if (serialids.Length > 0) { if (MemberAmountProcessor.SetAmountRequestStatus(serialids, 1, "", "", ManagerHelper.GetCurrentManager().UserName)) { this.UpdateNotify("申请提现批量审核成功"); this.ShowMsg("批量审核成功!", true); } else { this.ShowMsg("批量审核失败,请再次尝试", false); } this.LoadParameters(); this.BindData(); } } }
private void BatchPaySend_Click(object sender, EventArgs e) { this.GetPaySetting(); string str = ""; if (!string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { str = base.Request["CheckBoxGroup"]; } else { this.ShowMsg("参数错误!", false); return; } string str2 = this.PaybatchType.Value; if (str2 == "0") { string[] strArray = str.Split(new char[] { ',' }); List <OutPayWeiInfo> batchUserList = new List <OutPayWeiInfo>(); foreach (string str3 in strArray) { MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(int.Parse(str3)); if (((amountRequestDetail != null) && (amountRequestDetail.State == RequesState.已审核)) && (this.DrawMinNum <= amountRequestDetail.Amount)) { OutPayWeiInfo item = new OutPayWeiInfo { Amount = ((int)amountRequestDetail.Amount) * 100, Partner_Trade_No = amountRequestDetail.RedpackId, Openid = amountRequestDetail.AccountCode, Re_User_Name = amountRequestDetail.AccountName, Desc = " 用户余额发放", UserId = amountRequestDetail.UserId, Nonce_Str = OutPayHelp.GetRandomString(20), Sid = amountRequestDetail.Id }; batchUserList.Add(item); } } if (batchUserList.Count < 1) { this.ShowMsg("没有满足条件的提现请求!", false); this.LoadParameters(); this.BindData(); } else { List <WeiPayResult> list2 = OutPayHelp.BatchWeiPay(batchUserList); if (list2.Count < 1) { this.ShowMsg("系统异常,请联系管理员!", false); } else if (list2[0].return_code == "INITFAIL") { this.ShowMsg(list2[0].return_msg, false); } else { int num = 0; int num2 = 0; int num3 = 0; int count = batchUserList.Count; string str4 = "<div class='errRow'>支付失败信息如下:"; using (List <WeiPayResult> .Enumerator enumerator = list2.GetEnumerator()) { while (enumerator.MoveNext()) { Func <OutPayWeiInfo, bool> predicate = null; WeiPayResult rItem = enumerator.Current; if (predicate == null) { predicate = t => t.Partner_Trade_No == rItem.partner_trade_no; } int sid = batchUserList.FirstOrDefault <OutPayWeiInfo>(predicate).Sid; if (rItem.result_code == "SUCCESS") { int[] serialids = new int[] { sid }; MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, "微信企业付款:流水号" + rItem.payment_no, "", ManagerHelper.GetCurrentManager().UserName); int userId = rItem.UserId; MemberAmountRequestInfo balance = MemberAmountProcessor.GetAmountRequestDetail(sid); if (balance != null) { string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + balance.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(balance, url); } catch { } } num3 += rItem.Amount / 100; num++; } else { if (((rItem.err_code == "OPENID_ERROR") || (rItem.err_code == "NAME_MISMATCH")) || (rItem.return_msg.Contains("openid字段") || (rItem.err_code == "FATAL_ERROR"))) { MemberAmountProcessor.SetAmountRequestStatus(new int[] { sid }, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, "", ManagerHelper.GetCurrentManager().UserName); } else { MemberAmountProcessor.SetAmountRequestStatus(new int[] { sid }, 1, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, "", ManagerHelper.GetCurrentManager().UserName); } string str6 = str4; str4 = str6 + "<br>ID:" + rItem.partner_trade_no + ", 出错提示:" + rItem.return_msg; num2++; } } } count = (count - num2) - num; str4 = str4 + "</div>"; if ((num3 == num) && (num3 != 0)) { this.ShowMsg("全部支付成功", true); } else { this.ShowMsg(string.Concat(new object[] { "本次成功支付金额", num3, "元,其中成功", num, "笔,失败", num2, "笔,异常放弃", count, "笔", str4 }), false); } this.LoadParameters(); this.BindData(); } } } else if (str2 == "1") { this.ShowMsg("接口暂未开通", false); } else { this.ShowMsg("未定义支付方式", false); } }
protected void PassCheck_Click(object sender, EventArgs e) { decimal result = 0M; int num2 = 0; if (int.TryParse(this.HSid.Value, out num2) && decimal.TryParse(this.ReqSum.Text, out result)) { int[] serialids = new int[] { num2 }; if (MemberAmountProcessor.SetAmountRequestStatus(serialids, 1, "", result.ToString(), ManagerHelper.GetCurrentManager().UserName)) { this.UpdateNotify("申请提现审核成功"); this.ShowMsg("审核已通过", true); } else { this.ShowMsg("审核失败,请再次尝试", false); } this.LoadParameters(); this.BindData(); } else { this.ShowMsg("提现金额请填写数值", false); } }
public static bool ConfirmPay(OrderInfo order) { ManagerHelper.CheckPrivilege(Privilege.CofimOrderPay); bool flag = false; if (order.CheckAction(OrderActions.SELLER_CONFIRM_PAY)) { OrderDao dao = new OrderDao(); order.OrderStatus = OrderStatus.BuyerAlreadyPaid; order.PayDate = new DateTime?(DateTime.Now); order.PaymentTypeId = 0x63; order.PaymentType = "线下支付"; ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); string str = string.Empty; if (currentManager != null) { str = string.Concat(new object[] { currentManager.UserName, "(", currentManager.UserId, ")" }); } order.ManagerRemark = "管理员" + str + "后台收款"; order.Gateway = "hishop.plugins.payment.offlinerequest"; flag = dao.UpdateOrder(order, null); string str2 = ""; if (!flag) { return(flag); } dao.UpdatePayOrderStock(order); foreach (LineItemInfo info2 in order.LineItems.Values) { ProductDao dao2 = new ProductDao(); str2 = str2 + "'" + info2.SkuId + "',"; ProductInfo productDetails = dao2.GetProductDetails(info2.ProductId); productDetails.SaleCounts += info2.Quantity; productDetails.ShowSaleCounts += info2.Quantity; dao2.UpdateProduct(productDetails, null); } if (!string.IsNullOrEmpty(str2)) { dao.UpdateItemsStatus(order.OrderId, 2, str2.Substring(0, str2.Length - 1)); } if (!string.IsNullOrEmpty(order.ActivitiesId)) { new ActivitiesDao().UpdateActivitiesTakeEffect(order.ActivitiesId); } MemberHelper.SetOrderDate(order.UserId, 1); SettingsManager.GetMasterSettings(true); MemberInfo member = new MemberDao().GetMember(order.UserId); if (VshopBrowser.IsPassAutoToDistributor(member, true)) { DistributorsBrower.MemberAutoToDistributor(member); } try { OrderInfo info5 = order; if (info5 != null) { Messenger.SendWeiXinMsg_OrderPay(info5); } } catch (Exception) { } EventLogs.WriteOperationLog(Privilege.CofimOrderPay, string.Format(CultureInfo.InvariantCulture, "确认收款编号为\"{0}\"的订单", new object[] { order.OrderId })); } return(flag); }
private void BatchPaySend_Click(object sender, System.EventArgs e) { this.GetPaySetting(); if (string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { this.ShowMsg("参数错误!", false); return; } string text = base.Request["CheckBoxGroup"]; string value = this.PaybatchType.Value; if (value == "0") { string[] array = text.Split(new char[] { ',' }); System.Collections.Generic.List <OutPayWeiInfo> list = new System.Collections.Generic.List <OutPayWeiInfo>(); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string s = array2[i]; MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(int.Parse(s)); if (amountRequestDetail != null && amountRequestDetail.State == RequesState.已审核 && this.DrawMinNum <= amountRequestDetail.Amount) { list.Add(new OutPayWeiInfo { Amount = (int)amountRequestDetail.Amount * 100, Partner_Trade_No = amountRequestDetail.RedpackId, Openid = amountRequestDetail.AccountCode, Re_User_Name = amountRequestDetail.AccountName, Desc = " 用户余额发放", UserId = amountRequestDetail.UserId, Nonce_Str = OutPayHelp.GetRandomString(20), Sid = amountRequestDetail.Id }); } } if (list.Count < 1) { this.ShowMsg("没有满足条件的提现请求!", false); this.LoadParameters(); this.BindData(); return; } System.Collections.Generic.List <WeiPayResult> list2 = OutPayHelp.BatchWeiPay(list); if (list2.Count < 1) { this.ShowMsg("系统异常,请联系管理员!", false); return; } if (list2[0].return_code == "INITFAIL") { this.ShowMsg(list2[0].return_msg, false); return; } int num = 0; int num2 = 0; int num3 = 0; int num4 = list.Count; string text2 = "<div class='errRow'>支付失败信息如下:"; using (System.Collections.Generic.List <WeiPayResult> .Enumerator enumerator = list2.GetEnumerator()) { while (enumerator.MoveNext()) { WeiPayResult rItem = enumerator.Current; int sid = list.FirstOrDefault((OutPayWeiInfo t) => t.Partner_Trade_No == rItem.partner_trade_no).Sid; if (rItem.result_code == "SUCCESS") { int[] serialids = new int[] { sid }; MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, "微信企业付款:流水号" + rItem.payment_no, "", ManagerHelper.GetCurrentManager().UserName); int arg_298_0 = rItem.UserId; MemberAmountRequestInfo amountRequestDetail2 = MemberAmountProcessor.GetAmountRequestDetail(sid); if (amountRequestDetail2 != null) { string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + amountRequestDetail2.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(amountRequestDetail2, url); } catch { } } num3 += rItem.Amount / 100; num++; } else { if (rItem.err_code == "OPENID_ERROR" || rItem.err_code == "NAME_MISMATCH" || rItem.return_msg.Contains("openid字段") || rItem.err_code == "FATAL_ERROR") { MemberAmountProcessor.SetAmountRequestStatus(new int[] { sid }, 3, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, "", ManagerHelper.GetCurrentManager().UserName); } else { MemberAmountProcessor.SetAmountRequestStatus(new int[] { sid }, 1, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + rItem.return_msg, "", ManagerHelper.GetCurrentManager().UserName); } string text3 = text2; text2 = string.Concat(new string[] { text3, "<br>ID:", rItem.partner_trade_no, ", 出错提示:", rItem.return_msg }); num2++; } } } num4 = num4 - num2 - num; text2 += "</div>"; if (num3 == num && num3 != 0) { this.ShowMsg("全部支付成功", true); } else { this.ShowMsg(string.Concat(new object[] { "本次成功支付金额", num3, "元,其中成功", num, "笔,失败", num2, "笔,异常放弃", num4, "笔", text2 }), false); } this.LoadParameters(); this.BindData(); return; } else { if (value == "1") { this.ShowMsg("接口暂未开通", false); return; } this.ShowMsg("未定义支付方式", false); return; } }
private void btnSendGoods_Click(object sender, System.EventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.orderId); if (orderInfo != null) { ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); if (currentManager != null) { if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Success) { this.ShowMsg("当前订单为团购订单,团购活动还未成功结束,所以不能发货", false); } else { if (!orderInfo.CheckAction(OrderActions.SELLER_SEND_GOODS)) { this.ShowMsg("当前订单状态没有付款或不是等待发货的订单,所以不能发货", false); } else { if (!this.radioShippingMode.SelectedValue.HasValue) { this.ShowMsg("请选择配送方式", false); } else { if (string.IsNullOrEmpty(this.txtShipOrderNumber.Text.Trim()) || this.txtShipOrderNumber.Text.Trim().Length > 20) { this.ShowMsg("运单号码不能为空,在1至20个字符之间", false); } else { if (string.IsNullOrEmpty(this.expressRadioButtonList.SelectedValue)) { this.ShowMsg("请选择物流公司", false); } else { ShippingModeInfo shippingMode = SalesHelper.GetShippingMode(this.radioShippingMode.SelectedValue.Value, true); orderInfo.RealShippingModeId = this.radioShippingMode.SelectedValue.Value; orderInfo.RealModeName = shippingMode.Name; ExpressCompanyInfo info4 = ExpressHelper.FindNode(this.expressRadioButtonList.SelectedValue); if (info4 != null) { orderInfo.ExpressCompanyAbb = info4.Kuaidi100Code; orderInfo.ExpressCompanyName = info4.Name; } orderInfo.ShipOrderNumber = this.txtShipOrderNumber.Text; if (OrderHelper.SendGoods(orderInfo)) { SendNoteInfo info5 = new SendNoteInfo(); info5.NoteId = Globals.GetGenerateId(); info5.OrderId = this.orderId; info5.Operator = currentManager.UserName; info5.Remark = "后台" + info5.Operator + "发货成功"; OrderHelper.SaveSendNote(info5); MemberInfo member = MemberHelper.GetMember(orderInfo.UserId); Messenger.OrderShipping(orderInfo, member); if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && orderInfo.GatewayOrderId.Trim().Length > 0) { if (orderInfo.Gateway == "hishop.plugins.payment.ws_wappay.wswappayrequest") { PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(orderInfo.PaymentTypeId); if (paymentMode != null) { 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 })), "").SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS"); } } if (orderInfo.Gateway == "hishop.plugins.payment.weixinrequest") { SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PayClient client = new PayClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, masterSettings.WeixinPaySignKey); DeliverInfo deliver = new DeliverInfo { TransId = orderInfo.GatewayOrderId, OutTradeNo = orderInfo.OrderId, OpenId = MemberHelper.GetMember(orderInfo.UserId).OpenId }; client.DeliverNotify(deliver); } } orderInfo.OnDeliver(); this.ShowMsg("发货成功", true); } else { this.ShowMsg("发货失败", false); } } } } } } } } }
protected void Page_Load(object sender, EventArgs e) { string str2; string str3; JArray array; string str4; if (Globals.RequestQueryStr("type") == "saveorders") { this.type = "saveorders"; } string str = Globals.RequestFormStr("posttype"); this.orderIds = Globals.RequestQueryStr("OrderId").Trim(new char[] { ',' }); if (string.IsNullOrEmpty(this.ReUrl)) { this.ReUrl = "manageorder.aspx"; } switch (str) { case "saveorders": str2 = Globals.RequestFormStr("data"); base.Response.ContentType = "application/json"; str3 = "{\"type\":\"0\",\"tips\":\"指定物流失败!\"}"; array = (JArray)JsonConvert.DeserializeObject(str2); str4 = string.Empty; if (array != null) { if (array.Count > 1) { str4 = "批量"; } bool flag = true; foreach (JObject obj2 in array) { if (!this.CheckOrderCompany(obj2["orderid"].ToString(), obj2["companycode"].ToString(), obj2["compname"].ToString(), obj2["shipordernumber"].ToString())) { flag = false; } } if (flag) { foreach (JObject obj3 in array) { OrderHelper.UpdateOrderCompany(obj3["orderid"].ToString(), obj3["companycode"].ToString(), obj3["compname"].ToString(), obj3["shipordernumber"].ToString()); } str3 = "{\"type\":\"1\",\"tips\":\"" + str4 + "指定物流成功!\"}"; } else { str3 = "{\"type\":\"0\",\"tips\":\"" + str4 + "指定物流失败,请检测数据的正确性!\"}"; } } base.Response.Write(str3); base.Response.End(); return; case "saveoneorders": str2 = Globals.RequestFormStr("data"); base.Response.ContentType = "application/json"; str3 = "{\"type\":\"0\",\"tips\":\"指定物流失败!\"}"; array = (JArray)JsonConvert.DeserializeObject(str2); str4 = string.Empty; if (array != null) { bool flag2 = true; string shipNumber = "1111111111"; foreach (JObject obj4 in array) { if (!this.CheckOrderCompany(obj4["orderid"].ToString(), obj4["companycode"].ToString(), obj4["compname"].ToString(), shipNumber)) { flag2 = false; } } if (flag2) { foreach (JObject obj5 in array) { OrderHelper.UpdateOrderCompany(obj5["orderid"].ToString(), obj5["companycode"].ToString(), obj5["compname"].ToString(), ""); } str3 = "{\"type\":\"1\",\"tips\":\"" + str4 + "指定物流成功!\"}"; } else { str3 = "{\"type\":\"0\",\"tips\":\"" + str4 + "指定物流失败,请检测数据的正确性!\"}"; } } base.Response.Write(str3); base.Response.End(); return; case "sendorders": str2 = Globals.RequestFormStr("data"); base.Response.ContentType = "application/json"; str3 = "{\"type\":\"0\",\"tips\":\"发货失败!\"}"; array = (JArray)JsonConvert.DeserializeObject(str2); str4 = string.Empty; if (array != null) { if (array.Count > 1) { str4 = "批量"; } bool flag3 = true; foreach (JObject obj6 in array) { if (!this.CheckOrderCompany(obj6["orderid"].ToString(), obj6["companycode"].ToString(), obj6["compname"].ToString(), obj6["shipordernumber"].ToString())) { flag3 = false; } } if (flag3) { int num = 0; foreach (JObject obj7 in array) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(obj7["orderid"].ToString()); if ((((orderInfo.GroupBuyId <= 0) || (orderInfo.GroupBuyStatus == GroupBuyStatus.Success)) && (((orderInfo.OrderStatus == OrderStatus.WaitBuyerPay) && (orderInfo.Gateway == "hishop.plugins.payment.podrequest")) || (orderInfo.OrderStatus == OrderStatus.BuyerAlreadyPaid))) && (!string.IsNullOrEmpty(obj7["shipordernumber"].ToString().Trim()) && (obj7["shipordernumber"].ToString().Trim().Length <= 30))) { orderInfo.ExpressCompanyAbb = obj7["companycode"].ToString(); orderInfo.ExpressCompanyName = obj7["compname"].ToString(); orderInfo.ShipOrderNumber = obj7["shipordernumber"].ToString(); if (OrderHelper.SendGoods(orderInfo)) { SendNoteInfo info2 = new SendNoteInfo(); Express.SubscribeExpress100(obj7["companycode"].ToString(), obj7["shipordernumber"].ToString()); info2 = new SendNoteInfo { NoteId = Globals.GetGenerateId() + num, OrderId = obj7["orderid"].ToString(), Operator = ManagerHelper.GetCurrentManager().UserName, Remark = "后台" + info2.Operator + "发货成功" }; OrderHelper.SaveSendNote(info2); if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && (orderInfo.GatewayOrderId.Trim().Length > 0)) { if (orderInfo.Gateway == "hishop.plugins.payment.ws_wappay.wswappayrequest") { PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(orderInfo.PaymentTypeId); if (paymentMode != null) { 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 })), "").SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS"); } } if (orderInfo.Gateway == "hishop.plugins.payment.weixinrequest") { PayClient client; SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); if (masterSettings.EnableSP) { client = new PayClient(masterSettings.Main_AppId, masterSettings.WeixinAppSecret, masterSettings.Main_Mch_ID, masterSettings.Main_PayKey, true, masterSettings.WeixinAppId, masterSettings.WeixinPartnerID); } else { client = new PayClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, false, "", ""); } DeliverInfo deliver = new DeliverInfo { TransId = orderInfo.GatewayOrderId, OutTradeNo = orderInfo.OrderId, OpenId = MemberHelper.GetMember(orderInfo.UserId).OpenId }; client.DeliverNotify(deliver); } } orderInfo.OnDeliver(); num++; } } } if (num == 0) { str3 = "{\"type\":\"0\",\"tips\":\"" + str4 + "发货失败!\"}"; } else { str3 = "{\"type\":\"1\",\"tips\":\"" + num + "个订单发货成功!\"}"; } } else { str3 = "{\"type\":\"0\",\"tips\":\"" + str4 + "发货失败,请检测数据的正确性!\"}"; } } base.Response.Write(str3); base.Response.End(); return; case "getcompany": { base.Response.ContentType = "application/json"; str2 = "[{\"type\":\"0\",\"data\":[]}]"; IList <ExpressCompanyInfo> allExpress = ExpressHelper.GetAllExpress(); int num2 = 0; StringBuilder builder = new StringBuilder(); foreach (ExpressCompanyInfo info5 in allExpress) { if (num2 == 0) { builder.Append("{\"code\":\"" + String2Json(info5.Kuaidi100Code) + "\",\"name\":\"" + String2Json(info5.Name) + "\"}"); } else { builder.Append(",{\"code\":\"" + String2Json(info5.Kuaidi100Code) + "\",\"name\":\"" + String2Json(info5.Name) + "\"}"); } num2++; } if (!string.IsNullOrEmpty(builder.ToString())) { str2 = "[{\"type\":\"1\",\"data\":[" + builder.ToString() + "]}]"; } base.Response.Write(str2); base.Response.End(); return; } case "updateExpress": { str2 = Globals.RequestFormStr("data"); base.Response.ContentType = "application/json"; str3 = "{\"type\":\"0\",\"tips\":\"修改失败!\"}"; array = (JArray)JsonConvert.DeserializeObject(str2); bool flag4 = true; foreach (JObject obj8 in array) { if (!this.CheckOrderCompany(obj8["orderid"].ToString(), obj8["companycode"].ToString(), obj8["compname"].ToString(), obj8["shipordernumber"].ToString())) { flag4 = false; } } if (flag4) { bool flag5 = false; foreach (JObject obj9 in array) { OrderInfo order = OrderHelper.GetOrderInfo(obj9["orderid"].ToString()); order.ExpressCompanyAbb = obj9["companycode"].ToString(); order.ExpressCompanyName = obj9["compname"].ToString(); order.ShipOrderNumber = obj9["shipordernumber"].ToString(); flag5 = OrderHelper.UpdateOrder(order); if (flag5) { Express.SubscribeExpress100(obj9["companycode"].ToString(), obj9["shipordernumber"].ToString()); } } if (flag5) { str3 = "{\"type\":\"1\",\"tips\":\"修改成功!\"}"; } } else { str3 = "{\"type\":\"0\",\"tips\":\"数据验证失败!\"}"; } base.Response.Write(str3); base.Response.End(); return; } } if (string.IsNullOrEmpty(this.orderIds)) { base.GotoResourceNotFound(); } else { string[] strArray = this.orderIds.Split(new char[] { ',' }); bool flag6 = true; foreach (string str6 in strArray) { if (!Globals.IsOrdersID(str6)) { flag6 = false; break; } } if (flag6) { DataSet ordersByOrderIDList = OrderHelper.GetOrdersByOrderIDList(this.orderIds); this.rptItemList.DataSource = ordersByOrderIDList; this.rptItemList.DataBind(); this.litOrdersCount.Text = ordersByOrderIDList.Tables[0].Rows.Count.ToString(); } else { base.Response.Write("非法参数请求!"); base.Response.End(); } } }
protected void Page_Load(object sender, EventArgs e) { string str2; ManagerInfo currentManager; switch (Globals.RequestFormStr("posttype")) { case "save": { int num = 0; base.Response.ContentType = "application/json"; str2 = "{\"success\":\"0\",\"tips\":\"操作失败!\"}"; string str3 = Globals.RequestFormStr("title"); this.sendType = Globals.RequestFormNum("type"); if (this.sendType != 1) { this.sendType = 0; } switch (Globals.RequestFormNum("sendto")) { case 0: case 1: case 2: break; default: num = 0; break; } this.Id = Globals.RequestFormNum("Id"); string str4 = Globals.RequestFormStr("memo"); NoticeInfo info = new NoticeInfo { Id = this.Id, Title = str3, Memo = str4, AddTime = DateTime.Now, SendType = this.sendType, SendTo = num }; currentManager = ManagerHelper.GetCurrentManager(); this.adminName = currentManager.UserName; info.Author = this.adminName; if (num == 2) { DataTable table = NoticeHelper.GetTempSelectedUser(this.adminName).Tables[0]; int count = table.Rows.Count; if (count == 0) { str2 = "{\"success\":\"0\",\"tips\":\"请先选择用户!\"}"; base.Response.Write(str2); base.Response.End(); } else { List <NoticeUserInfo> list = new List <NoticeUserInfo>(); for (int i = 0; i < count; i++) { NoticeUserInfo item = new NoticeUserInfo { UserId = Globals.ToNum(table.Rows[i]["UserID"]), NoticeId = 0 }; list.Add(item); } info.NoticeUserInfo = list; } } int num4 = NoticeHelper.SaveNotice(info); if (num4 > 0) { str2 = "{\"success\":\"1\",\"id\":" + num4 + "}"; } base.Response.Write(str2); base.Response.End(); return; } case "getselecteduser": { base.Response.ContentType = "application/json"; currentManager = ManagerHelper.GetCurrentManager(); this.adminName = currentManager.UserName; DataTable table2 = NoticeHelper.GetSelectedUser(this.adminName).Tables[0]; int num5 = table2.Rows.Count; StringBuilder builder = new StringBuilder(); if (num5 > 0) { int num6 = 0; builder.Append("{\"name\":\"" + Globals.String2Json(table2.Rows[num6]["username"].ToString()) + "\",\"tel\":\"" + Globals.String2Json(table2.Rows[num6]["CellPhone"].ToString()) + "\",\"bindname\":\"" + Globals.String2Json(table2.Rows[num6]["UserBindName"].ToString()) + "\"}"); for (num6 = 1; num6 < num5; num6++) { builder.Append(",{\"name\":\"" + Globals.String2Json(table2.Rows[num6]["username"].ToString()) + "\",\"tel\":\"" + Globals.String2Json(table2.Rows[num6]["CellPhone"].ToString()) + "\",\"bindname\":\"" + Globals.String2Json(table2.Rows[num6]["UserBindName"].ToString()) + "\"}"); } } str2 = string.Concat(new object[] { "{\"success\":\"1\",\"icount\":", num5, ",\"userlist\":[", builder.ToString(), "]}" }); base.Response.Write(str2); base.Response.End(); return; } } if (!base.IsPostBack) { this.Id = Globals.RequestQueryNum("Id"); if (this.Id > 0) { NoticeInfo noticeInfo = NoticeHelper.GetNoticeInfo(this.Id); if (noticeInfo != null) { this.txtTitle.Text = noticeInfo.Title; this.txtMemo.Text = noticeInfo.Memo; this.rbSendTolist.SelectedValue = noticeInfo.SendTo.ToString(); } } this.reUrl = Globals.RequestQueryStr("reurl"); if (string.IsNullOrEmpty(this.reUrl)) { this.reUrl = "noticelist.aspx"; } this.sendType = Globals.RequestQueryNum("type"); this.rbSendTolist.Items[0].Attributes.Add("onclick", "CancelShowUserList()"); this.rbSendTolist.Items[1].Attributes.Add("onclick", "CancelShowUserList()"); if (this.sendType == 1) { this.menuTitle = "消息"; this.rbSendTolist.Items[2].Attributes.Add("onclick", "ShowUserList()"); } else { this.rbSendTolist.Items[2].Attributes.Add("class", "hide"); this.rbSendTolist.Width = 0xaf; this.sendType = 0; } currentManager = ManagerHelper.GetCurrentManager(); this.adminName = currentManager.UserName; } }
protected System.Web.UI.WebControls.Literal litTitle; //提示语 private void BindProducts() { this.LoadParameters(); //得到当前登录用户所在区域 ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); //当前登录用户信息 DataTable dtManagerRegion = ManagerHelper.GetManagerArea(currentManager.UserId); //用户区域信息 DataTable dtRegion = ManagerHelper.GetRegion(string.Empty); string strRegionIds = string.Empty; ArrayList arraylist = new ArrayList(); foreach (DataRow drRow in dtManagerRegion.Rows) { DataView dv = null; //是否省份ID if (dtRegion.Select(string.Format("ProvinceID = '{0}' and CityID = 0 and CountyID = 0", drRow["RegionID"].ToString()), "", DataViewRowState.CurrentRows).Length > 0) { dv = new DataView(dtRegion, string.Format("ProvinceID = '{0}'", drRow["RegionID"].ToString()), "", DataViewRowState.CurrentRows); for (int i = 0; i < dv.Count; i++) { if (!arraylist.Contains(dv[i]["ProvinceID"])) { arraylist.Add(dv[i]["ProvinceID"]); } if (!arraylist.Contains(dv[i]["CityID"]) && dv[i]["CityID"].ToString() != "0") { arraylist.Add(dv[i]["CityID"]); } if (!arraylist.Contains(dv[i]["CountyID"]) && dv[i]["CountyID"].ToString() != "0") { arraylist.Add(dv[i]["CountyID"]); } } } //是否市级ID if (dtRegion.Select(string.Format("CityID = '{0}' and CountyID = 0", drRow["RegionID"].ToString()), "", DataViewRowState.CurrentRows).Length > 0) { dv = new DataView(dtRegion, string.Format("CityID = '{0}'", drRow["RegionID"].ToString()), "", DataViewRowState.CurrentRows); for (int i = 0; i < dv.Count; i++) { if (!arraylist.Contains(dv[i]["CityID"])) { arraylist.Add(dv[i]["CityID"]); } if (!arraylist.Contains(dv[i]["CountyID"]) && dv[i]["CountyID"].ToString() != "0") { arraylist.Add(dv[i]["CountyID"]); } } } //是否区级ID if (dtRegion.Select(string.Format("CountyID = '{0}'", drRow["RegionID"].ToString()), "", DataViewRowState.CurrentRows).Length > 0) { if (!arraylist.Contains(drRow["RegionID"]) && drRow["RegionID"].ToString() != "0") { arraylist.Add(drRow["RegionID"]); } } } //循环构建以 , 分割的Id集合字符串 for (int k = 0; k < arraylist.Count; k++) { if (k == arraylist.Count - 1) { strRegionIds += arraylist[k].ToString(); } else { strRegionIds += arraylist[k].ToString() + ","; } } //得到允许访问的商品的集合 string strProductIds = string.Empty;//定义允许访问的商品Id集合 DataTable dtProductRegion = ManagerHelper.GetProductRegion(string.IsNullOrEmpty(strRegionIds) ? "1=2" : string.Format(@"RegionID in ({0})", strRegionIds)); for (int y = 0; y < dtProductRegion.Rows.Count; y++) { if (strProductIds.IndexOf(dtProductRegion.Rows[y]["ProductID"].ToString() + ",") < 0) { strProductIds += dtProductRegion.Rows[y]["ProductID"].ToString() + ","; } } strProductIds = strProductIds.TrimEnd(','); ProductQuery entity = new ProductQuery { Keywords = this.productName, ProductCode = this.productCode, CategoryId = this.categoryId, PageSize = this.pager.PageSize, PageIndex = this.pager.PageIndex, SortOrder = SortAction.Desc, SortBy = "DisplaySequence", StartDate = this.startDate, BrandId = this.dropBrandList.SelectedValue.HasValue ? this.dropBrandList.SelectedValue : null, TagId = this.dropTagList.SelectedValue.HasValue ? this.dropTagList.SelectedValue : null, TypeId = this.typeId, SaleStatus = this.saleStatus, EndDate = this.endDate, ProductIds = strProductIds }; if (this.categoryId.HasValue && this.categoryId > 0) { entity.MaiCategoryPath = CatalogHelper.GetCategory(this.categoryId.Value).Path; } Globals.EntityCoding(entity, true); DbQueryResult products = ProductHelper.GetProductsBySku(entity); if (((System.Data.DataTable)(products.Data)).Rows.Count == 0) { this.litTitle.Text = "当前用户未设置区域相关信息或用户设置了区域但该区域无商品可以采购。"; this.litTitle.Visible = true; } this.grdProducts.DataSource = products.Data; this.grdProducts.DataBind(); this.txtSearchText.Text = entity.Keywords; this.txtSKU.Text = entity.ProductCode; this.dropCategories.SelectedValue = entity.CategoryId; this.dropType.SelectedValue = entity.TypeId; this.pager1.TotalRecords = (this.pager.TotalRecords = products.TotalRecords); }
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 Page_Load(object sender, System.EventArgs e) { if (ManagerHelper.GetCurrentManager() == null) { this.showError("您没有权限执行此操作!"); } else { this.savePath = "~/Storage/master/gallery/"; this.saveUrl = "/Storage/master/gallery/"; int cid = 0; if (Request.Form["fileCategory"] != null) { int.TryParse(base.Request.Form["fileCategory"], out cid); } string name = string.Empty; if (Request.Form["imgTitle"] != null) { name = base.Request.Form["imgTitle"]; } System.Web.HttpPostedFile postedFile = Request.Files["imgFile"]; if (postedFile == null) { this.showError("请先选择文件!"); } else { if (!ResourcesHelper.CheckPostedFile(postedFile)) { this.showError("不能上传空文件,且必须是有效的图片文件!"); } else { string path = Server.MapPath(this.savePath); if (!System.IO.Directory.Exists(path)) { this.showError("上传目录不存在。"); } else { path += string.Format("{0}/", System.DateTime.Now.ToString("yyyyMM")); this.saveUrl += string.Format("{0}/", System.DateTime.Now.ToString("yyyyMM")); if (!System.IO.Directory.Exists(path)) { System.IO.Directory.CreateDirectory(path); } string fileName = postedFile.FileName; if (name.Length == 0) { name = fileName; } ///取出文件扩展名 string fileExt = System.IO.Path.GetExtension(fileName).ToLower(); //生成新的文件名 string newFileName = System.DateTime.Now.ToString("yyyyMMddHHmmss_ffff", System.Globalization.DateTimeFormatInfo.InvariantInfo) + fileExt; //文件保存真实路径 string filename = path + newFileName; //网站相对路径 string relativePath = this.saveUrl + newFileName; bool err = false; try { postedFile.SaveAs(filename); Database database = DatabaseFactory.CreateDatabase(); System.Data.Common.DbCommand sqlStringCommand = database.GetSqlStringCommand("insert into Hishop_PhotoGallery(CategoryId,PhotoName,PhotoPath,FileSize,UploadTime,LastUpdateTime)values(@cid,@name,@path,@size,@time,@time1)"); database.AddInParameter(sqlStringCommand, "cid", System.Data.DbType.Int32, cid); database.AddInParameter(sqlStringCommand, "name", System.Data.DbType.String, name); database.AddInParameter(sqlStringCommand, "path", System.Data.DbType.String, relativePath); database.AddInParameter(sqlStringCommand, "size", System.Data.DbType.Int32, postedFile.ContentLength); database.AddInParameter(sqlStringCommand, "time", System.Data.DbType.DateTime, System.DateTime.Now); database.AddInParameter(sqlStringCommand, "time1", System.Data.DbType.DateTime, System.DateTime.Now); database.ExecuteNonQuery(sqlStringCommand); } catch { err = true; this.showError("保存文件出错!"); } finally { } if (!err) { System.Collections.Hashtable hashtable = new System.Collections.Hashtable(); hashtable["error"] = 0; hashtable["url"] = Globals.ApplicationPath + relativePath; Response.AddHeader("Content-Type", "text/html; charset=UTF-8"); Response.Write(JsonMapper.ToJson(hashtable)); Response.End(); } } } } } }
protected void Button3_Click(object sender, System.EventArgs e) { int[] array = new int[] { Globals.ToNum(this.hSerialID.Value) }; if (array[0] != 0) { int amountRequestStatus = MemberAmountProcessor.GetAmountRequestStatus(array[0]); if (amountRequestStatus == -1 || amountRequestStatus == 2) { this.ShowMsg("当前项数据不可以驳回,操作终止!", false); return; } if (MemberAmountProcessor.SetAmountRequestStatus(array, -1, this.SignalrefuseMks.Text, "", ManagerHelper.GetCurrentManager().UserName)) { this.UpdateNotify("申请提现驳回"); this.ShowMsg("申请已驳回!", true); this.LoadParameters(); this.BindData(); return; } this.ShowMsg("申请驳回失败,请再次尝试", false); } }
public int managerId; //当前pc端点餐管理员id protected override void AttachChildControls() { if (!Hidistro.ControlPanel.Config.CustomConfigHelper.Instance.AnonymousOrder) { GotoResourceNotFound("pc点餐功能暂未开启!"); } if (!string.IsNullOrEmpty(this.Page.Request.QueryString["Id"])) { System.Web.HttpCookie cookie = new System.Web.HttpCookie("Vshop-Manager") { Value = this.Page.Request.QueryString["Id"].ToString(), Expires = System.DateTime.Now.AddDays(1.0) }; System.Web.HttpContext.Current.Response.Cookies.Add(cookie); } int.TryParse(this.Page.Request.QueryString["categoryId"], out this.categoryId); this.keyWord = this.Page.Request.QueryString["keyWord"]; this.imgUrl = (HiImage)this.FindControl("imgUrl"); this.litContent = (Literal)this.FindControl("litContent"); this.rptProducts = (VshopTemplatedRepeater)this.FindControl("rptProducts"); this.rptCategories = (VshopTemplatedRepeater)this.FindControl("rptCategories"); this.litCategoryId = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("litCategoryId"); this.txtTotal = (System.Web.UI.HtmlControls.HtmlInputHidden) this.FindControl("txtTotal"); this.litBuyToGive = (Literal)this.FindControl("litBuyToGive"); this.litHalf = (Literal)this.FindControl("litHalf");//第二杯半价 this.litOrderList = (Literal)this.FindControl("litOrderList"); this.litCategoryId.SetWhenIsNotNull(this.categoryId.ToString()); this.Page.Session["stylestatus"] = "4"; this.litStoreName = (Literal)this.FindControl("litStoreName"); //获取当前点餐门店信息 ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); storeId = currentManager.ClientUserId; litStoreName.Text = ManagerHelper.GetStoreName(storeId); switch (Hidistro.Core.SettingsManager.GetMasterSettings(true).VTheme.ToLower()) { case "common": case "hotel": DataTable dtProducts = new DataTable(); //商品dt DataTable dt = CategoryBrowser.GetCategoriesByRange(rangeId); //CategoryBrowser.GetCategoriesRange(ProductInfo.ProductRanage.All); int total = 0; int num; int num2; if (!int.TryParse(this.Page.Request.QueryString["page"], out num)) { num = 1; } if (!int.TryParse(this.Page.Request.QueryString["size"], out num2)) { num2 = 16; } if (categoryId == 0) { if (dt.Rows.Count > 0) { //获取第一个分类id int FirstCategoryID = Convert.ToInt32(dt.Rows[0]["categoryId"]); this.litCategoryId.SetWhenIsNotNull(FirstCategoryID.ToString()); //匿名点餐情况下,商品为总店的所有商品,用户则是匿名用户(无需登录) dtProducts = ProductBrowser.GetProducts(MemberProcessor.GetAnonymousMember(this.Page.Request.QueryString["type"].ToString()), null, 0, FirstCategoryID, this.keyWord, num, num2, out total, "ShowSaleCounts", "desc", "", rangeId, storeId); } } else { dtProducts = ProductBrowser.GetProducts(MemberProcessor.GetAnonymousMember(this.Page.Request.QueryString["type"].ToString()), null, 0, categoryId, this.keyWord, num, num2, out total, "ShowSaleCounts", "desc", "", rangeId, storeId); } //绑定购物车的信息 this.cart = ShoppingCartProcessor.GetShoppingCartAviti(Globals.GetCurrentManagerUserId()); //根据商品id判断是否包含其余规格,如果有,则新增一个字段存入规格号 dtProducts.Columns.Add("skuCounts"); foreach (DataRow row in dtProducts.Rows) { DataTable skus = ProductBrowser.GetSkus(Convert.ToInt32(row["ProductId"])); row["skuCounts"] = skus.Rows.Count; } this.rptProducts.DataSource = dtProducts; this.rptProducts.DataBind(); if (!dt.Columns.Contains("PType")) { dt.Columns.Add("PType", typeof(string)); } foreach (DataRow dr in dt.Rows) { dr["PType"] = this.Page.Request.QueryString["type"]; } this.rptCategories.DataSource = dt; this.rptCategories.DataBind(); if (cart != null) { this.litOrderList.Text = ""; //根据购物车的信息绑定左侧点单列表的信息 foreach (ShoppingCartInfo cartInfo in cart) { foreach (ShoppingCartItemInfo info in cartInfo.LineItems) { this.litOrderList.Text += string.Format(@"<li><span>{4}</span><div class='guige'><d type='skuName'>{8}</d><b style='display:none'>{3}</b>{7}</div> <span> <a id='spSub_{0}' class='shopcart-minus'>-</a> <input type='tel' id='buyNum_{0}' class='form-control' value='{2}' disabled='disabled' /> <input type='hidden' id='skuid_{1}' value='{1}'/> <a id='spAdd_{0}' class='shopcart-add'>+</a> <input type='hidden' id='giveNum' value='{5}'/> <input type='hidden' id='halfNum' value='{6}'/> </span></li> ", info.ProductId, info.SkuId, info.Quantity, info.AdjustedPrice.ToString("F2"), info.Name, info.GiveQuantity, info.HalfPriceQuantity, info.GiveQuantity <= 0 ? (info.HalfPriceQuantity <= 0 ? "" : "(半价" + info.HalfPriceQuantity + ")") : "(送" + info.GiveQuantity + ")", skuContentFormat(info.SkuContent)); } } } this.txtTotal.SetWhenIsNotNull(total.ToString()); break; default: this.rptCategories.ItemDataBound += new RepeaterItemEventHandler(this.rptCategories_ItemDataBound); if (this.Page.Request.QueryString["TypeId"] != null) { this.rptCategories.DataSource = CategoryBrowser.GetCategoriesByPruductType(100, Convert.ToInt32(this.Page.Request.QueryString["TypeId"])); this.rptCategories.DataBind(); } else { IList <CategoryInfo> maxSubCategories = CategoryBrowser.GetMaxSubCategoriesRange(this.categoryId, 0x3e8, DistributorsBrower.GetCurrStoreProductRange()); this.rptCategories.DataSource = maxSubCategories; this.rptCategories.DataBind(); } PageTitle.AddSiteNameTitle("电脑点餐"); break; } SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); if (masterSettings.BuyOrGive) { this.litBuyToGive.Text = "<a id=\"btnGiveBuy\" class=\"account-all\" onclick=\"BuyGive()\">买一送一</a>"; } if (masterSettings.BuyOrHalf) { this.litHalf.Text = "<a id=\"btnHalf\" class=\"account-all\" onclick=\"BuyHalf()\">第二杯半价</a>"; } }
protected void Button2_Click(object sender, System.EventArgs e) { if (string.IsNullOrEmpty(base.Request["CheckBoxGroup"])) { this.ShowMsg("参数错误!", false); return; } string text = base.Request["CheckBoxGroup"]; string[] array = text.Split(new char[] { ',' }); int[] array2 = System.Array.ConvertAll <string, int>(array, (string s) => Globals.ToNum(s)); System.Collections.Generic.Dictionary <int, int> mulAmountRequestStatus = MemberAmountProcessor.GetMulAmountRequestStatus(array2); System.Collections.ArrayList arrayList = new System.Collections.ArrayList(); int[] array3 = array2; for (int i = 0; i < array3.Length; i++) { int num = array3[i]; if (mulAmountRequestStatus.ContainsKey(num) && (mulAmountRequestStatus[num] == 0 || mulAmountRequestStatus[num] == 1)) { arrayList.Add(num); } } if (arrayList.Count == 0) { this.ShowMsg("当前选择项没有数据可以驳回,操作终止!", false); return; } array2 = (int[])arrayList.ToArray(typeof(int)); if (array2.Length > 0) { if (MemberAmountProcessor.SetAmountRequestStatus(array2, -1, this.RefuseMks.Text, "", ManagerHelper.GetCurrentManager().UserName)) { this.UpdateNotify("申请提现批量驳回"); this.ShowMsg("批量驳回成功!", true); } else { this.ShowMsg("批量驳回失败,请再次尝试", false); } this.LoadParameters(); this.BindData(); } }
protected void Button3_Click(object sender, EventArgs e) { int[] serialids = new int[] { Globals.ToNum(this.hSerialID.Value) }; if (serialids[0] != 0) { switch (MemberAmountProcessor.GetAmountRequestStatus(serialids[0])) { case -1: case 2: this.ShowMsg("当前项数据不可以驳回,操作终止!", false); return; } if (MemberAmountProcessor.SetAmountRequestStatus(serialids, -1, this.SignalrefuseMks.Text, "", ManagerHelper.GetCurrentManager().UserName)) { this.UpdateNotify("申请提现驳回"); this.ShowMsg("申请已驳回!", true); this.LoadParameters(); this.BindData(); } else { this.ShowMsg("申请驳回失败,请再次尝试", false); } } }
private void btnSendGoods_Click(object sender, System.EventArgs e) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(this.orderId); if (orderInfo != null) { ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); if (currentManager != null) { if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Success) { this.ShowMsg("当前订单为团购订单,团购活动还未成功结束,所以不能发货", false); } else { if (!orderInfo.CheckAction(OrderActions.SELLER_SEND_GOODS)) { this.ShowMsg("当前订单状态没有付款或不是等待发货的订单,所以不能发货", false); } else { if (!this.radioShippingMode.SelectedValue.HasValue) { this.ShowMsg("请选择配送方式", false); } else { //if (CustomConfigHelper.Instance.BrandShow == false) //{ //if (string.IsNullOrEmpty(this.txtShipOrderNumber.Text.Trim()) || this.txtShipOrderNumber.Text.Trim().Length > 20) //{ // this.ShowMsg("运单号码不能为空,在1至20个字符之间", false); //} //} //else //{ if (string.IsNullOrEmpty(this.expressRadioButtonList.SelectedValue)) { this.ShowMsg("请选择物流公司", false); } else { ShippingModeInfo shippingMode = SalesHelper.GetShippingMode(this.radioShippingMode.SelectedValue.Value, true); orderInfo.RealShippingModeId = this.radioShippingMode.SelectedValue.Value; orderInfo.RealModeName = shippingMode.Name; ExpressCompanyInfo info4 = ExpressHelper.FindNode(this.expressRadioButtonList.SelectedValue); if (info4 != null) { orderInfo.ExpressCompanyAbb = info4.Kuaidi100Code; orderInfo.ExpressCompanyName = info4.Name; } orderInfo.ShipOrderNumber = this.txtShipOrderNumber.Text; if (OrderHelper.SendGoods(orderInfo)) { SendNoteInfo info5 = new SendNoteInfo(); info5.NoteId = Globals.GetGenerateId(); info5.OrderId = this.orderId; info5.Operator = currentManager.UserName; info5.Remark = "后台" + info5.Operator + "发货成功"; OrderHelper.SaveSendNote(info5); MemberInfo member = MemberHelper.GetMember(orderInfo.UserId); Messenger.OrderShipping(orderInfo, member); if (!string.IsNullOrEmpty(orderInfo.GatewayOrderId) && orderInfo.GatewayOrderId.Trim().Length > 0) { if (orderInfo.Gateway == "hishop.plugins.payment.ws_wappay.wswappayrequest") { PaymentModeInfo paymentMode = SalesHelper.GetPaymentMode(orderInfo.PaymentTypeId); if (paymentMode != null) { 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 })), "").SendGoods(orderInfo.GatewayOrderId, orderInfo.RealModeName, orderInfo.ShipOrderNumber, "EXPRESS"); } } if (orderInfo.Gateway == "hishop.plugins.payment.weixinrequest") { SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PayClient client = new PayClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, masterSettings.WeixinPaySignKey); DeliverInfo deliver = new DeliverInfo { TransId = orderInfo.GatewayOrderId, OutTradeNo = orderInfo.OrderId, OpenId = MemberHelper.GetMember(orderInfo.UserId).OpenId }; client.DeliverNotify(deliver); } } orderInfo.OnDeliver(); if (CustomConfigHelper.Instance.IsSanzuo) //三作咖啡特殊需求:发货时,打印小票(配送票) { //this.ShowMsgAndReUrl("发货成功", true,"ManageOrders.aspx"); CloseWindowAndRedirect(); } else if (CustomConfigHelper.Instance.IsProLa) //pro辣特殊需求,发货时增加消息推送 { WriteLog("进入"); SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); TemplateMessage templateMessage = new TemplateMessage(); templateMessage.Url = Request.Url.Host + "/vshop/MemberOrders.aspx?status=3"; //单击URL templateMessage.TemplateId = "pPCCurFLdpgnI0ZWpr5eFJQ5bxS7xboaEW2ScBoOY4U"; //Globals.GetMasterSettings(true).WX_Template_01;// "b1_ARggaBzbc5owqmwrZ15QPj9Ksfs0p5i64C6MzXKw";//消息模板ID templateMessage.Touser = member.OpenId; //用户OPENID string productsDes = ""; int c = 0; foreach (LineItemInfo info in orderInfo.LineItems.Values) { if (c > 3) { break; } productsDes += info.ItemDescription + ","; c++; } productsDes = productsDes.TrimEnd(',') + "等菜品"; TemplateMessage.MessagePart[] messateParts = new TemplateMessage.MessagePart[] { new TemplateMessage.MessagePart { Name = "first", Value = "亲,您的菜品已备好,配送在途!" }, new TemplateMessage.MessagePart { Name = "keyword1", Value = "订单" + orderInfo.OrderId + "开始配送" }, new TemplateMessage.MessagePart { Name = "keyword2", Value = productsDes }, new TemplateMessage.MessagePart { Name = "remark", Color = "#FF0000", Value = "预计到达时间:" + txtArriveTime.Text /*orderInfo.ShipToDate*/ } }; templateMessage.Data = messateParts; TemplateApi.SendMessage(TokenApi.GetToken_Message(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret), templateMessage); this.ShowMsg("发货成功", true); } else { this.ShowMsg("发货成功", true); } } else { this.ShowMsg("发货失败", false); } } //} } } } } } }
private void BankPaySave_Click(object sender, EventArgs e) { int[] serialids = new int[] { Globals.ToNum(this.HiddenSid.Value) }; string remark = "转账流水号:" + this.bankPayNum.Text; if (MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, remark, "", ManagerHelper.GetCurrentManager().UserName)) { MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(Globals.ToNum(this.HiddenSid.Value)); if (amountRequestDetail != null) { string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + amountRequestDetail.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(amountRequestDetail, url); } catch { } } this.ShowMsg("结算成功", true); this.BindData(); } else { this.ShowMsg("结算失败", false); } }
protected void Page_Load(object sender, System.EventArgs e) { string text = Globals.RequestFormStr("posttype"); string a; if ((a = text) != null) { if (a == "save") { base.Response.ContentType = "application/json"; string s = "{\"success\":\"0\",\"tips\":\"操作失败!\"}"; string title = Globals.RequestFormStr("title"); this.sendType = Globals.RequestFormNum("type"); if (this.sendType != 1) { this.sendType = 0; } int num = Globals.RequestFormNum("sendto"); switch (num) { case 0: case 1: case 2: break; default: num = 0; break; } this.Id = Globals.RequestFormNum("Id"); string memo = Globals.RequestFormStr("memo"); NoticeInfo noticeInfo = new NoticeInfo(); noticeInfo.Id = this.Id; noticeInfo.Title = title; noticeInfo.Memo = memo; noticeInfo.AddTime = System.DateTime.Now; noticeInfo.SendType = this.sendType; noticeInfo.SendTo = num; ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); this.adminName = currentManager.UserName; noticeInfo.Author = this.adminName; if (num == 2) { System.Data.DataTable dataTable = NoticeHelper.GetTempSelectedUser(this.adminName).Tables[0]; int count = dataTable.Rows.Count; if (count == 0) { s = "{\"success\":\"0\",\"tips\":\"请先选择用户!\"}"; base.Response.Write(s); base.Response.End(); } else { System.Collections.Generic.List <NoticeUserInfo> list = new System.Collections.Generic.List <NoticeUserInfo>(); for (int i = 0; i < count; i++) { list.Add(new NoticeUserInfo { UserId = Globals.ToNum(dataTable.Rows[i]["UserID"]), NoticeId = 0 }); } noticeInfo.NoticeUserInfo = list; } } int num2 = NoticeHelper.SaveNotice(noticeInfo); if (num2 > 0) { s = "{\"success\":\"1\",\"id\":" + num2 + "}"; } base.Response.Write(s); base.Response.End(); return; } if (a == "getselecteduser") { base.Response.ContentType = "application/json"; ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); this.adminName = currentManager.UserName; System.Data.DataTable dataTable2 = NoticeHelper.GetSelectedUser(this.adminName).Tables[0]; int count2 = dataTable2.Rows.Count; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); if (count2 > 0) { int j = 0; stringBuilder.Append(string.Concat(new string[] { "{\"name\":\"", Globals.String2Json(dataTable2.Rows[j]["username"].ToString()), "\",\"tel\":\"", Globals.String2Json(dataTable2.Rows[j]["CellPhone"].ToString()), "\",\"bindname\":\"", Globals.String2Json(dataTable2.Rows[j]["UserBindName"].ToString()), "\"}" })); for (j = 1; j < count2; j++) { stringBuilder.Append(string.Concat(new string[] { ",{\"name\":\"", Globals.String2Json(dataTable2.Rows[j]["username"].ToString()), "\",\"tel\":\"", Globals.String2Json(dataTable2.Rows[j]["CellPhone"].ToString()), "\",\"bindname\":\"", Globals.String2Json(dataTable2.Rows[j]["UserBindName"].ToString()), "\"}" })); } } string s = string.Concat(new object[] { "{\"success\":\"1\",\"icount\":", count2, ",\"userlist\":[", stringBuilder.ToString(), "]}" }); base.Response.Write(s); base.Response.End(); return; } } if (!base.IsPostBack) { this.Id = Globals.RequestQueryNum("Id"); if (this.Id > 0) { NoticeInfo noticeInfo2 = NoticeHelper.GetNoticeInfo(this.Id); if (noticeInfo2 != null) { this.txtTitle.Text = noticeInfo2.Title; this.txtMemo.Text = noticeInfo2.Memo; this.rbSendTolist.SelectedValue = noticeInfo2.SendTo.ToString(); } } this.reUrl = Globals.RequestQueryStr("reurl"); if (string.IsNullOrEmpty(this.reUrl)) { this.reUrl = "noticelist.aspx"; } this.sendType = Globals.RequestQueryNum("type"); this.rbSendTolist.Items[0].Attributes.Add("onclick", "CancelShowUserList()"); this.rbSendTolist.Items[1].Attributes.Add("onclick", "CancelShowUserList()"); int num3 = this.sendType; if (num3 == 1) { this.menuTitle = "消息"; this.rbSendTolist.Items[2].Attributes.Add("onclick", "ShowUserList()"); } else { this.rbSendTolist.Items[2].Attributes.Add("class", "hide"); this.rbSendTolist.Width = 175; this.sendType = 0; } ManagerInfo currentManager = ManagerHelper.GetCurrentManager(); this.adminName = currentManager.UserName; } }
private void WeiRedPack_Click(object sender, EventArgs e) { int serialid = Globals.ToNum(this.HiddenSid.Value); decimal num2 = decimal.Parse(this.hdreferralblance.Value); if (num2 > 200M) { this.ShowMsg("红包金额大于200,无法发放!", false); } else { MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(serialid); if ((amountRequestDetail != null) && !string.IsNullOrEmpty(amountRequestDetail.RedpackId)) { if (amountRequestDetail.State == RequesState.已发放) { this.ShowMsg("该申请已经支付,请检查", false); } else if (amountRequestDetail.State == RequesState.驳回) { this.ShowMsg("该申请已经驳回,请检查", false); } else { string str = this.SendRedPack(amountRequestDetail.AccountCode, "", "恭喜您提现成功!", "您的提现申请已成功", "会员余额发红包提现", ((int)num2) * 100, amountRequestDetail.RedpackId); if (str == "success") { MemberAmountProcessor.SetAmountRequestStatus(new int[] { serialid }, 2, "微信红包付款", "", ManagerHelper.GetCurrentManager().UserName); string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + amountRequestDetail.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(amountRequestDetail, url); } catch { } this.ShowMsg("红包发送成功!", true); this.LoadParameters(); this.BindData(); } else if (str.Contains("openid")) { MemberAmountProcessor.SetAmountRequestStatus(new int[] { serialid }, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + str, num2.ToString(), ManagerHelper.GetCurrentManager().UserName); this.LoadParameters(); this.BindData(); } else { MemberAmountProcessor.SetAmountRequestStatus(new int[] { serialid }, 1, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + str, num2.ToString(), ManagerHelper.GetCurrentManager().UserName); this.ShowMsg("发送失败,原因是:" + str, false); } } } else { this.ShowMsg("发送失败0!", false); } } }
protected void Page_Load(object sender, EventArgs e) { if (ManagerHelper.GetCurrentManager() == null) { Response.Write("没有权限!"); Response.End(); } else { Hashtable table = new Hashtable(); this.dir = Request["dir"]; if (string.IsNullOrEmpty(this.dir)) { this.dir = "image"; } string str4 = "false"; if (Request.QueryString["isAdvPositions"] != null) { str4 = Request.QueryString["isAdvPositions"].ToString().ToLower().Trim(); } string dirPath = "~/Storage/master/gallery/"; string url = "/Storage/master/gallery/"; string str = this.dir; if (str != null) { if (str == "image") { dirPath = "~/Storage/master/gallery/"; url = "/Storage/master/gallery/"; } else if (str == "file") { dirPath = "~/Storage/master/accessory/"; url = "/Storage/master/accessory/"; } else if (!(str == "flash")) { if (str == "media") { dirPath = "~/Storage/master/media/"; url = "/Storage/master/media/"; } } else { dirPath = "~/Storage/master/flash/"; url = "/Storage/master/flash/"; } } string str6 = Request.QueryString["order"]; str6 = string.IsNullOrEmpty(str6) ? "uploadtime" : str6.ToLower(); string cid = Request.QueryString["path"]; switch (cid) { case null: case "": cid = "-1"; break; } if (str4 == "false") { this.FillTableForDb(cid, str6, table); } else { this.FillTableForPath(dirPath, url, str6, table); } string str7 = Request.Url.ToString(); str7 = str7.Substring(0, str7.IndexOf("/", 7)) + Request.ApplicationPath; if (str7.EndsWith("/")) { str7 = str7.Substring(0, str7.Length - 1); } table["domain"] = str7; Response.AddHeader("Content-Type", "application/json; charset=UTF-8"); Response.Write(JsonMapper.ToJson(table)); Response.End(); } }
protected void Page_Load(object sender, System.EventArgs e) { if (ManagerHelper.GetCurrentManager() == null) { this.showError("您没有权限执行此操作!"); return; } this.savePath = "~/Storage/master/gallery/"; this.saveUrl = "/Storage/master/gallery/"; int num = 0; if (base.Request.Form["fileCategory"] != null) { int.TryParse(base.Request.Form["fileCategory"], out num); } string text = string.Empty; if (base.Request.Form["imgTitle"] != null) { text = base.Request.Form["imgTitle"]; } System.Web.HttpPostedFile httpPostedFile = base.Request.Files["imgFile"]; if (httpPostedFile == null) { this.showError("请先选择文件!"); return; } if (!ResourcesHelper.CheckPostedFile(httpPostedFile, "image")) { this.showError("不能上传空文件,且必须是有效的图片文件!"); return; } string text2 = base.Server.MapPath(this.savePath); if (!System.IO.Directory.Exists(text2)) { this.showError("上传目录不存在。"); return; } text2 += string.Format("{0}/", System.DateTime.Now.ToString("yyyyMM")); this.saveUrl += string.Format("{0}/", System.DateTime.Now.ToString("yyyyMM")); if (!System.IO.Directory.Exists(text2)) { System.IO.Directory.CreateDirectory(text2); } string fileName = httpPostedFile.FileName; if (text.Length == 0) { text = fileName; } string str = System.IO.Path.GetExtension(fileName).ToLower(); string str2 = System.DateTime.Now.ToString("yyyyMMddHHmmss_ffff", System.Globalization.DateTimeFormatInfo.InvariantInfo) + str; string filename = text2 + str2; string text3 = this.saveUrl + str2; try { httpPostedFile.SaveAs(filename); Database database = DatabaseFactory.CreateDatabase(); System.Data.Common.DbCommand sqlStringCommand = database.GetSqlStringCommand("insert into Hishop_PhotoGallery(CategoryId,PhotoName,PhotoPath,FileSize,UploadTime,LastUpdateTime)values(@cid,@name,@path,@size,@time,@time1)"); database.AddInParameter(sqlStringCommand, "cid", System.Data.DbType.Int32, num); database.AddInParameter(sqlStringCommand, "name", System.Data.DbType.String, text); database.AddInParameter(sqlStringCommand, "path", System.Data.DbType.String, text3); database.AddInParameter(sqlStringCommand, "size", System.Data.DbType.Int32, httpPostedFile.ContentLength); database.AddInParameter(sqlStringCommand, "time", System.Data.DbType.DateTime, System.DateTime.Now); database.AddInParameter(sqlStringCommand, "time1", System.Data.DbType.DateTime, System.DateTime.Now); database.ExecuteNonQuery(sqlStringCommand); } catch { this.showError("保存文件出错!"); } System.Collections.Hashtable hashtable = new System.Collections.Hashtable(); hashtable["error"] = 0; hashtable["url"] = Globals.ApplicationPath + text3; base.Response.AddHeader("Content-Type", "text/html; charset=UTF-8"); base.Response.Write(JsonMapper.ToJson(hashtable)); base.Response.End(); }
protected void Page_Load(object sender, System.EventArgs e) { System.Collections.Generic.SortedDictionary <string, string> requestPost = this.GetRequestPost(); if (requestPost.Count > 0) { Notify notify = new Notify(); bool flag = notify.Verify(requestPost, base.Request.Form["notify_id"], base.Request.Form["sign"]); if (flag) { string text = base.Request.Form["success_details"]; try { if (!string.IsNullOrEmpty(text)) { string[] array = text.Split(new char[] { '|' }); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text2 = array2[i]; string[] array3 = text2.Split(new char[] { '^' }); if (array3.Length >= 8) { MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(int.Parse(array3[0])); if (amountRequestDetail != null && amountRequestDetail.State != RequesState.已发放) { int[] serialids = new int[] { int.Parse(array3[0]) }; MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, "支付宝付款:流水号" + array3[6] + ",支付时间:" + array3[7], "", ManagerHelper.GetCurrentManager().UserName); string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + amountRequestDetail.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(amountRequestDetail, url); } catch { } } } } } string text3 = base.Request.Form["fail_details"]; if (!string.IsNullOrEmpty(text3)) { string[] array4 = text3.Split(new char[] { '|' }); string[] array5 = array4; for (int j = 0; j < array5.Length; j++) { string text4 = array5[j]; string[] array6 = text4.Split(new char[] { '^' }); if (array6.Length >= 8) { MemberAmountRequestInfo amountRequestDetail2 = MemberAmountProcessor.GetAmountRequestDetail(int.Parse(array6[0])); if (amountRequestDetail2 != null && amountRequestDetail2.State != RequesState.已发放 && amountRequestDetail2.State != RequesState.驳回) { int[] serialids2 = new int[] { int.Parse(array6[0]) }; MemberAmountProcessor.SetAmountRequestStatus(serialids2, 3, System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + array6[5] + array6[6], array6[3], ManagerHelper.GetCurrentManager().UserName); } } } } } catch (System.Exception ex) { try { Globals.Debuglog(string.Concat(new string[] { System.DateTime.Now.ToString("[yyyy-MM-dd HH:mm:ss]"), "验证成功,写入数据库失败->", base.Request.Form.ToString(), "||", ex.ToString() }), "_DebugLogAlipaynotify_url.txt"); } catch (System.Exception) { } } base.Response.Write("success"); return; } base.Response.Write("fail"); try { Globals.Debuglog(System.DateTime.Now.ToString("[yyyy-MM-dd HH:mm:ss]") + "验证失败1,写入数据库失败->" + base.Request.Form.ToString(), "_DebugLogAlipaynotify_url.txt"); return; } catch (System.Exception) { return; } } base.Response.Write("无通知参数"); }