📄 suborderinfo.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.Text;
using System.Collections.Generic;
namespace YXShop.Web.Membercenter.Orders
{
public partial class subOrderInfo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(YXShop.Web.Membercenter.Orders.subOrderInfo));
//ajax
string memberid = "";
if (Session["MemberID"] != null)
memberid = Session["MemberID"].ToString();
memberid = "2";
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("MemberID", memberid);
Response.Write(YXShop.TemplateAction.TemplateDo.GetAnalysisContent(7, 9, dic).Replace("{$ConsigneeInfo$}", this.DefaultAddress()));
}
#region 默认收货地址
protected string DefaultAddress()
{
StringBuilder shtml = new StringBuilder();
if (Session["MemberID"] != null)
{
YXShop.BLL.MemberInfo datab = new YXShop.BLL.MemberInfo();
YXShop.BLL.UserCommon comBll = new YXShop.BLL.UserCommon();
List<YXShop.Model.UserCommon> listCom = comBll.GetListByColumn("UID", Session["MemberID"]);
string userEmail = "";
if (listCom != null && listCom.Count == 1)
{
userEmail = listCom[0].UEmail;
}
List<YXShop.Model.MemberInfo> data = datab.GetListByColumn("UID", Session["MemberID"].ToString());
shtml.Append("<table width='100%' border='0'>");
shtml.Append("" + string.Format("<tr><td width='100'>收货人姓名:</td><td width='467'><input type='text' name='userName' id='userName' value='{0}'/><span id='ConsigneeName' class='fontRed'>*</span></td><td></td></tr>", data[0].cTrueName) + "");
shtml.Append("" + string.Format("<tr><td width='100'>收货人省份:</td><td>" + this.pProvinces(data[0].Province) + "<div id=\"City\">" + this.pProvinces_City(data[0].City, data[0].Province) + "</div><div id=\"City2\">" + this.pProvinces_Borough(data[0].Borough, data[0].City) + "</div></td><td></td></tr>") + "");
shtml.Append("" + string.Format("<tr><td width='100'>收货人地址:</td><td><input type='text' name='userAddr' id='userAddr' value='{0}'/></td><td><div id='ConsigneeAddress' class='fontRed'>*</div></td></tr>", data[0].cAddrInfo) + "");
shtml.Append("" + string.Format("<tr><td width='100'>收货人邮码:</td><td><input type='text' name='userZip' id='userZip' value='{0}'/></td><td></td></tr>", data[0].post) + "");
shtml.Append("" + string.Format("<tr><td width='100'>收货人电话:</td><td><input type='text' name='userPhone' id='userPhone' value='{0}'/><span id='ConsigneeTel' class='fontRed'>*</span></td><td></td></tr>", data[0].cHomePhone) + "");
shtml.Append("" + string.Format("<tr><td width='100'>收货人手机:</td><td><input type='text' name='userMobile' id='userMobile' value='{0}'/></td><td></td></tr>", data[0].cMobilePhone) + "");
shtml.Append("" + string.Format("<tr><td width='100'>收货人传真:</td><td><input type='text' name='userFax' id='userFax' value='{0}'/></td><td></td></tr>", data[0].cFaxNumber) + "");
shtml.Append("" + string.Format("<tr><td width='100'>收货人E_mail:</td><td><input type='text' name='userEmail' id='userEmail' value='{0}'/><span id='ConsigneeEMail' class='fontRed'></span></td><td></td></tr></table>", userEmail) + "");
}
else
{
shtml.Append("<table>");
shtml.Append("<tr><td width=\"100\"> 收货人姓名:</td><td width=\"467\"><input type=\"text\" name=\"userName\" id=\"userName\" value=\"\"/><span id='ConsigneeName' class='fontRed'>*</span></td><td></td></tr>");
shtml.Append("<tr><td width=\"100\">收货人省份:</td><td>" + this.Provinces() + "<div id=\"City\"><select width=\"100\"></select></div><div id=\"City2\"><select width=\"100\"></select></div></td><td></td></tr>");
shtml.Append("<tr><td width=\"100\">收货人地址:</td><td><input type=\"text\" name=\"userAddr\" id=\"userAddr\" value=\"\"/><span id='ConsigneeAddress' class='fontRed'>*</span></td><td></td></tr>");
shtml.Append(" <tr><td width=\"100\">收货人邮编:</td><td><input type=\"text\" name=\"userZip\" id=\"userZip\" value=\"\"/> </td><td></td></tr>");
shtml.Append("<tr><td width=\"100\">收货人电话:</td><td><input type=\"text\" name=\"usrPhone\" id=\"userPhone\" value=\"\"/><span id='ConsigneeTel' class='fontRed'>*</span></td><td></td></tr>");
shtml.Append("<tr><td width=\"100\">收货人手机:</td><td><input type=\"text\" name=\"userMobile\" id=\"userMobile\" value=\"\"/> </td><td></td></tr>");
shtml.Append("<tr><td width=\"100\">收货人传真:</td>");
shtml.Append("<td><input type=\"text\" name=\"userFax\" id=\"userFax\" value=\"\"/></td><td></td>");
shtml.Append("</tr>");
shtml.Append("<tr><td width=\"100\">收货人E_mail:</td><td><input type=\"text\" name=\"userEmail\" id=\"userEmail\" value=\"\"/><span id='ConsigneeEMail' class='fontRed'></span></td><td></td></tr>");
shtml.Append("</table>");
}
return shtml.ToString();
}
#endregion
#region Ajax省份
#region 省
public string Provinces()
{
StringBuilder shtml = new StringBuilder();
YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", 0);
if (data.Count > 0)
{
shtml.Append("<select id=\"Provinces\" name=\"Provinces\" onchange=\"Province(this.value)\">");
shtml.Append("<option value='' selected>--请选择--</option>");
foreach (YXShop.Model.Provinces dr in data)
{
shtml.Append("<option value=" + dr.ID + ">" + dr.Province_city + "</option> ");
}
shtml.Append("</select>");
}
return shtml.ToString();
}
#endregion
#region 城
[AjaxPro.AjaxMethod]
public string Provinces_City(string idstr)
{
StringBuilder shtml = new StringBuilder();
YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", idstr);
if (data.Count > 0)
{
shtml.Append("<select id=\"City\" name=\"City\" onchange=\"Citys(this.value)\">");
shtml.Append("<option value='' selected>--请选择--</option> ");
foreach (YXShop.Model.Provinces dr in data)
{
shtml.Append("<option value=" + dr.ID + ">" + dr.Province_city + "</option> ");
}
shtml.Append("</select>");
}
return shtml.ToString();
}
#endregion
#region 区
[AjaxPro.AjaxMethod]
public string Provinces_Borough(string idstr)
{
StringBuilder shtml = new StringBuilder();
YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", idstr);
if (data.Count > 0)
{
shtml.Append("<select id=\"borough\" name=\"borough\"");
foreach (YXShop.Model.Provinces dr in data)
{
shtml.Append("<option value=" + dr.ID + " selected>" + dr.Province_city + "</option> ");
}
shtml.Append("</select>");
}
return shtml.ToString();
}
#endregion
#endregion
#region 普通省份
#region 省
public string pProvinces(string AddressID)
{
StringBuilder shtml = new StringBuilder();
YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", 0);
if (data.Count > 0)
{
shtml.Append("<select id=\"Provinces\" name=\"Provinces\" onchange=\"Province(this.value)\">");
shtml.Append("<option value='' selected>--请选择--</option>");
foreach (YXShop.Model.Provinces dr in data)
{
if (dr.ID.ToString() == AddressID)
{
shtml.Append("<option value=" + dr.ID + " selected=\"selected\">" + dr.Province_city + "</option> ");
}
else
{
shtml.Append("<option value=" + dr.ID + ">" + dr.Province_city + "</option> ");
}
}
shtml.Append("</select>");
}
return shtml.ToString();
}
#endregion
#region 城
public string pProvinces_City(string AddressID, string idstr)
{
StringBuilder shtml = new StringBuilder();
YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", idstr);
if (data.Count > 0)
{
shtml.Append("<select id=\"City\" name=\"City\" onchange=\"Citys(this.value)\">");
shtml.Append("<option value='' selected>--请选择--</option> ");
foreach (YXShop.Model.Provinces dr in data)
{
if (dr.ID.ToString() == AddressID)
{
shtml.Append("<option value=" + dr.ID + " selected=\"selected\">" + dr.Province_city + "</option> ");
}
else
{
shtml.Append("<option value=" + dr.ID + " >" + dr.Province_city + "</option> ");
}
}
shtml.Append("</select>");
}
return shtml.ToString();
}
#endregion
#region 区
public string pProvinces_Borough(string AddressID, string idstr)
{
StringBuilder shtml = new StringBuilder();
YXShop.BLL.Provinces datab = new YXShop.BLL.Provinces();
List<YXShop.Model.Provinces> data = datab.GetListByColumn("Fid", idstr);
if (data.Count > 0)
{
shtml.Append("<select id=\"borough\" name=\"borough\"");
foreach (YXShop.Model.Provinces dr in data)
{
if (dr.ID.ToString() == AddressID)
{
shtml.Append("<option value=" + dr.ID + " selected=\"selected\">" + dr.Province_city + "</option> ");
}
else
{
shtml.Append("<option value=" + dr.ID + ">" + dr.Province_city + "</option> ");
}
}
shtml.Append("</select>");
}
return shtml.ToString();
}
#endregion
#endregion
#region Ajax选择收货地址
[AjaxPro.AjaxMethod]
public string GetLinkmanInfo(string linkmanID)
{
string str = string.Empty;
int lkID = 0;
if (YXShop.Common.WebUtility.isNumeric(linkmanID))
lkID = Convert.ToInt32(linkmanID);
YXShop.BLL.YXShop_Linkman ylinkm = new YXShop.BLL.YXShop_Linkman();
YXShop.Model.YXShop_Linkman model = ylinkm.GetModel(lkID);
if (model != null)
{
str = string.Format("<table name='linkmanInfo' id='linkmanInfo' value='{0}'>", model.cConnectId);
str += string.Format("<tr><td width='100'>收货人姓名:</td><td width='467'><input type='text' name='userName' id='userName' value='{0}'/></td><td></td></tr>", model.cConnectName);
str += string.Format("<tr><td width='100'>收货人省份:</td><td>" + this.pProvinces(model.state) + "<div id=\"City\">" + this.pProvinces_City(model.city, model.state) + "</div><div id=\"City2\">" + this.pProvinces_Borough(model.county, model.city) + "</div></td><td></td></tr>");
str += string.Format("<tr><td width='100'>收货人地址:</td><td><input type='text' name='userAddr' id='userAddr' value='{0}'/><span id='ConsigneeAddress' class='fontRed'>*</span></td><td></td></tr>", model.addr);
str += string.Format("<tr><td width='100'>收货人邮码:</td><td><input type='text' name='userZip' id='userZip' value='{0}'/></td><td></td></tr>", model.zip);
str += string.Format("<tr><td width='100'>收货人电话:</td><td><input type='text' name='userPhone' id='userPhone' value='{0}'/><span id='ConsigneeTel' class='fontRed'>*</span></td><td></td></tr>", model.cConnectPhone);
str += string.Format("<tr><td width='100'>收货人手机:</td><td><input type='text' name='userMobile' id='userMobile' value='{0}'/></td><td></td></tr>", model.cMobile);
str += string.Format("<tr><td width='100'>收货人传真:</td><td><input type='text' name='userFax' id='userFax' value='{0}'/></td></td><td></tr>", model.cConnectFax);
str += string.Format("<tr><td width='100'>收货人E_mail:</td><td><input type='text' name='userEmail' id='userEmail' value='{0}'/><span id='ConsigneeEMail' class='fontRed'></span></td><td></td></tr></table>", model.cEmail);
}
return str;
}
#endregion
#region 用户点券
[AjaxPro.AjaxMethod]
public string CheckFavourable(string password)
{
return password;
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -