protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { hlBack.NavigateUrl = "Express.aspx?active=" + Request.QueryString["active"]; if (Request.QueryString["id"] != null) { ViewState["pk_Express"] = MojoCube.Api.Text.Security.DecryptString(Request.QueryString["id"]); MojoCube.Web.Sys.Express express = new MojoCube.Web.Sys.Express(); express.GetData(int.Parse(ViewState["pk_Express"].ToString())); txtFullName.Text = express.FullName; txtShortName.Text = express.ShortName; txtWebsite.Text = express.Website; txtFreight.Text = express.Freight.ToString("N2"); cbVisible.Checked = express.Visible; this.Title = "公司编辑:" + txtFullName.Text.Trim(); } else { cbVisible.Checked = true; this.Title = "公司编辑"; } } }
private string CreateHistory(MojoCube.Web.Order.List list) { StringBuilder sb = new StringBuilder(); sb.Append("<br/>"); sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.CreateDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 创建订单,订单编号【" + list.OrderNumber + "】<br/>"); if (list.fk_Payment > 0) { MojoCube.Web.Payment.List payment = new MojoCube.Web.Payment.List(); payment.GetData(list.fk_Payment); sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.PaymentDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 付款成功,【" + payment.Title + "】<br/>"); } if (list.ShipperCode != "") { MojoCube.Web.Sys.Express express = new MojoCube.Web.Sys.Express(); express.GetData(list.ShipperCode); sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.ShipmentDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 已发货," + express.FullName + ",运单号【" + list.LogisticCode + "】<br/>"); DataTable dt = new DataTable(); if (Session["LogisticCode_" + list.LogisticCode] != null) { dt = (DataTable)Session["LogisticCode_" + list.LogisticCode]; } else { dt = MojoCube.Web.Express.Function.GetLogisticDT(list.ShipperCode, list.LogisticCode); Session["LogisticCode_" + list.LogisticCode] = dt; } if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(dt.Rows[i]["Time"].ToString()).ToString("yyyy-MM-dd HH:mm") + "]</span> " + dt.Rows[i]["Content"].ToString() + "<br/>"); } } } if (list.StatusID == 3) { sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.EndDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 交易成功<br/>"); } if (list.StatusID == 4) { sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.CancelDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 交易关闭<br/>"); } return(sb.ToString()); }
protected void btnSave_Click(object sender, EventArgs e) { if (txtFullName.Text.Trim() == "" || txtShortName.Text.Trim() == "") { AlertDiv.InnerHtml = MojoCube.Web.String.ShowAlert("danger", "请填写公司名称和简称"); return; } MojoCube.Web.Sys.Express express = new MojoCube.Web.Sys.Express(); //修改 if (ViewState["pk_Express"] != null) { express.GetData(int.Parse(ViewState["pk_Express"].ToString())); express.FullName = txtFullName.Text.Trim(); express.ShortName = txtShortName.Text.Trim(); express.Website = txtWebsite.Text.Trim(); express.Freight = MojoCube.Web.String.ToDecimal(txtFreight.Text.Trim()); express.Visible = cbVisible.Checked; express.UpdateData(express.pk_Express); } //新增 else { express.FullName = txtFullName.Text.Trim(); express.ShortName = txtShortName.Text.Trim(); express.ImagePath = string.Empty; express.Website = txtWebsite.Text.Trim(); express.Url = string.Empty; express.Freight = MojoCube.Web.String.ToDecimal(txtFreight.Text.Trim()); express.Visible = cbVisible.Checked; express.InsertData(); } Response.Redirect("Express.aspx?active=" + Request.QueryString["active"]); }
private string CreateHistory() { MojoCube.Web.Order.List list = new MojoCube.Web.Order.List(); list.GetData(int.Parse(ViewState["pk_Order"].ToString())); if (list.fk_Member.ToString() != Session["Member_UserID"].ToString()) { Response.Redirect(MojoCube.Web.Site.Cache.GetUrlExtension("Order", strLanguage)); } lblContactName.Text = list.CustomerName; lblAddress.Text = list.CustomerAddress; lblContactPhone.Text = list.CustomerPhone1; lblRemark.Text = list.Remark; StringBuilder sb = new StringBuilder(); sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.CreateDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 创建订单,订单编号【" + list.OrderNumber + "】<br/>"); if (list.fk_Payment > 0) { MojoCube.Web.Payment.List payment = new MojoCube.Web.Payment.List(); payment.GetData(list.fk_Payment); sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.PaymentDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 付款成功,【" + payment.Title + "】<br/>"); } if (list.ShipperCode != "") { MojoCube.Web.Sys.Express express = new MojoCube.Web.Sys.Express(); express.GetData(list.ShipperCode); sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.ShipmentDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 已发货," + express.FullName + ",运单号【" + list.LogisticCode + "】<br/>"); DataTable dt = new DataTable(); if (Session["LogisticCode_" + list.LogisticCode] != null) { dt = (DataTable)Session["LogisticCode_" + list.LogisticCode]; } else { dt = MojoCube.Web.Express.Function.GetLogisticDT(list.ShipperCode, list.LogisticCode); Session["LogisticCode_" + list.LogisticCode] = dt; } if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(dt.Rows[i]["Time"].ToString()).ToString("yyyy-MM-dd HH:mm") + "]</span> " + dt.Rows[i]["Content"].ToString() + "<br/>"); } } } if (list.StatusID == 3) { sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.EndDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 交易成功<br/>"); } if (list.StatusID == 4) { sb.Append("<span style=\"font-size:8pt; color:#999; margin-left:3px;\">[" + DateTime.Parse(list.CancelDate).ToString("yyyy-MM-dd HH:mm") + "]</span> 交易关闭<br/>"); } return(sb.ToString()); }