📄 backconsignment.aspx.cs
字号:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using Shop.Web.UI;
namespace YXShop.Web.Admin.Orders
{
public partial class backConsignment : System.Web.UI.Page
{
public static string orderId = "";
private static decimal orderPrice = 0;
private static decimal remiPrice = 0;
private static decimal paymPrice = 0;
private static decimal prepPrice = 0;
YXShop.BLL.Orders bll = new YXShop.BLL.Orders();
YXShop.BLL.YXShop_Deliver deliBll = new YXShop.BLL.YXShop_Deliver();
YXShop.BLL.Consignment consBll = new YXShop.BLL.Consignment();
YXShop.BLL.RemittanceInfo Remibll = new YXShop.BLL.RemittanceInfo();//银行支付
YXShop.BLL.PaymentMoney paymbll = new YXShop.BLL.PaymentMoney();//现金支付
YXShop.BLL.PrepayMoney prepbll = new YXShop.BLL.PrepayMoney();//预付款支付
BasePage bp = null;
protected void Page_Load(object sender, EventArgs e)
{
//是不是管理员
if (!PowerTree.PowerPass.isPass("006002012", PowerTree.PowerPanel.PowerType.other))
{
bp = new BasePage();
bp.PageError("对不起,你没有操作客户退货的权限!", "../index.aspx");
}
saveInfo.Attributes.Add("onclick", "confirm('你确定录人退货信息吗?')");
if ((!IsPostBack) || ((Request["Event"] != null) && (Request["Event"] != "")))
{
//初始化信息(订单信息,银行信息,支付信息)
if (!string.IsNullOrEmpty(Request.QueryString["OrderID"]))
{
//bindOrderInfo(YXShop.Common.WebUtility.replaceStr(Request.QueryString["OrderID"]));
orderId = YXShop.Common.WebUtility.replaceStr(Request.QueryString["OrderID"]);
bindOrderInfo(orderId);
}
else
{
Response.Redirect("orderList.aspx");
}
}
}
/// <summary>
/// 绑定订单数据及其它
/// </summary>
/// <param name="orderID"></param>
private void bindOrderInfo(string orderID)
{
List<YXShop.Model.Orders> li = bll.GetListByColumn("OrderID", orderID);
YXShop.Model.RemittanceInfo bankModel = Remibll.GetModel(orderId);
YXShop.Model.PaymentMoney paymModel = paymbll.GetModel(orderId);
YXShop.Model.PrepayMoney prepModel = prepbll.GetModel(orderId);
if (li.Count == 1)
{
orderPrice = Convert.ToDecimal(li[0].FactPrice);
remiPrice = Convert.ToDecimal(bankModel != null ? bankModel.RemittanceMoney : 0);
paymPrice = Convert.ToDecimal(paymModel != null ? paymModel.GatheringMoney : 0);
prepPrice = Convert.ToDecimal(prepModel != null ? prepModel.PayoutMoney : 0);
int UserID = Convert.ToInt32(li[0].UserId);
Label1.Text = UserReal(UserID);
myuser.Text = UserName(UserID);
myuser.NavigateUrl = "~/Admin/Consumer/MemberInfo.aspx?Pro_ID=" + UserID;
Label3.Text = li[0].OrderId;
Label4.Text = orderPrice.ToString();
Label5.Text = (remiPrice + paymPrice + prepPrice).ToString();//已经支付
Label6.Text = li[0].ConsigneeRealName;
Label7.Text = this.Deliver(Convert.ToInt32(li[0].Courier));
TextBox2.Text = li[0].Remark;
TextBox7.Text = Session["AdminName"].ToString();
}
}
#region 客户信息查询
protected string UserName(int UserID)
{
string str = "";
YXShop.BLL.UserCommon ucBll = new YXShop.BLL.UserCommon();
List<YXShop.Model.UserCommon> ucList = ucBll.GetListByColumn("UID", UserID);
if (ucList.Count > 0)
{
str = ucList[0].UserName;
}
return str;
}
protected string UserReal(int UserID)
{
string str = "";
YXShop.BLL.MemberInfo data = new YXShop.BLL.MemberInfo();
List<YXShop.Model.MemberInfo> dataStr = data.GetListByColumn("UID", UserID);
if (dataStr.Count > 0)
{
str = dataStr[0].cTrueName;
}
return str;
}
#endregion
#region 配送方式
protected string Deliver(int id)
{
List<YXShop.Model.YXShop_Deliver> data = deliBll.GetList(" D_ID=" + id + "");
if (data.Count > 0)
{
return data[0].D_Name;
}
return string.Empty;
}
#endregion
protected void saveInfo_Click(object sender, EventArgs e)
{
#region 退货信息
YXShop.Model.Consignment consModel = new YXShop.Model.Consignment();
consModel.OrderID = Label3.Text;
consModel.UserName = myuser.Text;
consModel.ConsignmentDate = getMoneyDate.Date;
consModel.ConsignmentPeople = Label6.Text;
consModel.Remark = YXShop.Common.WebUtility.replaceStr(TextBox2.Text.Trim()) == string.Empty ? "给订单退货。订单号:" + orderId + "" : YXShop.Common.WebUtility.replaceStr(TextBox2.Text.Trim());
consModel.NoteDate = DateTime.Now;
consModel.NoteName = Session["AdminName"].ToString();
consModel.Received = YXShop.Common.StatuEnum.OgisticsStatus.配送中.GetHashCode();
consModel.ConsignmentType = 1;//退货
consModel.ExpressCompany = "";
consModel.ExpressOddNumbers = "";
consModel.BosomNote = YXShop.Common.WebUtility.replaceStr(TextBox5.Text);
consModel.InformMode = "";
#endregion
try
{
consBll.Add(consModel);
bll.UpdateOrders("OgisticsStatus", YXShop.Common.StatuEnum.OgisticsStatus.配送中.GetHashCode(), orderId);
}
catch(Exception ex)
{
Response.Redirect("../Succeed/ErrorOrder.aspx?Key=" + ex.Message + "&OrderId=" + orderId + "");
}
finally
{
Response.Redirect("../Succeed/SueeccdOrder.aspx?Key=退货&OrderId=" + orderId + "");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -