protected virtual void Application_Start(Object sender, EventArgs e) { var app = new Express (); app.Use (PoweredByExpressNet ()); app.Get ("/", (req, res) => { res.Send ("hello world"); }); app.Get ("/json", (req, res) => { res.Send (new { name = "Express.NET", type = "Experiment" }); }); app.Get ("/user/{id}", LoadUser (), (req, res) => { var user = req["user"]; res.Send (user); }); }
protected override void OnLoad(System.EventArgs e) { if (!this.Page.IsPostBack) { this.LoadControl(); } if (this.order.OrderStatus == OrderStatus.SellerAlreadySent) { this.edit = " <input type=\"button\" class=\"submit_btnbianji\" id=\"btnedit\" value=\"修改发货单号\" onclick=\"ShowPurchaseOrder();\"/>"; } if ((this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished) && !string.IsNullOrEmpty(this.order.ExpressCompanyAbb)) { if (this.plExpress != null) { this.plExpress.Visible = true; } if (Express.GetExpressType() == "kuaidi100" && this.power != null) { this.power.Visible = true; } } this.btnupdatepost.Click += new System.EventHandler(this.btnupdatepost_Click); }
public async Task <IActionResult> GetMessageAsync([FromHeader] String source, [FromQuery] PagerBase item) { var response = new Response <Object>(); try { var express = Express.Begin <MemberMessage>(true); express = express.And(a => a.MemberId == MemberId && a.IsEnable == 1); var result = await _IMemberMessageRepository.Query(express) .OrderByDescending(a => a.CreateTime) .ToPager(item.PageIndex.Value, item.PageSize.Value) .Select(a => new { MessageId = a.MessageId, MemberId = a.MemberId, MemberName = a.MemberName, LeaveBody = a.LeaveBody, LeaveType = a.LeaveType, CreateTime = a.CreateTime }) .ToListAsync(); if (result.Count <= 0) { return(NoContent()); } else { response.Code = true; response.Data = result; } } catch (Exception ex) { response.SetError(ex, this._ILogger); } return(response.ToHttpResponse()); }
static void PushRandomInList(ref List <Transport> ls) { string[] MasName = { "Универсал", "Купе", "Лимузин", "Микроавтобус", "Кабиролет" }; string[] MasNameOfExpress = { "Красная стрела", "Полярная стрела", "Восток", "Арктика", "Белоруссия" }; int n = 0; Console.WriteLine("Сколько элементов добавить?"); n = Input.IntCheckConsole(); for (int i = 0; i < n; i++) { if (i % 3 == 0) { Rain a = new Rain(rand.Next(1, 10), rand.Next(100, 200), rand.Next(50, 2000)); ls.Add(a); } else if (i % 2 == 0) { Avtomobile a = new Avtomobile(MasName[rand.Next(0, 4)], rand.Next(100, 400), rand.Next(2, 5)); ls.Add(a); } else if (i % 1 == 0) { Express a = new Express(MasNameOfExpress[rand.Next(0, 4)], rand.Next(1, 10), rand.Next(100, 200), rand.Next(50, 2000)); ls.Add(a); } else { Transport a = new Transport(rand.Next(100, 400), rand.Next(2, 5)); ls.Add(a); } } }
public Task <int> UpdateAsync(Express entity, string[] ignoreColumns = null) { return(_repository.UpdateAsync(entity, ignoreColumns)); }
/// <summary> /// 根据实体删除 /// </summary> /// <param name="entity">实体对象</param> /// <returns>操作影响的行数</returns> public int Delete(Express entity) { return(_repository.Delete(entity)); }
protected void Page_Load(object sender, EventArgs e) { wid = GetCurWebId(); if (string.IsNullOrEmpty(wid)) { return; } this.reurl = "OrderDetails.aspx?OrderId=" + this.orderId + "&t=" + DateTime.Now.ToString("HHmmss"); this.btnMondifyPay.Click += new EventHandler(this.btnMondifyPay_Click); this.btnMondifyShip.Click += new EventHandler(this.btnMondifyShip_Click); this.btnCloseOrder.Click += new EventHandler(this.btnCloseOrder_Click); this.btnRemark.Click += new EventHandler(this.btnRemark_Click); this.order = OrderHelper.GetOrderInfo(this.orderId); if (!base.IsPostBack) { if (string.IsNullOrEmpty(this.orderId)) { base.GotoResourceNotFound(); } else { this.hdfOrderID.Value = this.orderId; this.litOrderDate.Text = this.order.OrderDate.ToString("yyyy-MM-dd HH:mm:ss"); if (this.order.PayDate.HasValue) { this.litPayDate.Text = DateTime.Parse(this.order.PayDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.ShippingDate.HasValue) { this.litShippingDate.Text = DateTime.Parse(this.order.ShippingDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.FinishDate.HasValue) { this.litFinishDate.Text = DateTime.Parse(this.order.FinishDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } this.lblOrderStatus.OrderStatusCode = this.order.OrderStatus; switch (this.order.OrderStatus) { case OrderStatus.WaitBuyerPay: this.ProcessClass2 = "active"; if (this.order.Gateway != "hishop.plugins.payment.podrequest") { this.btnConfirmPay.Visible = true; } this.btnModifyAddr.Attributes.Add("onclick", "DialogFrame('../trade/ShipAddress.aspx?action=update&OrderId=" + this.orderId + "','修改收货地址',620,410)"); this.btnModifyAddr.Visible = true; break; case OrderStatus.BuyerAlreadyPaid: this.ProcessClass2 = "ok"; this.ProcessClass3 = "active"; this.btnModifyAddr.Attributes.Add("onclick", "DialogFrame('../trade/ShipAddress.aspx?action=update&OrderId=" + this.orderId + "','修改收货地址',620,410)"); this.btnModifyAddr.Visible = true; break; case OrderStatus.SellerAlreadySent: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "active"; break; case OrderStatus.Finished: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "ok"; break; } if (this.order.ManagerMark.HasValue) { this.OrderRemarkImageLink.ManagerMarkValue = (int)this.order.ManagerMark.Value; this.litManagerRemark.Text = this.order.ManagerRemark; } else { this.divRemarkShow.Visible = false; } this.litRemark.Text = this.order.Remark; this.litOrderId.Text = this.order.OrderId; this.litUserName.Text = this.order.Username; this.litPayType.Text = this.order.PaymentType; this.litShipToDate.Text = this.order.ShipToDate; this.litRealName.Text = this.order.ShipTo; this.litUserTel.Text = string.IsNullOrEmpty(this.order.CellPhone) ? this.order.TelPhone : this.order.CellPhone; this.litShippingRegion.Text = this.order.ShippingRegion; this.litFreight.Text = Globals.FormatMoney(this.order.AdjustedFreight); if (this.order.ReferralUserId == 0) { this.litSiteName.Text = "主站"; } else { DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (distributorInfo != null) { this.litSiteName.Text = distributorInfo.StoreName; } } StringBuilder builder = new StringBuilder(); if (!string.IsNullOrEmpty(this.order.ActivitiesName)) { this.otherDiscountPrice += this.order.DiscountAmount; builder.Append("<p>" + this.order.ActivitiesName + ":¥" + this.order.DiscountAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.ReducedPromotionName)) { this.otherDiscountPrice += this.order.ReducedPromotionAmount; builder.Append("<p>" + this.order.ReducedPromotionName + ":¥" + this.order.ReducedPromotionAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.CouponName)) { this.otherDiscountPrice += this.order.CouponAmount; builder.Append("<p>" + this.order.CouponName + ":¥" + this.order.CouponAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.RedPagerActivityName)) { this.otherDiscountPrice += this.order.RedPagerAmount; builder.Append("<p>" + this.order.RedPagerActivityName + ":¥" + this.order.RedPagerAmount.ToString("F2") + "</p>"); } if (this.order.PointToCash > 0M) { this.otherDiscountPrice += this.order.PointToCash; builder.Append("<p>积分抵现:¥" + this.order.PointToCash.ToString("F2") + "</p>"); } decimal adjustCommssion = this.order.GetAdjustCommssion(); if (adjustCommssion > 0M) { this.otherDiscountPrice -= adjustCommssion; builder.Append("<p>管理员调价优惠:¥" + adjustCommssion.ToString("F2") + "</p>"); } else if (adjustCommssion < 0M) { this.otherDiscountPrice -= adjustCommssion; builder.Append("<p>管理员调价增加:¥" + adjustCommssion.ToString("F2").Trim(new char[] { '-' }) + "</p>"); } this.litActivityShow.Text = builder.ToString(); if (((int)this.lblOrderStatus.OrderStatusCode) != 4) { this.lbCloseReason.Visible = false; } else { this.divOrderProcess.Visible = false; this.lbReason.Text = this.order.CloseReason; } if ((this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid) || ((this.order.OrderStatus == OrderStatus.WaitBuyerPay) && (this.order.Gateway == "hishop.plugins.payment.podrequest"))) { this.btnSendGoods.Visible = true; } else { this.btnSendGoods.Visible = false; } if (((this.order.OrderStatus == OrderStatus.SellerAlreadySent) || (this.order.OrderStatus == OrderStatus.Finished)) && !string.IsNullOrEmpty(this.order.ExpressCompanyAbb)) { this.pLoginsticInfo.Visible = true; this.btnViewLogistic.Visible = true; if ((Express.GetExpressType() == "kuaidi100") && (this.power != null)) { this.power.Visible = true; } } if (this.order.OrderStatus == OrderStatus.WaitBuyerPay) { this.btnClocsOrder.Visible = true; this.btnModifyPrice.Visible = true; } else { this.btnClocsOrder.Visible = false; this.btnModifyPrice.Visible = false; } this.btnModifyPrice.Attributes.Add("onclick", "DialogFrame('../trade/EditOrder.aspx?OrderId=" + this.orderId + "&reurl=" + base.Server.UrlEncode(this.reurl) + "','修改订单价格',900,450)"); this.BindRemark(this.order); this.ddlshippingMode.DataBind(); this.ddlshippingMode.SelectedValue = new int?(this.order.ShippingModeId); this.ddlpayment.DataBind(); this.ddlpayment.SelectedValue = new int?(this.order.PaymentTypeId); this.rptItemList.DataSource = this.order.LineItems.Values; this.rptItemList.DataBind(); string oldAddress = this.order.OldAddress; string str2 = string.Empty; if (!string.IsNullOrEmpty(this.order.ShippingRegion)) { str2 = this.order.ShippingRegion.Replace(',', ' '); } if (!string.IsNullOrEmpty(this.order.Address)) { str2 = str2 + this.order.Address; } if (!string.IsNullOrEmpty(this.order.ShipTo)) { str2 = str2 + " " + this.order.ShipTo; } if (!string.IsNullOrEmpty(this.order.ZipCode)) { str2 = str2 + " " + this.order.ZipCode; } if (!string.IsNullOrEmpty(this.order.TelPhone)) { str2 = str2 + " " + this.order.TelPhone; } if (!string.IsNullOrEmpty(this.order.CellPhone)) { str2 = str2 + " " + this.order.CellPhone; } if (string.IsNullOrEmpty(oldAddress)) { this.lblOriAddress.Text = str2; this.pNewAddress.Visible = false; } else { this.lblOriAddress.Text = oldAddress; this.litAddress.Text = str2; } if ((this.order.OrderStatus == OrderStatus.Finished) || (this.order.OrderStatus == OrderStatus.SellerAlreadySent)) { string realModeName = this.order.RealModeName; if (string.IsNullOrEmpty(realModeName)) { realModeName = this.order.ModeName; } this.litModeName.Text = realModeName; this.litShipOrderNumber.Text = this.order.ShipOrderNumber; } else { this.litModeName.Text = this.order.ModeName; } if (!string.IsNullOrEmpty(this.order.ExpressCompanyName)) { this.litCompanyName.Text = this.order.ExpressCompanyName; } MemberInfo member = MemberProcessor.GetMember(this.order.UserId, true); if ((member != null) && !string.IsNullOrEmpty(member.OpenId)) { this.litWeiXinNickName.Text = member.UserName; } if (this.order.ReferralUserId > 0) { builder = new StringBuilder(); builder.Append("<div class=\"commissionInfo mb20\"><h3>佣金信息</h3><div class=\"commissionInfoInner\">"); decimal num2 = 0M; decimal totalCommssion = 0M; decimal secondTotalCommssion = 0M; decimal thirdTotalCommssion = 0M; if (this.order.OrderStatus != OrderStatus.Closed) { totalCommssion = this.order.GetTotalCommssion(); secondTotalCommssion = this.order.GetSecondTotalCommssion(); thirdTotalCommssion = this.order.GetThirdTotalCommssion(); } num2 += totalCommssion; string storeName = string.Empty; DistributorsInfo info3 = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (info3 != null) { storeName = info3.StoreName; if ((info3.ReferralPath != null) && (info3.ReferralPath.Length > 0)) { string[] strArray = info3.ReferralPath.Trim().Split(new char[] { '|' }); int distributorid = 0; if (strArray.Length > 1) { distributorid = Globals.ToNum(strArray[0]); if (distributorid > 0) { info3 = DistributorsBrower.GetDistributorInfo(distributorid); if (info3 != null) { num2 += thirdTotalCommssion; builder.Append("<p class=\"mb5\"><span>上二级分销商:</span> " + info3.StoreName + "<i>¥" + thirdTotalCommssion.ToString("F2") + "</i></p>"); } } distributorid = Globals.ToNum(strArray[1]); if (distributorid > 0) { info3 = DistributorsBrower.GetDistributorInfo(distributorid); if (info3 != null) { num2 += secondTotalCommssion; builder.Append("<p class=\"mb5\"><span>上一级分销商:</span> " + info3.StoreName + "<i>¥" + secondTotalCommssion.ToString("F2") + "</i></p>"); } } } else if (strArray.Length == 1) { distributorid = Globals.ToNum(strArray[0]); if (distributorid > 0) { info3 = DistributorsBrower.GetDistributorInfo(distributorid); if (info3 != null) { builder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); num2 += secondTotalCommssion; builder.Append("<p class=\"mb5\"><span>上一级分销商:</span>" + info3.StoreName + " <i>¥" + secondTotalCommssion.ToString("F2") + "</i></p>"); } } } } else { builder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); builder.Append("<p class=\"mb5\"><span>上一级分销商:</span>-</p>"); } } builder.Append("<div class=\"clearfix\">"); builder.Append("<p><span>成交店铺:</span>" + storeName + " <i>¥" + totalCommssion.ToString("F2") + "</i></p>"); builder.Append("<p><span>佣金总额:</span><i>¥" + num2.ToString("F2") + "</i></p>"); builder.Append("</div></div></div>"); this.litCommissionInfo.Text = builder.ToString(); } DataTable orderItemsReFundByOrderID = RefundHelper.GetOrderItemsReFundByOrderID(this.orderId); if (orderItemsReFundByOrderID.Rows.Count > 0) { this.rptRefundList.DataSource = orderItemsReFundByOrderID; this.rptRefundList.DataBind(); } } //Page.DataBind(); } }
/// <summary> /// 修改(主键是更新条件) /// </summary> /// <param name="entity"> 实体对象(必须指定主键特性 [SugarColumn(IsPrimaryKey=true)])</param> /// <param name="ignoreColumns">不更新的列</param> /// <returns>操作影响的行数</returns> public int Update(Express entity, string[] ignoreColumns = null) { return(_repository.Update(entity, ignoreColumns)); }
protected void Page_Load(object sender, System.EventArgs e) { ExpressSet expressSet = ExpressHelper.GetExpressSet(); this.hdHasNewKey.Value = "0"; this.hdExpressUrl.Value = ""; if (expressSet != null) { if (!string.IsNullOrEmpty(expressSet.NewKey)) { this.hdHasNewKey.Value = "1"; } if (!string.IsNullOrEmpty(expressSet.Url.Trim())) { this.hdExpressUrl.Value = expressSet.Url.Trim(); } } string a = Globals.RequestFormStr("posttype"); if (a == "modifyRefundMondy") { base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"操作失败!\"}"; decimal num = 0m; decimal.TryParse(Globals.RequestFormStr("price"), out num); int num2 = Globals.RequestFormNum("pid"); string text = Globals.RequestFormStr("oid"); if (num > 0m && num2 > 0 && !string.IsNullOrEmpty(text)) { if (RefundHelper.UpdateRefundMoney(text, num2, num)) { s = "{\"type\":\"1\",\"tips\":\"操作成功!\"}"; } } else if (num <= 0m) { s = "{\"type\":\"0\",\"tips\":\"退款金额需大于0!\"}"; } base.Response.Write(s); base.Response.End(); return; } this.reurl = "OrderDetails.aspx?OrderId=" + this.orderId + "&t=" + System.DateTime.Now.ToString("HHmmss"); this.btnMondifyPay.Click += new System.EventHandler(this.btnMondifyPay_Click); this.btnCloseOrder.Click += new System.EventHandler(this.btnCloseOrder_Click); this.btnRemark.Click += new System.EventHandler(this.btnRemark_Click); this.order = OrderHelper.GetOrderInfo(this.orderId); if (this.order != null) { if (!base.IsPostBack) { if (string.IsNullOrEmpty(this.orderId)) { base.GotoResourceNotFound(); return; } this.hdfOrderID.Value = this.orderId; this.litOrderDate.Text = this.order.OrderDate.ToString("yyyy-MM-dd HH:mm:ss"); if (this.order.PayDate.HasValue) { this.litPayDate.Text = System.DateTime.Parse(this.order.PayDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.ShippingDate.HasValue) { this.litShippingDate.Text = System.DateTime.Parse(this.order.ShippingDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.FinishDate.HasValue) { this.litFinishDate.Text = System.DateTime.Parse(this.order.FinishDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } this.lblOrderStatus.OrderStatusCode = this.order.OrderStatus; switch (this.order.OrderStatus) { case OrderStatus.WaitBuyerPay: this.ProcessClass2 = "active"; if (this.order.Gateway != "hishop.plugins.payment.podrequest") { this.btnConfirmPay.Visible = true; } this.btnModifyAddr.Attributes.Add("onclick", "DialogFrame('../trade/ShipAddress.aspx?action=update&OrderId=" + this.orderId + "','修改收货地址',620,410)"); this.btnModifyAddr.Visible = true; break; case OrderStatus.BuyerAlreadyPaid: this.ProcessClass2 = "ok"; this.ProcessClass3 = "active"; this.btnModifyAddr.Attributes.Add("onclick", "DialogFrame('../trade/ShipAddress.aspx?action=update&OrderId=" + this.orderId + "','修改收货地址',620,410)"); this.btnModifyAddr.Visible = true; break; case OrderStatus.SellerAlreadySent: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "active"; break; case OrderStatus.Finished: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "ok"; break; } if (this.order.ManagerMark.HasValue) { this.OrderRemarkImageLink.ManagerMarkValue = (int)this.order.ManagerMark.Value; this.litManagerRemark.Text = this.order.ManagerRemark; } else { this.divRemarkShow.Visible = false; } this.litRemark.Text = this.order.Remark; string text2 = this.order.OrderId; string orderMarking = this.order.OrderMarking; if (!string.IsNullOrEmpty(orderMarking)) { text2 = string.Concat(new string[] { text2, " (", this.order.PaymentType, "流水号:", orderMarking, ")" }); } this.litOrderId.Text = text2; this.litUserName.Text = this.order.Username; this.litPayType.Text = this.order.PaymentType; this.litShipToDate.Text = this.order.ShipToDate; this.litRealName.Text = this.order.ShipTo; this.litUserTel.Text = (string.IsNullOrEmpty(this.order.CellPhone) ? this.order.TelPhone : this.order.CellPhone); this.litShippingRegion.Text = this.order.ShippingRegion; this.litFreight.Text = Globals.FormatMoney(this.order.AdjustedFreight); if (this.order.ReferralUserId == 0) { this.litSiteName.Text = "主站"; } else { DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (distributorInfo != null) { this.litSiteName.Text = distributorInfo.StoreName; } } System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(this.order.ActivitiesName)) { this.otherDiscountPrice += this.order.DiscountAmount; stringBuilder.Append(string.Concat(new string[] { "<p>", this.order.ActivitiesName, ":¥", this.order.DiscountAmount.ToString("F2"), "</p>" })); } if (!string.IsNullOrEmpty(this.order.ReducedPromotionName)) { this.otherDiscountPrice += this.order.ReducedPromotionAmount; stringBuilder.Append(string.Concat(new string[] { "<p>", this.order.ReducedPromotionName, ":¥", this.order.ReducedPromotionAmount.ToString("F2"), "</p>" })); } if (!string.IsNullOrEmpty(this.order.CouponName)) { this.otherDiscountPrice += this.order.CouponAmount; stringBuilder.Append(string.Concat(new string[] { "<p>", this.order.CouponName, ":¥", this.order.CouponAmount.ToString("F2"), "</p>" })); } if (!string.IsNullOrEmpty(this.order.RedPagerActivityName)) { this.otherDiscountPrice += this.order.RedPagerAmount; stringBuilder.Append(string.Concat(new string[] { "<p>", this.order.RedPagerActivityName, ":¥", this.order.RedPagerAmount.ToString("F2"), "</p>" })); } if (this.order.PointToCash > 0m) { this.otherDiscountPrice += this.order.PointToCash; stringBuilder.Append("<p>积分抵现:¥" + this.order.PointToCash.ToString("F2") + "</p>"); } this.order.GetAdjustCommssion(); decimal d = 0m; decimal num3 = 0m; foreach (LineItemInfo current in this.order.LineItems.Values) { if (current.IsAdminModify) { d += current.ItemAdjustedCommssion; } else { num3 += current.ItemAdjustedCommssion; } } if (d != 0m) { if (d > 0m) { stringBuilder.Append("<p>管理员调价减:¥" + d.ToString("F2") + "</p>"); } else { stringBuilder.Append("<p>管理员调价加:¥" + (d * -1m).ToString("F2") + "</p>"); } } if (num3 != 0m) { if (num3 > 0m) { stringBuilder.Append("<p>分销商调价减:¥" + num3.ToString("F2") + "</p>"); } else { stringBuilder.Append("<p>分销商调价加:¥" + (num3 * -1m).ToString("F2") + "</p>"); } } this.litActivityShow.Text = stringBuilder.ToString(); if ((int)this.lblOrderStatus.OrderStatusCode != 4) { this.lbCloseReason.Visible = false; } else { this.divOrderProcess.Visible = false; this.lbReason.Text = this.order.CloseReason; } if (this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid || (this.order.OrderStatus == OrderStatus.WaitBuyerPay && this.order.Gateway == "hishop.plugins.payment.podrequest")) { this.btnSendGoods.Visible = true; } else { this.btnSendGoods.Visible = false; } if ((this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished) && !string.IsNullOrEmpty(this.order.ExpressCompanyAbb)) { this.pLoginsticInfo.Visible = true; this.btnViewLogistic.Visible = true; if (Express.GetExpressType() == "kuaidi100" && this.power != null) { this.power.Visible = true; } } if (this.order.OrderStatus == OrderStatus.WaitBuyerPay) { this.btnClocsOrder.Visible = true; this.btnModifyPrice.Visible = true; } else { this.btnClocsOrder.Visible = false; this.btnModifyPrice.Visible = false; } this.btnModifyPrice.Attributes.Add("onclick", string.Concat(new string[] { "DialogFrame('../trade/EditOrder.aspx?OrderId=", this.orderId, "&reurl=", base.Server.UrlEncode(this.reurl), "','修改订单价格',900,450)" })); this.BindRemark(this.order); this.ddlpayment.DataBind(); this.ddlpayment.SelectedValue = new int?(this.order.PaymentTypeId); this.rptItemList.DataSource = this.order.LineItems.Values; this.rptItemList.DataBind(); string oldAddress = this.order.OldAddress; string text3 = string.Empty; if (!string.IsNullOrEmpty(this.order.ShippingRegion)) { text3 = this.order.ShippingRegion.Replace(',', ' '); } if (!string.IsNullOrEmpty(this.order.Address)) { text3 += this.order.Address; } if (!string.IsNullOrEmpty(this.order.ShipTo)) { text3 = text3 + "," + this.order.ShipTo; } if (!string.IsNullOrEmpty(this.order.TelPhone)) { text3 = text3 + "," + this.order.TelPhone; } if (!string.IsNullOrEmpty(this.order.CellPhone)) { text3 = text3 + "," + this.order.CellPhone; } if (string.IsNullOrEmpty(oldAddress)) { this.lblOriAddress.Text = text3; this.pNewAddress.Visible = false; } else { this.lblOriAddress.Text = oldAddress; this.litAddress.Text = text3; } if (this.order.OrderStatus == OrderStatus.Finished || this.order.OrderStatus == OrderStatus.SellerAlreadySent) { string text4 = this.order.RealModeName; if (string.IsNullOrEmpty(text4)) { text4 = this.order.ModeName; } this.litModeName.Text = text4; this.litShipOrderNumber.Text = this.order.ShipOrderNumber; } else { this.litModeName.Text = this.order.ModeName; } if (!string.IsNullOrEmpty(this.order.ExpressCompanyName)) { this.litCompanyName.Text = this.order.ExpressCompanyName; this.hdCompanyCode.Value = this.order.ExpressCompanyAbb; } MemberInfo member = MemberProcessor.GetMember(this.order.UserId, true); if (member != null) { if (!string.IsNullOrEmpty(member.OpenId)) { this.litWeiXinNickName.Text = member.UserName; } if (!string.IsNullOrEmpty(member.UserBindName)) { this.litUserName.Text = member.UserBindName; } } if (this.order.ReferralUserId > 0) { stringBuilder = new System.Text.StringBuilder(); stringBuilder.Append("<div class=\"commissionInfo mb20\"><h3>佣金信息</h3><div class=\"commissionInfoInner\">"); decimal d2 = 0m; decimal num4 = 0m; decimal d3 = 0m; decimal d4 = 0m; if (this.order.OrderStatus != OrderStatus.Closed) { num4 = this.order.GetTotalCommssion(); d3 = this.order.GetSecondTotalCommssion(); d4 = this.order.GetThirdTotalCommssion(); } d2 += num4; string text5 = string.Empty; DistributorsInfo distributorInfo2 = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (distributorInfo2 != null) { text5 = distributorInfo2.StoreName; if (this.order.ReferralPath != null && this.order.ReferralPath.Length > 0) { string[] array = this.order.ReferralPath.Trim().Split(new char[] { '|' }); if (array.Length > 1) { int num5 = Globals.ToNum(array[0]); if (num5 > 0) { distributorInfo2 = DistributorsBrower.GetDistributorInfo(num5); if (distributorInfo2 != null) { d2 += d4; stringBuilder.Append(string.Concat(new string[] { "<p class=\"mb5\"><span>上二级分销商:</span> ", distributorInfo2.StoreName, "<i> ¥", d4.ToString("F2"), "</i></p>" })); } } num5 = Globals.ToNum(array[1]); if (num5 > 0) { distributorInfo2 = DistributorsBrower.GetDistributorInfo(num5); if (distributorInfo2 != null) { d2 += d3; stringBuilder.Append(string.Concat(new string[] { "<p class=\"mb5\"><span>上一级分销商:</span> ", distributorInfo2.StoreName, "<i> ¥", d3.ToString("F2"), "</i></p>" })); } } } else if (array.Length == 1) { int num5 = Globals.ToNum(array[0]); if (num5 > 0) { distributorInfo2 = DistributorsBrower.GetDistributorInfo(num5); if (distributorInfo2 != null) { stringBuilder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); d2 += d3; stringBuilder.Append(string.Concat(new string[] { "<p class=\"mb5\"><span>上一级分销商:</span>", distributorInfo2.StoreName, " <i> ¥", d3.ToString("F2"), "</i></p>" })); } } } } else { stringBuilder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); stringBuilder.Append("<p class=\"mb5\"><span>上一级分销商:</span>-</p>"); } } stringBuilder.Append("<div class=\"clearfix\">"); if (num3 > 0m) { string text6 = " (改价让利¥" + num3.ToString("F2") + ")"; stringBuilder.Append(string.Concat(new string[] { "<p><span>成交店铺:</span> ", text5, " <i>¥", (num4 - num3).ToString("F2"), "</i>", text6, "</p>" })); stringBuilder.Append("<p><span>佣金总额:</span><i>¥" + (d2 - num3).ToString("F2") + "</i></p>"); } else { stringBuilder.Append(string.Concat(new string[] { "<p><span>成交店铺:</span> ", text5, " <i>¥", num4.ToString("F2"), "</i></p>" })); stringBuilder.Append("<p><span>佣金总额:</span><i>¥" + d2.ToString("F2") + "</i></p>"); } stringBuilder.Append("</div></div></div>"); this.litCommissionInfo.Text = stringBuilder.ToString(); } System.Data.DataTable orderItemsReFundByOrderID = RefundHelper.GetOrderItemsReFundByOrderID(this.orderId); if (orderItemsReFundByOrderID.Rows.Count > 0) { this.rptRefundList.DataSource = orderItemsReFundByOrderID; this.rptRefundList.DataBind(); return; } } } else { base.Response.Write("原订单已删除!"); base.Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { ExpressSet expressSet = ExpressHelper.GetExpressSet(); this.hdHasNewKey.Value = "0"; this.hdExpressUrl.Value = ""; if (expressSet != null) { if (!string.IsNullOrEmpty(expressSet.NewKey)) { this.hdHasNewKey.Value = "1"; } if (!string.IsNullOrEmpty(expressSet.Url.Trim())) { this.hdExpressUrl.Value = expressSet.Url.Trim(); } } if (Globals.RequestFormStr("posttype") == "modifyRefundMondy") { base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"操作失败!\"}"; decimal result = 0M; decimal.TryParse(Globals.RequestFormStr("price"), out result); int productid = Globals.RequestFormNum("pid"); string str3 = Globals.RequestFormStr("oid"); if (((result > 0M) && (productid > 0)) && !string.IsNullOrEmpty(str3)) { if (RefundHelper.UpdateRefundMoney(str3, productid, result)) { s = "{\"type\":\"1\",\"tips\":\"操作成功!\"}"; } } else if (result <= 0M) { s = "{\"type\":\"0\",\"tips\":\"退款金额需大于0!\"}"; } base.Response.Write(s); base.Response.End(); } else { this.reurl = "OrderDetails.aspx?OrderId=" + this.orderId + "&t=" + DateTime.Now.ToString("HHmmss"); this.btnMondifyPay.Click += new EventHandler(this.btnMondifyPay_Click); this.btnCloseOrder.Click += new EventHandler(this.btnCloseOrder_Click); this.btnRemark.Click += new EventHandler(this.btnRemark_Click); this.order = OrderHelper.GetOrderInfo(this.orderId); if (this.order == null) { base.Response.Write("原订单已删除!"); base.Response.End(); } else if (!base.IsPostBack) { this.btnUpdateExpress.Visible = this.order.OrderStatus == OrderStatus.SellerAlreadySent; if (string.IsNullOrEmpty(this.orderId)) { base.GotoResourceNotFound(); } else { this.hdfOrderID.Value = this.orderId; this.litOrderDate.Text = this.order.OrderDate.ToString("yyyy-MM-dd HH:mm:ss"); if (this.order.PayDate.HasValue) { this.litPayDate.Text = DateTime.Parse(this.order.PayDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.ShippingDate.HasValue) { this.litShippingDate.Text = DateTime.Parse(this.order.ShippingDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.FinishDate.HasValue) { this.litFinishDate.Text = DateTime.Parse(this.order.FinishDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } this.lblOrderStatus.OrderStatusCode = this.order.OrderStatus; switch (this.order.OrderStatus) { case OrderStatus.WaitBuyerPay: this.ProcessClass2 = "active"; if (this.order.Gateway != "hishop.plugins.payment.podrequest") { this.btnConfirmPay.Visible = true; } this.btnModifyAddr.Attributes.Add("onclick", "DialogFrame('../trade/ShipAddress.aspx?action=update&OrderId=" + this.orderId + "','修改收货地址',620,410)"); this.btnModifyAddr.Visible = true; break; case OrderStatus.BuyerAlreadyPaid: this.ProcessClass2 = "ok"; this.ProcessClass3 = "active"; this.btnModifyAddr.Attributes.Add("onclick", "DialogFrame('../trade/ShipAddress.aspx?action=update&OrderId=" + this.orderId + "','修改收货地址',620,410)"); this.btnModifyAddr.Visible = true; break; case OrderStatus.SellerAlreadySent: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "active"; break; case OrderStatus.Finished: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "ok"; break; } if (this.order.ManagerMark.HasValue) { this.OrderRemarkImageLink.ManagerMarkValue = (int)this.order.ManagerMark.Value; this.litManagerRemark.Text = this.order.ManagerRemark; } else { this.divRemarkShow.Visible = false; } this.comCode = this.order.ExpressCompanyAbb; this.litRemark.Text = this.order.Remark; string orderId = this.order.OrderId; string orderMarking = this.order.OrderMarking; if (!string.IsNullOrEmpty(orderMarking)) { orderId = orderId + " (" + this.order.PaymentType + "流水号:" + orderMarking + ")"; } this.litOrderId.Text = orderId; this.litUserName.Text = this.order.Username; if (this.order.BalancePayMoneyTotal > 0M) { this.litPayType.Text = "余额支付 ¥" + this.order.BalancePayMoneyTotal.ToString("F2"); } decimal num3 = this.order.GetTotal() - this.order.BalancePayMoneyTotal; if (num3 > 0M) { if (!string.IsNullOrEmpty(this.litPayType.Text.Trim())) { this.litPayType.Text = this.litPayType.Text; } if ((num3 - this.order.CouponFreightMoneyTotal) > 0M) { if (!string.IsNullOrEmpty(this.litPayType.Text)) { this.litPayType.Text = this.litPayType.Text + "<br>"; } this.litPayType.Text = this.litPayType.Text + (!this.order.PayDate.HasValue ? "待支付" : this.order.PaymentType) + " ¥" + num3.ToString("F2"); } } else if (this.order.PaymentTypeId == 0x4d) { this.litPayType.Text = this.order.PaymentType + " ¥" + this.order.PointToCash.ToString("F2"); } else if (this.order.PaymentTypeId == 0x37) { this.litPayType.Text = this.order.PaymentType + " ¥" + this.order.RedPagerAmount.ToString("F2"); } this.litShipToDate.Text = this.order.ShipToDate; this.litRealName.Text = this.order.ShipTo; this.litName.Text = this.order.ShipTo; this.litExOrderId.Text = this.order.OrderId; this.txtShipOrderNumber.Text = this.order.ShipOrderNumber; this.OrderStatusLabelHtml.OrderStatusCode = this.order.OrderStatus; this.litUserTel.Text = string.IsNullOrEmpty(this.order.CellPhone) ? this.order.TelPhone : this.order.CellPhone; this.litShippingRegion.Text = this.order.ShippingRegion; this.litFreight.Text = Globals.FormatMoney(this.order.AdjustedFreight); this.BalancePayFreightMoneyTotal = this.order.BalancePayFreightMoneyTotal; this.BalancePayMoneyTotal = this.order.BalancePayMoneyTotal; if (this.order.ReferralUserId == 0) { this.litSiteName.Text = "主站"; } else { DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (distributorInfo != null) { this.litSiteName.Text = distributorInfo.StoreName; } } StringBuilder builder = new StringBuilder(); if (!string.IsNullOrEmpty(this.order.ActivitiesName)) { this.otherDiscountPrice += this.order.DiscountAmount; builder.Append("<p>" + this.order.ActivitiesName + ":¥" + this.order.DiscountAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.ReducedPromotionName)) { this.otherDiscountPrice += this.order.ReducedPromotionAmount; builder.Append("<p>" + this.order.ReducedPromotionName + ":¥" + this.order.ReducedPromotionAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.CouponName)) { this.otherDiscountPrice += this.order.CouponAmount; builder.Append("<p>" + this.order.CouponName + ":¥" + this.order.CouponAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.RedPagerActivityName)) { this.otherDiscountPrice += this.order.RedPagerAmount; builder.Append("<p>" + this.order.RedPagerActivityName + ":¥" + this.order.RedPagerAmount.ToString("F2") + "</p>"); } if (this.order.PointToCash > 0M) { this.otherDiscountPrice += this.order.PointToCash; builder.Append("<p>积分抵现:¥" + this.order.PointToCash.ToString("F2") + "</p>"); } this.order.GetAdjustCommssion(); decimal num4 = 0M; decimal num5 = 0M; foreach (LineItemInfo info2 in this.order.LineItems.Values) { if (info2.IsAdminModify) { num4 += info2.ItemAdjustedCommssion; } else { num5 += info2.ItemAdjustedCommssion; } } if (num4 != 0M) { if (num4 > 0M) { builder.Append("<p>管理员调价减:¥" + num4.ToString("F2") + "</p>"); } else { builder.Append("<p>管理员调价加:¥" + ((num4 * -1M)).ToString("F2") + "</p>"); } } if (num5 != 0M) { if (num5 > 0M) { builder.Append("<p>分销商调价减:¥" + num5.ToString("F2") + "</p>"); } else { builder.Append("<p>分销商调价加:¥" + ((num5 * -1M)).ToString("F2") + "</p>"); } } this.litActivityShow.Text = builder.ToString(); if (((int)this.lblOrderStatus.OrderStatusCode) != 4) { this.lbCloseReason.Visible = false; } else { this.divOrderProcess.Visible = false; this.lbReason.Text = this.order.CloseReason; } if ((this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid) || ((this.order.OrderStatus == OrderStatus.WaitBuyerPay) && (this.order.Gateway == "hishop.plugins.payment.podrequest"))) { this.btnSendGoods.Visible = true; } else { this.btnSendGoods.Visible = false; } if (((this.order.OrderStatus == OrderStatus.SellerAlreadySent) || (this.order.OrderStatus == OrderStatus.Finished)) && !string.IsNullOrEmpty(this.order.ExpressCompanyAbb)) { this.pLoginsticInfo.Visible = true; this.btnViewLogistic.Visible = true; if ((Express.GetExpressType() == "kuaidi100") && (this.power != null)) { this.power.Visible = true; } } if (this.order.OrderStatus == OrderStatus.WaitBuyerPay) { this.btnClocsOrder.Visible = true; this.btnModifyPrice.Visible = true; } else { this.btnClocsOrder.Visible = false; this.btnModifyPrice.Visible = false; } this.btnModifyPrice.Attributes.Add("onclick", "DialogFrame('../trade/EditOrder.aspx?OrderId=" + this.orderId + "&reurl=" + base.Server.UrlEncode(this.reurl) + "','修改订单价格',900,450)"); this.BindRemark(this.order); this.ddlpayment.DataBind(); this.ddlpayment.SelectedValue = new int?(this.order.PaymentTypeId); this.rptItemList.DataSource = this.order.LineItems.Values; this.rptItemList.DataBind(); string oldAddress = this.order.OldAddress; string str7 = string.Empty; if (!string.IsNullOrEmpty(this.order.ShippingRegion)) { str7 = this.order.ShippingRegion.Replace(',', ' '); } if (!string.IsNullOrEmpty(this.order.Address)) { str7 = str7 + this.order.Address; } if (!string.IsNullOrEmpty(this.order.ShipTo)) { str7 = str7 + "," + this.order.ShipTo; } if (!string.IsNullOrEmpty(this.order.TelPhone)) { str7 = str7 + "," + this.order.TelPhone; } if (!string.IsNullOrEmpty(this.order.CellPhone)) { str7 = str7 + "," + this.order.CellPhone; } if (string.IsNullOrEmpty(oldAddress)) { this.lblOriAddress.Text = str7; this.pNewAddress.Visible = false; } else { this.lblOriAddress.Text = oldAddress; this.litAddress.Text = str7; } if ((this.order.OrderStatus == OrderStatus.Finished) || (this.order.OrderStatus == OrderStatus.SellerAlreadySent)) { string realModeName = this.order.RealModeName; if (string.IsNullOrEmpty(realModeName)) { realModeName = this.order.ModeName; } this.litModeName.Text = realModeName; this.litShipOrderNumber.Text = this.order.ShipOrderNumber; } else { this.litModeName.Text = this.order.ModeName; } if (!string.IsNullOrEmpty(this.order.ExpressCompanyName)) { this.litCompanyName.Text = this.order.ExpressCompanyName; this.hdCompanyCode.Value = this.order.ExpressCompanyAbb; } MemberInfo member = MemberProcessor.GetMember(this.order.UserId, true); if (member != null) { if (!string.IsNullOrEmpty(member.OpenId)) { this.litWeiXinNickName.Text = member.UserName; } if (!string.IsNullOrEmpty(member.UserBindName)) { this.litUserName.Text = member.UserBindName; } } if (this.order.ReferralUserId > 0) { builder = new StringBuilder(); builder.Append("<div class=\"commissionInfo mb20\"><h3>佣金信息</h3><div class=\"commissionInfoInner\">"); decimal num6 = 0M; decimal totalCommssion = 0M; decimal secondTotalCommssion = 0M; decimal thirdTotalCommssion = 0M; if (this.order.OrderStatus != OrderStatus.Closed) { totalCommssion = this.order.GetTotalCommssion(); secondTotalCommssion = this.order.GetSecondTotalCommssion(); thirdTotalCommssion = this.order.GetThirdTotalCommssion(); } num6 += totalCommssion; string storeName = string.Empty; DistributorsInfo info4 = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (info4 != null) { storeName = info4.StoreName; if ((this.order.ReferralPath != null) && (this.order.ReferralPath.Length > 0)) { string[] strArray = this.order.ReferralPath.Trim().Split(new char[] { '|' }); int distributorid = 0; if (strArray.Length > 1) { distributorid = Globals.ToNum(strArray[0]); if (distributorid > 0) { info4 = DistributorsBrower.GetDistributorInfo(distributorid); if (info4 != null) { num6 += thirdTotalCommssion; builder.Append("<p class=\"mb5\"><span>上二级分销商:</span> " + info4.StoreName + "<i> ¥" + thirdTotalCommssion.ToString("F2") + "</i></p>"); } } distributorid = Globals.ToNum(strArray[1]); if (distributorid > 0) { info4 = DistributorsBrower.GetDistributorInfo(distributorid); if (info4 != null) { num6 += secondTotalCommssion; builder.Append("<p class=\"mb5\"><span>上一级分销商:</span> " + info4.StoreName + "<i> ¥" + secondTotalCommssion.ToString("F2") + "</i></p>"); } } } else if (strArray.Length == 1) { distributorid = Globals.ToNum(strArray[0]); if (distributorid > 0) { info4 = DistributorsBrower.GetDistributorInfo(distributorid); if (info4 != null) { builder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); num6 += secondTotalCommssion; builder.Append("<p class=\"mb5\"><span>上一级分销商:</span>" + info4.StoreName + " <i> ¥" + secondTotalCommssion.ToString("F2") + "</i></p>"); } } } } else { builder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); builder.Append("<p class=\"mb5\"><span>上一级分销商:</span>-</p>"); } } builder.Append("<div class=\"clearfix\">"); if (num5 > 0M) { string str10 = " (改价让利¥" + num5.ToString("F2") + ")"; string[] strArray2 = new string[7]; strArray2[0] = "<p><span>成交店铺:</span> "; strArray2[1] = storeName; strArray2[2] = " <i>¥"; decimal num11 = totalCommssion - num5; strArray2[3] = num11.ToString("F2"); strArray2[4] = "</i>"; strArray2[5] = str10; strArray2[6] = "</p>"; builder.Append(string.Concat(strArray2)); builder.Append("<p><span>佣金总额:</span><i>¥" + ((num6 - num5)).ToString("F2") + "</i></p>"); } else { builder.Append("<p><span>成交店铺:</span> " + storeName + " <i>¥" + totalCommssion.ToString("F2") + "</i></p>"); builder.Append("<p><span>佣金总额:</span><i>¥" + num6.ToString("F2") + "</i></p>"); } builder.Append("</div></div></div>"); this.litCommissionInfo.Text = builder.ToString(); } DataTable orderItemsReFundByOrderID = RefundHelper.GetOrderItemsReFundByOrderID(this.orderId); if (orderItemsReFundByOrderID.Rows.Count > 0) { this.rptRefundList.DataSource = orderItemsReFundByOrderID; this.rptRefundList.DataBind(); } } } } }
/// <summary> /// 检查将要操作的数据是否符合业务规则 /// </summary> /// <param name="p_BE"></param> private void CheckCorrect(BaseEntity p_BE) { Express entity = (Express)p_BE; }
public Task <int> InsertAsync(Express entity) { return(_repository.InsertAsync(entity)); }
/// <summary> /// 修改 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int Update(BaseEntity p_Entity) { try { Express MasterEntity = (Express)p_Entity; if (MasterEntity.ID == 0) { return(0); } //更新主表数据 StringBuilder UpdateBuilder = new StringBuilder(); UpdateBuilder.Append("UPDATE Finance_Express SET "); UpdateBuilder.Append(" ID=" + SysString.ToDBString(MasterEntity.ID) + ","); UpdateBuilder.Append(" FormNo=" + SysString.ToDBString(MasterEntity.FormNo) + ","); UpdateBuilder.Append(" CouriersNo=" + SysString.ToDBString(MasterEntity.CouriersNo) + ","); if (MasterEntity.Amount != 0) { UpdateBuilder.Append(" Amount=" + SysString.ToDBString(MasterEntity.Amount) + ","); } else { UpdateBuilder.Append(" Amount=null,"); } UpdateBuilder.Append(" CheckOPID=" + SysString.ToDBString(MasterEntity.CheckOPID) + ","); UpdateBuilder.Append(" CheckDate=" + SysString.ToDBString(MasterEntity.CheckDate) + ","); UpdateBuilder.Append(" MakeOPID=" + SysString.ToDBString(MasterEntity.MakeOPID) + ","); UpdateBuilder.Append(" MakeOPName=" + SysString.ToDBString(MasterEntity.MakeOPName) + ","); if (MasterEntity.MakeDate != SystemConfiguration.DateTimeDefaultValue) { UpdateBuilder.Append(" MakeDate=" + SysString.ToDBString(MasterEntity.MakeDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { UpdateBuilder.Append(" MakeDate=null,"); } UpdateBuilder.Append(" SubmitFlag=" + SysString.ToDBString(MasterEntity.SubmitFlag) + ","); UpdateBuilder.Append(" DelFlag=" + SysString.ToDBString(MasterEntity.DelFlag) + ","); UpdateBuilder.Append(" Remark=" + SysString.ToDBString(MasterEntity.Remark) + ","); UpdateBuilder.Append(" Type=" + SysString.ToDBString(MasterEntity.Type) + ","); UpdateBuilder.Append(" ExpressCompany=" + SysString.ToDBString(MasterEntity.ExpressCompany) + ","); UpdateBuilder.Append(" VendorAddress=" + SysString.ToDBString(MasterEntity.VendorAddress)); UpdateBuilder.Append(" WHERE " + "ID=" + SysString.ToDBString(MasterEntity.ID)); //执行 int AffectedRows = 0; if (!this.sqlTransFlag) { AffectedRows = this.ExecuteNonQuery(UpdateBuilder.ToString()); } else { AffectedRows = sqlTrans.ExecuteNonQuery(UpdateBuilder.ToString()); } return(AffectedRows); } catch (BaseException E) { throw new BaseException(E.Message, E); } catch (Exception E) { throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBUpdate), E); } }
/// <summary> /// 新增 /// </summary> /// <param name="p_Entity">实体类</param> /// <returns>操作影响的记录行数</returns> public override int AddNew(BaseEntity p_Entity) { try { Express MasterEntity = (Express)p_Entity; if (MasterEntity.ID == 0) { return(0); } //新增主表数据 StringBuilder MasterField = new StringBuilder(); StringBuilder MasterValue = new StringBuilder(); MasterField.Append("INSERT INTO Finance_Express("); MasterValue.Append(" VALUES("); MasterField.Append("ID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ID) + ","); MasterField.Append("FormNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.FormNo) + ","); MasterField.Append("CouriersNo" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.CouriersNo) + ","); MasterField.Append("Amount" + ","); if (MasterEntity.Amount != 0) { MasterValue.Append(SysString.ToDBString(MasterEntity.Amount) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("CheckOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.CheckOPID) + ","); MasterField.Append("CheckDate" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.CheckDate) + ","); MasterField.Append("MakeOPID" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.MakeOPID) + ","); MasterField.Append("MakeOPName" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.MakeOPName) + ","); MasterField.Append("MakeDate" + ","); if (MasterEntity.MakeDate != SystemConfiguration.DateTimeDefaultValue) { MasterValue.Append(SysString.ToDBString(MasterEntity.MakeDate.ToString("yyyy-MM-dd HH:mm:ss")) + ","); } else { MasterValue.Append("null,"); } MasterField.Append("SubmitFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.SubmitFlag) + ","); MasterField.Append("DelFlag" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.DelFlag) + ","); MasterField.Append("Remark" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Remark) + ","); MasterField.Append("Type" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.Type) + ","); MasterField.Append("ExpressCompany" + ","); MasterValue.Append(SysString.ToDBString(MasterEntity.ExpressCompany) + ","); MasterField.Append("VendorAddress" + ")"); MasterValue.Append(SysString.ToDBString(MasterEntity.VendorAddress) + ")"); //执行 int AffectedRows = 0; if (!this.sqlTransFlag) { AffectedRows = this.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString()); } else { AffectedRows = sqlTrans.ExecuteNonQuery(MasterField.Append(MasterValue.ToString()).ToString()); } return(AffectedRows); } catch (BaseException E) { throw new BaseException(E.Message, E); } catch (Exception E) { throw new BaseException(FrameWorkMessage.GetAlertMessage((int)Message.CommonDBInsert), E); } }
static void Main(string[] args) { Method print; Car car = new Car(); car.Car2(); Vehicle vehicle = new Vehicle(); vehicle.Color2(); vehicle.Work(); Train train = new Train(); train.Number(); Express express = new Express(); express.Speed1(); back: Console.Clear(); int N = 1; Transport[] transport = new Transport[N]; for (int i = 0; i < N; i++) { transport[i].car = car.Type; transport[i].name = vehicle.Name; transport[i].color = vehicle.Color; transport[i].wagons = train.Wagons; transport[i].speed = express.Speed; } for (int i = 0; i < N; i++) { Console.WriteLine("№ {0}\t{1}\t{2}\t{3}\t{4}\n", i + 1, transport[i].car, transport[i].name, transport[i].color, transport[i].wagons, transport[i].speed); } Console.ReadLine(); int Select2; Console.WriteLine("1-Найти; 2 - Изменить; 3 - Выйти"); Console.WriteLine("Выберите что хотите сделать"); Select2 = int.Parse(Console.ReadLine()); switch (Select2) { case 1: Find(); break; case 2: Change(); break; case 3: Environment.Exit(0); break; } Transport[] Change() { Console.Clear(); int Select; Console.WriteLine("1 - Изменить тип авто; 2 - Изменить цвет авто; 3 - Изменить наименование авто; 4 - Изменить количество вагонов"); Console.WriteLine("Выберите номер строки"); int i = int.Parse(Console.ReadLine()) - 1; Console.WriteLine("Введите, что изменить"); Select = int.Parse(Console.ReadLine()); Console.WriteLine("№ {0}\t{1}\t{2}\t{3}\t{4}", i + 1, transport[i].car, transport[i].name, transport[i].color, transport[i].wagons, transport[i].speed); switch (Select) { case 1: Console.WriteLine("Введите новый тип авто"); transport[i].car = Console.ReadLine(); break; case 2: Console.WriteLine("Введите новый цвет авто"); transport[i].color = Console.ReadLine(); break; case 3: Console.WriteLine("Введите новое наименование авто"); transport[i].name = Console.ReadLine(); break; case 4: Console.WriteLine("Введите новое количество вагонов"); transport[i].wagons = int.Parse(Console.ReadLine()); break; } Console.WriteLine("№ {0}\t{1}\t{2}\t{3}\t{4}", i + 1, transport[i].car, transport[i].name, transport[i].color, transport[i].wagons, transport[i].speed); Console.ReadLine(); return(transport); } Transport[] Find() { Console.Clear(); int Select; Console.WriteLine("1 - Найти тип авто; 2 - Найти цвет авто; 3 - Найти наименование авто; 4 - Найти количество вагонов "); Console.WriteLine("Введите, что найти"); Select = int.Parse(Console.ReadLine()); switch (Select) { case 1: string type; Console.WriteLine("Введите тип авто"); type = Console.ReadLine(); for (int i = 0; i < N; i++) { if (transport[i].car == type) { Console.WriteLine("№ {0}\t{1}\t{2}\t{3}\t{4}", i + 1, transport[i].car, transport[i].name, transport[i].color, transport[i].wagons, transport[i].speed); } } break; case 2: string color; Console.WriteLine("Введите цвет авто"); color = Console.ReadLine(); for (int i = 0; i < N; i++) { if (transport[i].color == color) { Console.WriteLine("№ {0}\t{1}\t{2}\t{3}\t{4}", i + 1, transport[i].car, transport[i].name, transport[i].color, transport[i].wagons, transport[i].speed); } } break; case 3: string name; Console.WriteLine("Введите наименование авто"); name = Console.ReadLine(); for (int i = 0; i < N; i++) { if (transport[i].name == name) { Console.WriteLine("№ {0}\t{1}\t{2}\t{3}\t{4}", i + 1, transport[i].car, transport[i].name, transport[i].color, transport[i].wagons, transport[i].speed); } } break; case 4: int wagons; Console.WriteLine("Введите количество вагонов"); wagons = int.Parse(Console.ReadLine()); for (int i = 0; i < N; i++) { if (transport[i].wagons == wagons) { Console.WriteLine("№ {0}\t{1}\t{2}\t{3}\t{4}", i + 1, transport[i].car, transport[i].name, transport[i].color, transport[i].wagons, transport[i].speed); } } break; } return(transport); } goto back; }
public void Add(Express express) { list.Add(express); }
public void LoadControl() { string shippingRegion = string.Empty; if (!string.IsNullOrEmpty(this.order.ShippingRegion)) { shippingRegion = this.order.ShippingRegion; } if (!string.IsNullOrEmpty(this.order.Address)) { shippingRegion = shippingRegion + this.order.Address; } if (!string.IsNullOrEmpty(this.order.ShipTo)) { shippingRegion = shippingRegion + " " + this.order.ShipTo; } if (!string.IsNullOrEmpty(this.order.ZipCode)) { shippingRegion = shippingRegion + " " + this.order.ZipCode; } if (!string.IsNullOrEmpty(this.order.TelPhone)) { shippingRegion = shippingRegion + " " + this.order.TelPhone; } if (!string.IsNullOrEmpty(this.order.CellPhone)) { shippingRegion = shippingRegion + " " + this.order.CellPhone; } this.lblShipAddress.Text = shippingRegion; if (this.order.OrderStatus == OrderStatus.WaitBuyerPay) { this.lkBtnEditShippingAddress.Visible = true; } this.litShipToDate.Text = this.order.ShipToDate; if ((this.order.OrderStatus == OrderStatus.Finished) || (this.order.OrderStatus == OrderStatus.SellerAlreadySent)) { this.litModeName.Text = this.order.RealModeName; this.ltrShipNum.Text = " 物流单号:" + this.order.ShipOrderNumber; } else { this.litModeName.Text = this.order.ModeName; } if (!string.IsNullOrEmpty(this.order.ExpressCompanyName)) { this.litCompanyName.Text = this.order.ExpressCompanyName; this.tr_company.Visible = true; } this.litRemark.Text = this.order.Remark; if (((this.order.OrderStatus == OrderStatus.SellerAlreadySent) || (this.order.OrderStatus == OrderStatus.Finished)) && !string.IsNullOrEmpty(this.order.ExpressCompanyAbb)) { if (this.plExpress != null) { this.plExpress.Visible = true; } if ((Express.GetExpressType() == "kuaidi100") && (this.power != null)) { this.power.Visible = true; } } }
public Task <int> DeleteAsync(Express entity) { return(_repository.DeleteAsync(entity)); }
public ExpressResult ExpressCalc(Express express) { var result = new ExpressResult { AquaLiters = express.AquaLiters, ContainerCapacity = express.ContainerCapacity }; //nitrogen result.MaxKNO3g = SolubilityInWater( result.ContainerCapacity.Value, KNO3SolubilityGramsPer100Ml); result.MaxConcentrationNinKNO3MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.MaxKNO3g.Value, result.ContainerCapacity.Value, Percent(KNO3ContentN)); result.MaxConcentrationKinKNO3MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.MaxKNO3g.Value, result.ContainerCapacity.Value, Percent(KNO3ContentK)); if (result.MaxConcentrationNinKNO3MgPerLiter <= 0.5) { result.OptimalConcentrationNinKNO3MgPerLiter = result.MaxConcentrationNinKNO3MgPerLiter.Value; result.OptimalConcentrationKinKNO3MgPerLiter = result.MaxConcentrationKinKNO3MgPerLiter.Value; result.OptimalKNO3g = result.MaxKNO3g.Value; } else if (result.MaxConcentrationNinKNO3MgPerLiter > 0.5 && result.MaxConcentrationNinKNO3MgPerLiter < 1) { result.OptimalKNO3g = (result.MaxKNO3g.Value * 0.5) / result.MaxConcentrationNinKNO3MgPerLiter.Value; result.OptimalConcentrationNinKNO3MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalKNO3g.Value, result.ContainerCapacity.Value, Percent(KNO3ContentN)); result.OptimalConcentrationKinKNO3MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalKNO3g.Value, result.ContainerCapacity.Value, Percent(KNO3ContentK)); } else { result.OptimalKNO3g = (result.MaxKNO3g.Value * 1) / result.MaxConcentrationNinKNO3MgPerLiter.Value; result.OptimalConcentrationNinKNO3MgPerLiter = Math.Round(ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalKNO3g.Value, result.ContainerCapacity.Value, Percent(KNO3ContentN)), 2); result.OptimalConcentrationKinKNO3MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalKNO3g.Value, result.ContainerCapacity.Value, Percent(KNO3ContentK)); } //phosphorus result.MaxKH2PO4g = SolubilityInWater( result.ContainerCapacity.Value, KH2PO4SolubilityGramsPer100Ml); result.MaxConcentrationPinKH2PO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.MaxKH2PO4g.Value, result.ContainerCapacity.Value, Percent(KH2PO4ContentP)); result.MaxConcentrationKinKH2PO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.MaxKH2PO4g.Value, result.ContainerCapacity.Value, Percent(KH2PO4ContentK)); if (result.MaxConcentrationPinKH2PO4MgPerLiter <= 0.5) { result.OptimalConcentrationPinKH2PO4MgPerLiter = result.MaxConcentrationPinKH2PO4MgPerLiter; result.OptimalConcentrationKinKH2PO4MgPerLiter = result.MaxConcentrationKinKH2PO4MgPerLiter; result.OptimalKH2PO4g = result.MaxKH2PO4g; } else if (result.MaxConcentrationPinKH2PO4MgPerLiter > 0.5 && result.MaxConcentrationPinKH2PO4MgPerLiter < 1) { result.OptimalKH2PO4g = (result.MaxKH2PO4g.Value * 0.1) / result.MaxConcentrationPinKH2PO4MgPerLiter.Value; result.OptimalConcentrationPinKH2PO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalKH2PO4g.Value, result.ContainerCapacity.Value, Percent(KH2PO4ContentP)); result.OptimalConcentrationKinKH2PO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalKH2PO4g.Value, result.ContainerCapacity.Value, Percent(KH2PO4ContentK)); } else { result.OptimalKH2PO4g = (result.MaxKH2PO4g.Value * .1) / result.MaxConcentrationPinKH2PO4MgPerLiter.Value; result.OptimalConcentrationPinKH2PO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalKH2PO4g.Value, result.ContainerCapacity.Value, Percent(KH2PO4ContentP)); result.OptimalConcentrationKinKH2PO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalKH2PO4g.Value, result.ContainerCapacity.Value, Percent(KH2PO4ContentK)); } //potasium result.MaxK2SO4g = SolubilityInWater( result.ContainerCapacity.Value, K2SO4SolubilityGramsPer100Ml); result.MaxConcentrationKinK2SO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.MaxK2SO4g.Value, result.ContainerCapacity.Value, Percent(K2SO4ContentK)); if (result.MaxConcentrationKinK2SO4MgPerLiter <= 0.5) { result.OptimalConcentrationKinK2SO4MgPerLiter = result.MaxConcentrationKinK2SO4MgPerLiter; result.OptimalK2SO4g = result.MaxK2SO4g.Value; } else if (result.MaxConcentrationKinK2SO4MgPerLiter > 0.5 && result.MaxConcentrationKinK2SO4MgPerLiter < 1) { result.OptimalK2SO4g = (result.MaxK2SO4g.Value * 0.5) / result.MaxConcentrationKinK2SO4MgPerLiter.Value; result.OptimalConcentrationKinK2SO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalK2SO4g.Value, result.ContainerCapacity.Value, Percent(K2SO4ContentK)); } else { result.OptimalK2SO4g = (result.MaxK2SO4g.Value * 1) / result.MaxConcentrationKinK2SO4MgPerLiter.Value; result.OptimalConcentrationKinK2SO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalK2SO4g.Value, result.ContainerCapacity.Value, Percent(K2SO4ContentK)); } //magnesium result.MaxMgSO4g = SolubilityInWater( result.ContainerCapacity.Value, MgSO4SolubilityGramsPer100Ml); result.MaxConcentrationMginMgSO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.MaxMgSO4g.Value, result.ContainerCapacity.Value, Percent(MgSO47H2OContentMg)); if (result.MaxConcentrationMginMgSO4MgPerLiter <= 0.5) { result.OptimalConcentrationMginMgSO4MgPerLiter = result.MaxConcentrationMginMgSO4MgPerLiter; result.OptimalMgSO4g = result.MaxMgSO4g; } else if (result.MaxConcentrationMginMgSO4MgPerLiter > 0.5 && result.MaxConcentrationMginMgSO4MgPerLiter < 1) { result.OptimalMgSO4g = (result.MaxMgSO4g.Value * 0.5) / result.MaxConcentrationMginMgSO4MgPerLiter.Value; result.OptimalConcentrationMginMgSO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalMgSO4g.Value, result.ContainerCapacity.Value, Percent(MgSO47H2OContentMg)); } else { result.OptimalMgSO4g = (result.MaxMgSO4g.Value * 1) / result.MaxConcentrationMginMgSO4MgPerLiter.Value; result.OptimalConcentrationMginMgSO4MgPerLiter = ConcentrationIn1Ml( result.AquaLiters.Value, result.OptimalMgSO4g.Value, result.ContainerCapacity.Value, Percent(MgSO47H2OContentMg)); } return(result); }
/// <summary> /// 新增 /// </summary> /// <returns>操作影响的行数</returns> public int Insert(Express entity) { return(_repository.Insert(entity)); }
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(); } } }
private static extern void Call(Express app, IRouterMatcher <This <IRouter> > config, string path, RequestHandler handler);
public string SendLogistic(string tid, string company_name, string out_sid) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(tid); if (orderInfo == null || string.IsNullOrEmpty(orderInfo.OrderId)) { return(OpenApiErrorMessage.ShowErrorMsg(OpenApiErrorCode.Trade_not_Exists, "tid")); } if (orderInfo.GroupBuyId > 0 && orderInfo.GroupBuyStatus != GroupBuyStatus.Success) { return(OpenApiErrorMessage.ShowErrorMsg(OpenApiErrorCode.Trade_Status_Send, "group order")); } if (!orderInfo.CheckAction(OrderActions.SELLER_SEND_GOODS)) { return(OpenApiErrorMessage.ShowErrorMsg(OpenApiErrorCode.Trade_Status_Send, "orderstatue")); } if (string.IsNullOrEmpty(out_sid)) { return(OpenApiErrorMessage.ShowErrorMsg(OpenApiErrorCode.Missing_Required_Arguments, "out_sid")); } ExpressCompanyInfo expressCompanyInfo = ExpressHelper.FindNode(company_name); if (expressCompanyInfo == null) { return(OpenApiErrorMessage.ShowErrorMsg(OpenApiErrorCode.Company_not_Exists, "company_name")); } orderInfo.ExpressCompanyAbb = expressCompanyInfo.Kuaidi100Code; orderInfo.ExpressCompanyName = expressCompanyInfo.Name; orderInfo.ShipOrderNumber = out_sid; if (!OrderHelper.SendGoods(orderInfo)) { return(OpenApiErrorMessage.ShowErrorMsg(OpenApiErrorCode.Trade_Status_Send, "send good")); } Express.SubscribeExpress100(orderInfo.ExpressCompanyAbb, out_sid); OrderHelper.SaveSendNote(new SendNoteInfo { NoteId = Globals.GetGenerateId(), OrderId = orderInfo.OrderId, Operator = orderInfo.UserId.ToString(), Remark = "接口发货成功" }); 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 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"); } } if (orderInfo.Gateway == "hishop.plugins.payment.weixinrequest") { SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PayClient payClient; if (masterSettings.EnableSP) { payClient = new PayClient(masterSettings.Main_AppId, masterSettings.WeixinAppSecret, masterSettings.Main_Mch_ID, masterSettings.Main_PayKey, true, masterSettings.WeixinAppId, masterSettings.WeixinPartnerID); } else { payClient = new PayClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, false, "", ""); } payClient.DeliverNotify(new DeliverInfo { TransId = orderInfo.GatewayOrderId, OutTradeNo = orderInfo.OrderId, OpenId = MemberHelper.GetMember(orderInfo.UserId).OpenId }); } } orderInfo.OnDeliver(); string format = "{{\"logistics_send_response\":{{\"shipping\":{{\"is_success\":{0}}}}}}}"; return(string.Format(format, "true")); }
public ActionResult blue_OrderDetails2(string id) { string hotelId = id; string orderId = HotelCloud.Common.HCRequest.GetString("orderid"); string key = HotelCloud.Common.HCRequest.GetString("key"); //"酒店微信id@用户微信id" string weixinid = HotelCloud.Common.HCRequest.GetString("weixinID"); //酒店微信id string userweixinid = ""; if (!key.Equals("") && key.Contains("@")) { weixinid = key.Split('@')[0];//酒店微信id userweixinid = key.Split('@')[1]; } ViewData["list_ordersLog"] = new DataTable(); ViewData["PayStatus"] = 0; ViewData["addressType"] = "酒店"; ViewData["shoppingCarDataTable"] = new DataTable(); ViewData["amount"] = 0; ViewData["refundfee"] = 0; ViewData["ExpressCompany"] = ""; ViewData["ExpressNo"] = ""; ViewData["hotelId"] = ""; ViewData["ExpressFee"] = 0; ViewData["remark"] = ""; ViewData["OrderStatus"] = 0; ViewData["CreateTime"] = new DateTime(); ViewData["CanPurchase"] = 0; ViewData["PurchasePoints"] = 0; ViewData["PayMethod"] = ""; ViewData["isAllowDelayed"] = false; ViewData["isShowAllowDelayed"] = true; ViewData["DelayedTake"] = 0; ViewData["CouponId"] = ""; ViewData["CouponMoney"] = 0; ViewData["express"] = new ExpressData(); ViewData["weixinid"] = weixinid; ViewData["userweixinid"] = userweixinid; ViewData["orderId"] = orderId; ViewData["hotelId"] = id; try { var orderData = orderService.GetDataByOrderId(orderId).Rows[0]; double refundfee = 0; try { refundfee = double.Parse(orderData["Refundfee"].ToString()) + double.Parse(orderData["CardRefundfee"].ToString()); } catch (Exception e) { } ViewData["refundfee"] = refundfee; //计算订单总金额 double sum = 0; var shoppingCarDataTable = SupermarketOrderDetailService.GetDataByOrderId(orderId); foreach (DataRow data in shoppingCarDataTable.Rows) { sum += double.Parse(data["Price"].ToString()) * double.Parse(data["Total"].ToString()); } //获取收货地址 ViewData["hotelName"] = DishOrderLogic.GetHotelName(orderData["HotelId"].ToString()); ViewData["ExpressFee"] = 0; TimeSpan ts = new TimeSpan(); //用于计算是否可延迟收货 if (!string.IsNullOrWhiteSpace(orderData["AddressType"].ToString())) { if (orderData["AddressType"].ToString() == "1") { ViewData["addressType"] = "酒店"; ts = DateTime.Now - DateTime.Parse(orderData["CreateTime"].ToString()).AddDays(4); } else { ViewData["addressType"] = "快递"; ts = DateTime.Now - DateTime.Parse(orderData["CreateTime"].ToString()).AddDays(12); sum += double.Parse(orderData["ExpressFee"].ToString()); } ViewData["addressName"] = orderData["Address"].ToString(); } else { ViewData["Address"] = new OrderAddress(); ViewData["addressType"] = "酒店"; ViewData["addressName"] = ViewData["hotelName"]; } ViewData["Linkman"] = orderData["Linkman"].ToString(); ViewData["LinkPhone"] = orderData["LinkPhone"].ToString(); ViewData["isAllowDelayed"] = false; ViewData["isShowAllowDelayed"] = true; ViewData["DelayedTake"] = orderData["DelayedTake"]; if (orderData["DelayedTake"].ToString() == "0") { ViewData["isAllowDelayed"] = ts.Days >= 0 ? true : false; } else { ViewData["isShowAllowDelayed"] = false; } //获取快递信息 Express express = GetExpressData(orderData["ExpressNo"].ToString()); try { ViewData["express"] = express.data[0]; } catch (Exception e) { ViewData["express"] = new ExpressData(); } try { var hotelData = GetHotelBySupermarket(int.Parse(id)).Rows[0]; ViewData["hotelPhone"] = hotelData["tel"]; } catch { ViewData["hotelPhone"] = ""; } //获取积分 ViewData["orderScore"] = 0; ViewData["equivalence"] = 1; ViewData["GradePlus"] = 1; MemberInfo Info = MemberHelper.GetMemberInfo(weixinid); string cardno = MemberHelper.GetCardNo(userweixinid, weixinid); if (!string.IsNullOrEmpty(cardno)) { MemberCard MyCard = MemberHelper.GetMemberCard(cardno, weixinid); MemberCardIntegralRule IntegralRule = MemberHelper.IntegralRule(Info, MyCard); var score = sum; if (IntegralRule.equivalence > 0) { score = score * IntegralRule.equivalence; ViewData["equivalence"] = IntegralRule.equivalence; } if ((double)IntegralRule.GradePlus > 0) { score = score * (double)IntegralRule.GradePlus; ViewData["GradePlus"] = IntegralRule.GradePlus; } ViewData["orderScore"] = Math.Floor(Math.Round(score, 2));; } var dbLog = orderService.GetOrderLogDataByOrderId(orderId); ViewData["list_ordersLog"] = dbLog; ViewData["PayStatus"] = orderData["PayStatus"]; ViewData["shoppingCarDataTable"] = shoppingCarDataTable; ViewData["amount"] = orderData["Money"]; ViewData["ExpressCompany"] = orderData["ExpressCompany"]; ViewData["ExpressNo"] = orderData["ExpressNo"]; ViewData["hotelId"] = orderData["HotelId"].ToString(); ViewData["ExpressFee"] = orderData["ExpressFee"]; ViewData["remark"] = orderData["Remark"].ToString(); ViewData["OrderStatus"] = orderData["OrderStatus"].ToString(); ViewData["CreateTime"] = orderData["CreateTime"]; ViewData["CanPurchase"] = orderData["CanPurchase"]; ViewData["PurchasePoints"] = orderData["PurchasePoints"]; ViewData["PayMethod"] = orderData["PayMethod"]; ViewData["CouponId"] = orderData["CouponId"]; ViewData["CouponMoney"] = orderData["CouponMoney"]; ViewData["weixinid"] = weixinid; ViewData["userweixinid"] = userweixinid; ViewData["orderId"] = orderId; } catch (Exception e) { } return(View()); }
public List <Express> Find(String condition) { SqlHelper helper = null; try { helper = new SqlHelper(); String sql = "select e.id,e.code,e.title,s.code as studentcode," + "s.name,s.id as studentid,b.building_name," + "d.dorm_name,e.delegate_time,e.receive_time,e.status, " + "e.dorm_id,e.sender_id " + " from express e " + "inner join student s on e.student_id=s.id " + "inner join dorm d on e.dorm_id=d.id " + "inner join building b on d.building_id=b.id " + "inner join sender r on e.sender_id=r.id "; if (!String.IsNullOrEmpty(condition)) { sql += " where " + condition; } List <Express> result = new List <Express>(); DataTable dt = helper.Query(sql, null); foreach (DataRow dr in dt.Rows) { Express express = new Express(); express.Id = dr["id"].ToString(); express.ExpressCode = dr["code"].ToString(); express.ExpressTitle = dr["title"].ToString(); express.StudentCode = dr["studentcode"].ToString(); express.StudentName = dr["name"].ToString(); express.StudentId = dr["studentid"].ToString(); express.BuildingName = dr["building_name"].ToString(); express.DormName = dr["dorm_name"].ToString(); if (dr["delegate_time"] == DBNull.Value) { express.DelegateTime = null; } else { express.DelegateTime = DateTime.Parse(dr["delegate_time"].ToString()); } if (dr["receive_time"] == DBNull.Value) { express.ReceiveTime = null; } else { express.ReceiveTime = DateTime.Parse(dr["receive_time"].ToString()); } express.Status = int.Parse(dr["status"].ToString()); result.Add(express); } return(result); } catch (Exception e) { throw e; } finally { if (helper != null) { helper.DisConnect(); } } }
protected void Page_Load(object sender, EventArgs e) { this.btnDelete.Click += new EventHandler(this.btnDelete_Click); this.btnRestoreCheck.Click += new EventHandler(this.btnRestoreCheck_Click); this.btnDeleteAndUpdateData.Click += new EventHandler(this.btnDeleteAndUpdateData_Click); ExpressSet expressSet = ExpressHelper.GetExpressSet(); this.hdHasNewKey.Value = "0"; this.hdExpressUrl.Value = ""; if (expressSet != null) { if (!string.IsNullOrEmpty(expressSet.NewKey)) { this.hdHasNewKey.Value = "1"; } if (!string.IsNullOrEmpty(expressSet.Url.Trim())) { this.hdExpressUrl.Value = expressSet.Url.Trim(); } } if (Globals.RequestFormStr("posttype") == "modifyRefundMondy") { base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"操作失败!\"}"; decimal result = 0M; decimal.TryParse(Globals.RequestFormStr("price"), out result); int productid = Globals.RequestFormNum("pid"); string str3 = Globals.RequestFormStr("oid"); if (((result > 0M) && (productid > 0)) && !string.IsNullOrEmpty(str3)) { if (RefundHelper.UpdateRefundMoney(str3, productid, result)) { s = "{\"type\":\"1\",\"tips\":\"操作成功!\"}"; } } else if (result <= 0M) { s = "{\"type\":\"0\",\"tips\":\"退款金额需大于0!\"}"; } base.Response.Write(s); base.Response.End(); } else { this.reurl = "OrderDetails.aspx?OrderId=" + this.orderId + "&t=" + DateTime.Now.ToString("HHmmss"); this.btnMondifyPay.Click += new EventHandler(this.btnMondifyPay_Click); this.btnRemark.Click += new EventHandler(this.btnRemark_Click); this.order = OrderHelper.GetOrderInfo(this.orderId); if (!base.IsPostBack) { if (string.IsNullOrEmpty(this.orderId)) { base.GotoResourceNotFound(); } else { this.hdfOrderID.Value = this.orderId; this.litOrderDate.Text = this.order.OrderDate.ToString("yyyy-MM-dd HH:mm:ss"); if (this.order.PayDate.HasValue) { this.litPayDate.Text = DateTime.Parse(this.order.PayDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.ShippingDate.HasValue) { this.litShippingDate.Text = DateTime.Parse(this.order.ShippingDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.FinishDate.HasValue) { this.litFinishDate.Text = DateTime.Parse(this.order.FinishDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } this.lblOrderStatus.OrderStatusCode = this.order.DeleteBeforeState; switch (this.order.DeleteBeforeState) { case OrderStatus.WaitBuyerPay: this.ProcessClass2 = "active"; break; case OrderStatus.BuyerAlreadyPaid: this.ProcessClass2 = "ok"; this.ProcessClass3 = "active"; break; case OrderStatus.SellerAlreadySent: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "active"; break; case OrderStatus.Finished: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "ok"; break; } this.litRemark.Text = this.order.Remark; string orderId = this.order.OrderId; string orderMarking = this.order.OrderMarking; if (!string.IsNullOrEmpty(orderMarking)) { orderId = orderId + " (" + this.order.PaymentType + "流水号:" + orderMarking + ")"; } this.litOrderId.Text = orderId; this.litUserName.Text = this.order.Username; this.litPayType.Text = this.order.PaymentType; this.litShipToDate.Text = this.order.ShipToDate; this.litRealName.Text = this.order.ShipTo; this.litUserTel.Text = string.IsNullOrEmpty(this.order.CellPhone) ? this.order.TelPhone : this.order.CellPhone; this.litShippingRegion.Text = this.order.ShippingRegion; this.litFreight.Text = Globals.FormatMoney(this.order.AdjustedFreight); if (this.order.ReferralUserId == 0) { this.litSiteName.Text = "主站"; } else { DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (distributorInfo != null) { this.litSiteName.Text = distributorInfo.StoreName; } } StringBuilder builder = new StringBuilder(); if (!string.IsNullOrEmpty(this.order.ActivitiesName)) { this.otherDiscountPrice += this.order.DiscountAmount; builder.Append("<p>" + this.order.ActivitiesName + ":¥" + this.order.DiscountAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.ReducedPromotionName)) { this.otherDiscountPrice += this.order.ReducedPromotionAmount; builder.Append("<p>" + this.order.ReducedPromotionName + ":¥" + this.order.ReducedPromotionAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.CouponName)) { this.otherDiscountPrice += this.order.CouponAmount; builder.Append("<p>" + this.order.CouponName + ":¥" + this.order.CouponAmount.ToString("F2") + "</p>"); } if (!string.IsNullOrEmpty(this.order.RedPagerActivityName)) { this.otherDiscountPrice += this.order.RedPagerAmount; builder.Append("<p>" + this.order.RedPagerActivityName + ":¥" + this.order.RedPagerAmount.ToString("F2") + "</p>"); } if (this.order.PointToCash > 0M) { this.otherDiscountPrice += this.order.PointToCash; builder.Append("<p>积分抵现:¥" + this.order.PointToCash.ToString("F2") + "</p>"); } this.order.GetAdjustCommssion(); decimal num3 = 0M; decimal num4 = 0M; foreach (LineItemInfo info2 in this.order.LineItems.Values) { if (info2.IsAdminModify) { num3 += info2.ItemAdjustedCommssion; } else { num4 += info2.ItemAdjustedCommssion; } } if (num3 != 0M) { if (num3 > 0M) { builder.Append("<p>管理员调价减:¥" + num3.ToString("F2") + "</p>"); } else { builder.Append("<p>管理员调价加:¥" + ((num3 * -1M)).ToString("F2") + "</p>"); } } if (num4 != 0M) { if (num4 > 0M) { builder.Append("<p>分销商调价减:¥" + num4.ToString("F2") + "</p>"); } else { builder.Append("<p>分销商调价加:¥" + ((num4 * -1M)).ToString("F2") + "</p>"); } } this.litActivityShow.Text = builder.ToString(); if (((int)this.lblOrderStatus.OrderStatusCode) != 4) { this.lbCloseReason.Visible = false; } else { this.divOrderProcess.Visible = false; this.lbReason.Text = this.order.CloseReason; } if ((((this.order.OrderStatus == OrderStatus.SellerAlreadySent) || (this.order.OrderStatus == OrderStatus.Finished)) || (this.order.OrderStatus == OrderStatus.Deleted)) && !string.IsNullOrEmpty(this.order.ExpressCompanyAbb)) { this.pLoginsticInfo.Visible = true; if ((Express.GetExpressType() == "kuaidi100") && (this.power != null)) { this.power.Visible = true; } } this.BindRemark(this.order); this.ddlpayment.DataBind(); this.ddlpayment.SelectedValue = new int?(this.order.PaymentTypeId); this.rptItemList.DataSource = this.order.LineItems.Values; this.rptItemList.DataBind(); string oldAddress = this.order.OldAddress; string str7 = string.Empty; if (!string.IsNullOrEmpty(this.order.ShippingRegion)) { str7 = this.order.ShippingRegion.Replace((char)0xff0c, ' '); } if (!string.IsNullOrEmpty(this.order.Address)) { str7 = str7 + this.order.Address; } if (!string.IsNullOrEmpty(this.order.ShipTo)) { str7 = str7 + ", " + this.order.ShipTo; } if (!string.IsNullOrEmpty(this.order.TelPhone)) { str7 = str7 + ", " + this.order.TelPhone; } if (!string.IsNullOrEmpty(this.order.CellPhone)) { str7 = str7 + ", " + this.order.CellPhone; } if (string.IsNullOrEmpty(oldAddress)) { this.lblOriAddress.Text = str7; this.pNewAddress.Visible = false; } else { this.lblOriAddress.Text = oldAddress; this.litAddress.Text = str7; } if (((this.order.OrderStatus == OrderStatus.Finished) || (this.order.OrderStatus == OrderStatus.SellerAlreadySent)) || (this.order.OrderStatus == OrderStatus.Deleted)) { string realModeName = this.order.RealModeName; if (string.IsNullOrEmpty(realModeName)) { realModeName = this.order.ModeName; } this.litModeName.Text = realModeName; this.litShipOrderNumber.Text = this.order.ShipOrderNumber; } else { this.litModeName.Text = this.order.ModeName; } if (!string.IsNullOrEmpty(this.order.ExpressCompanyName)) { this.litCompanyName.Text = this.order.ExpressCompanyName; this.hdCompanyCode.Value = this.order.ExpressCompanyAbb; } MemberInfo member = MemberProcessor.GetMember(this.order.UserId, true); if (member != null) { if (!string.IsNullOrEmpty(member.OpenId)) { this.litWeiXinNickName.Text = member.UserName; } if (!string.IsNullOrEmpty(member.UserBindName)) { this.litUserName.Text = member.UserBindName; } } if (this.order.ReferralUserId > 0) { builder = new StringBuilder(); builder.Append("<div class=\"commissionInfo mb20\"><h3>佣金信息</h3><div class=\"commissionInfoInner\">"); decimal num5 = 0M; decimal totalCommssion = 0M; decimal secondTotalCommssion = 0M; decimal thirdTotalCommssion = 0M; if (this.order.OrderStatus != OrderStatus.Closed) { totalCommssion = this.order.GetTotalCommssion(); secondTotalCommssion = this.order.GetSecondTotalCommssion(); thirdTotalCommssion = this.order.GetThirdTotalCommssion(); } num5 += totalCommssion; string storeName = string.Empty; DistributorsInfo info4 = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (info4 != null) { storeName = info4.StoreName; if ((this.order.ReferralPath != null) && (this.order.ReferralPath.Length > 0)) { string[] strArray = this.order.ReferralPath.Trim().Split(new char[] { '|' }); int distributorid = 0; if (strArray.Length > 1) { distributorid = Globals.ToNum(strArray[0]); if (distributorid > 0) { info4 = DistributorsBrower.GetDistributorInfo(distributorid); if (info4 != null) { num5 += thirdTotalCommssion; builder.Append("<p class=\"mb5\"><span>上二级分销商:</span> " + info4.StoreName + "<i> ¥" + thirdTotalCommssion.ToString("F2") + "</i></p>"); } } distributorid = Globals.ToNum(strArray[1]); if (distributorid > 0) { info4 = DistributorsBrower.GetDistributorInfo(distributorid); if (info4 != null) { num5 += secondTotalCommssion; builder.Append("<p class=\"mb5\"><span>上一级分销商:</span> " + info4.StoreName + "<i> ¥" + secondTotalCommssion.ToString("F2") + "</i></p>"); } } } else if (strArray.Length == 1) { distributorid = Globals.ToNum(strArray[0]); if (distributorid > 0) { info4 = DistributorsBrower.GetDistributorInfo(distributorid); if (info4 != null) { builder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); num5 += secondTotalCommssion; builder.Append("<p class=\"mb5\"><span>上一级分销商:</span>" + info4.StoreName + " <i> ¥" + secondTotalCommssion.ToString("F2") + "</i></p>"); } } } } else { builder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); builder.Append("<p class=\"mb5\"><span>上一级分销商:</span>-</p>"); } } builder.Append("<div class=\"clearfix\">"); if (num4 > 0M) { string str10 = " (改价让利¥" + num4.ToString("F2") + ")"; string[] strArray10 = new string[] { "<p><span>成交店铺:</span> ", storeName, " <i>¥", (totalCommssion - num4).ToString("F2"), "</i>", str10, "</p>" }; builder.Append(string.Concat(strArray10)); builder.Append("<p><span>佣金总额:</span><i>¥" + ((num5 - num4)).ToString("F2") + "</i></p>"); } else { builder.Append("<p><span>成交店铺:</span> " + storeName + " <i>¥" + totalCommssion.ToString("F2") + "</i></p>"); builder.Append("<p><span>佣金总额:</span><i>¥" + num5.ToString("F2") + "</i></p>"); } builder.Append("</div></div></div>"); this.litCommissionInfo.Text = builder.ToString(); } DataTable orderItemsReFundByOrderID = RefundHelper.GetOrderItemsReFundByOrderID(this.orderId); if (orderItemsReFundByOrderID.Rows.Count > 0) { this.rptRefundList.DataSource = orderItemsReFundByOrderID; this.rptRefundList.DataBind(); } } } } }
public void LoadControl() { string shippingRegion = string.Empty; if (!string.IsNullOrEmpty(this.PurchaseOrder.ShippingRegion)) { shippingRegion = this.PurchaseOrder.ShippingRegion; } if (!string.IsNullOrEmpty(this.PurchaseOrder.Address)) { shippingRegion = shippingRegion + this.PurchaseOrder.Address; } if (!string.IsNullOrEmpty(this.PurchaseOrder.ZipCode)) { shippingRegion = shippingRegion + "," + this.PurchaseOrder.ZipCode; } if (!string.IsNullOrEmpty(this.PurchaseOrder.ShipTo)) { shippingRegion = shippingRegion + "," + this.PurchaseOrder.ShipTo; } if (!string.IsNullOrEmpty(this.PurchaseOrder.TelPhone)) { shippingRegion = shippingRegion + "," + this.PurchaseOrder.TelPhone; } if (!string.IsNullOrEmpty(this.PurchaseOrder.CellPhone)) { shippingRegion = shippingRegion + "," + this.PurchaseOrder.CellPhone; } this.lblShipAddress.Text = shippingRegion; this.litShipToDate.Text = this.PurchaseOrder.ShipToDate; if ((this.PurchaseOrder.PurchaseStatus == OrderStatus.Finished) || (this.PurchaseOrder.PurchaseStatus == OrderStatus.SellerAlreadySent)) { this.litModeName.Text = this.PurchaseOrder.RealModeName; this.ltrShipNum.Text = " 物流单号:" + this.PurchaseOrder.ShipOrderNumber; } else { this.litModeName.Text = this.PurchaseOrder.ModeName; } if (!string.IsNullOrEmpty(this.purchaseOrder.ExpressCompanyName)) { this.litCompanyName.Text = this.purchaseOrder.ExpressCompanyName; this.tr_company.Visible = true; } this.txtRemark.Text = Globals.HtmlDecode(this.PurchaseOrder.Remark); this.lblPurchaseDate.Time = this.PurchaseOrder.PurchaseDate; if ((this.purchaseOrder.PurchaseStatus == OrderStatus.WaitBuyerPay) || (this.purchaseOrder.PurchaseStatus == OrderStatus.BuyerAlreadyPaid)) { this.btnSaveRemark.Enabled = true; } else { this.btnSaveRemark.Enabled = false; } if (((this.PurchaseOrder.PurchaseStatus == OrderStatus.SellerAlreadySent) || (this.PurchaseOrder.PurchaseStatus == OrderStatus.Finished)) && !string.IsNullOrEmpty(this.PurchaseOrder.ExpressCompanyAbb)) { if (this.plExpress != null) { this.plExpress.Visible = true; } if ((Express.GetExpressType() == "kuaidi100") && (this.power != null)) { this.power.Visible = true; } } }
protected void Page_Load(object sender, System.EventArgs e) { if (Globals.RequestQueryStr("type") == "saveorders") { this.type = "saveorders"; } string text = Globals.RequestFormStr("posttype"); this.orderIds = Globals.RequestQueryStr("OrderId").Trim(new char[] { ',' }); if (string.IsNullOrEmpty(this.ReUrl)) { this.ReUrl = "manageorder.aspx"; } string a; if ((a = text) != null) { if (a == "saveorders") { string text2 = Globals.RequestFormStr("data"); base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"指定物流失败!\"}"; JArray jArray = (JArray)JsonConvert.DeserializeObject(text2); string text3 = string.Empty; if (jArray != null) { if (jArray.Count > 1) { text3 = "批量"; } bool flag = true; using (System.Collections.Generic.IEnumerator <JToken> enumerator = jArray.GetEnumerator()) { while (enumerator.MoveNext()) { JObject jObject = (JObject)enumerator.Current; if (!this.CheckOrderCompany(jObject["orderid"].ToString(), jObject["companycode"].ToString(), jObject["compname"].ToString(), jObject["shipordernumber"].ToString())) { flag = false; } } } if (flag) { using (System.Collections.Generic.IEnumerator <JToken> enumerator2 = jArray.GetEnumerator()) { while (enumerator2.MoveNext()) { JObject jObject2 = (JObject)enumerator2.Current; OrderHelper.UpdateOrderCompany(jObject2["orderid"].ToString(), jObject2["companycode"].ToString(), jObject2["compname"].ToString(), jObject2["shipordernumber"].ToString()); } } s = "{\"type\":\"1\",\"tips\":\"" + text3 + "指定物流成功!\"}"; } else { s = "{\"type\":\"0\",\"tips\":\"" + text3 + "指定物流失败,请检测数据的正确性!\"}"; } } base.Response.Write(s); base.Response.End(); return; } if (a == "saveoneorders") { string text2 = Globals.RequestFormStr("data"); base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"指定物流失败!\"}"; JArray jArray = (JArray)JsonConvert.DeserializeObject(text2); string text3 = string.Empty; if (jArray != null) { bool flag2 = true; string shipNumber = "1111111111"; using (System.Collections.Generic.IEnumerator <JToken> enumerator3 = jArray.GetEnumerator()) { while (enumerator3.MoveNext()) { JObject jObject3 = (JObject)enumerator3.Current; if (!this.CheckOrderCompany(jObject3["orderid"].ToString(), jObject3["companycode"].ToString(), jObject3["compname"].ToString(), shipNumber)) { flag2 = false; } } } if (flag2) { using (System.Collections.Generic.IEnumerator <JToken> enumerator4 = jArray.GetEnumerator()) { while (enumerator4.MoveNext()) { JObject jObject4 = (JObject)enumerator4.Current; OrderHelper.UpdateOrderCompany(jObject4["orderid"].ToString(), jObject4["companycode"].ToString(), jObject4["compname"].ToString(), ""); } } s = "{\"type\":\"1\",\"tips\":\"" + text3 + "指定物流成功!\"}"; } else { s = "{\"type\":\"0\",\"tips\":\"" + text3 + "指定物流失败,请检测数据的正确性!\"}"; } } base.Response.Write(s); base.Response.End(); return; } if (a == "sendorders") { string text2 = Globals.RequestFormStr("data"); base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"发货失败!\"}"; JArray jArray = (JArray)JsonConvert.DeserializeObject(text2); string text3 = string.Empty; if (jArray != null) { if (jArray.Count > 1) { text3 = "批量"; } bool flag3 = true; using (System.Collections.Generic.IEnumerator <JToken> enumerator5 = jArray.GetEnumerator()) { while (enumerator5.MoveNext()) { JObject jObject5 = (JObject)enumerator5.Current; if (!this.CheckOrderCompany(jObject5["orderid"].ToString(), jObject5["companycode"].ToString(), jObject5["compname"].ToString(), jObject5["shipordernumber"].ToString())) { flag3 = false; } } } if (flag3) { int num = 0; using (System.Collections.Generic.IEnumerator <JToken> enumerator6 = jArray.GetEnumerator()) { while (enumerator6.MoveNext()) { JObject jObject6 = (JObject)enumerator6.Current; OrderInfo orderInfo = OrderHelper.GetOrderInfo(jObject6["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(jObject6["shipordernumber"].ToString().Trim()) && jObject6["shipordernumber"].ToString().Trim().Length <= 30) { orderInfo.ExpressCompanyAbb = jObject6["companycode"].ToString(); orderInfo.ExpressCompanyName = jObject6["compname"].ToString(); orderInfo.ShipOrderNumber = jObject6["shipordernumber"].ToString(); if (OrderHelper.SendGoods(orderInfo)) { Express.SubscribeExpress100(jObject6["companycode"].ToString(), jObject6["shipordernumber"].ToString()); SendNoteInfo sendNoteInfo = new SendNoteInfo(); sendNoteInfo.NoteId = Globals.GetGenerateId() + num; sendNoteInfo.OrderId = jObject6["orderid"].ToString(); sendNoteInfo.Operator = ManagerHelper.GetCurrentManager().UserName; sendNoteInfo.Remark = "后台" + sendNoteInfo.Operator + "发货成功"; OrderHelper.SaveSendNote(sendNoteInfo); 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 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"); } } if (orderInfo.Gateway == "hishop.plugins.payment.weixinrequest") { SiteSettings masterSettings = SettingsManager.GetMasterSettings(false); PayClient payClient; if (masterSettings.EnableSP) { payClient = new PayClient(masterSettings.Main_AppId, masterSettings.WeixinAppSecret, masterSettings.Main_Mch_ID, masterSettings.Main_PayKey, true, masterSettings.WeixinAppId, masterSettings.WeixinPartnerID); } else { payClient = new PayClient(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, masterSettings.WeixinPartnerID, masterSettings.WeixinPartnerKey, false, "", ""); } payClient.DeliverNotify(new DeliverInfo { TransId = orderInfo.GatewayOrderId, OutTradeNo = orderInfo.OrderId, OpenId = MemberHelper.GetMember(orderInfo.UserId).OpenId }); } } orderInfo.OnDeliver(); num++; } } } } if (num == 0) { s = "{\"type\":\"0\",\"tips\":\"" + text3 + "发货失败!\"}"; } else { s = string.Concat(new object[] { "{\"type\":\"1\",\"tips\":\"", text3, "发货成功!发货数量", num, "个\"}" }); } } else { s = "{\"type\":\"0\",\"tips\":\"" + text3 + "发货失败,请检测数据的正确性!\"}"; } } base.Response.Write(s); base.Response.End(); return; } if (a == "getcompany") { base.Response.ContentType = "application/json"; string text2 = "[{\"type\":\"0\",\"data\":[]}]"; System.Collections.Generic.IList <ExpressCompanyInfo> allExpress = ExpressHelper.GetAllExpress(); int num2 = 0; System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); foreach (ExpressCompanyInfo current in allExpress) { if (num2 == 0) { stringBuilder.Append(string.Concat(new string[] { "{\"code\":\"", SendOrderGoods.String2Json(current.Kuaidi100Code), "\",\"name\":\"", SendOrderGoods.String2Json(current.Name), "\"}" })); } else { stringBuilder.Append(string.Concat(new string[] { ",{\"code\":\"", SendOrderGoods.String2Json(current.Kuaidi100Code), "\",\"name\":\"", SendOrderGoods.String2Json(current.Name), "\"}" })); } num2++; } if (!string.IsNullOrEmpty(stringBuilder.ToString())) { text2 = "[{\"type\":\"1\",\"data\":[" + stringBuilder.ToString() + "]}]"; } base.Response.Write(text2); base.Response.End(); return; } } if (string.IsNullOrEmpty(this.orderIds)) { base.GotoResourceNotFound(); return; } string[] array = this.orderIds.Split(new char[] { ',' }); bool flag4 = true; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string lstr = array2[i]; if (!Globals.IsOrdersID(lstr)) { flag4 = false; break; } } if (flag4) { System.Data.DataSet ordersByOrderIDList = OrderHelper.GetOrdersByOrderIDList(this.orderIds); this.rptItemList.DataSource = ordersByOrderIDList; this.rptItemList.DataBind(); this.litOrdersCount.Text = ordersByOrderIDList.Tables[0].Rows.Count.ToString(); return; } base.Response.Write("非法参数请求!"); base.Response.End(); }
/// <summary> /// 新增并返回实体 /// </summary> /// <returns>操作影响的行数</returns> public Express InsertReturnEntity(Express entity) { return(_repository.InsertReturnEntity(entity)); }
/// <summary> /// 默认Relationship值是And /// </summary> public FilterInfo(string field, object value, Express express) { Field = field; Value = value; Express = express; }
public Task <Express> InsertReturnEntityAsync(Express entity) { return(_repository.InsertReturnEntityAsync(entity)); }