You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
4.2 KiB
C#

11 months ago
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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.Xml.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Xml;
using DSWeb.Models;
using DSWeb.EntityDA;
namespace DSWeb.FeeCodes
{
public partial class BLTYPEAdapter : System.Web.UI.Page
{
private string strMark;
private string strPos;
private int iPos = 0;
public string strPortName = "0";
private string strUserID;//登录用户GID
T_ALL_DA T_ALL_DA = new T_ALL_DA();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string strPost = Request.Url.ToString();
if (Session["USERID"] != null)
{
strUserID = Session["USERID"].ToString();
}
else
{
Server.Transfer("~/Error/FriendError.aspx");
return;
//strUserID = "";
}
if (Request.QueryString["mask"] != null)
{
strMark = Request.QueryString["mask"].ToString();
}
if (Request.QueryString["pos"] != null)
{
strPos = Request.QueryString["pos"].ToString();
iPos = int.Parse(strPos);
}
if (Request.QueryString["BSNO"] != null)
{
string strBSNO = Request.QueryString["BSNO"].ToString();
getCountBSNO(strBSNO);
return;
}
if (Request.QueryString["ORDNO"] != null)
{
string strORDNO = Request.QueryString["ORDNO"].ToString();
getCountORDNO(strORDNO);
return;
}
XmlDocument docs = GetDoc();
Response.ContentType = "text/xml";
Response.Write(docs.OuterXml.ToString());
}
}
protected void getCountBSNO(string strBSNO)
{
strPortName = "0";
if (strBSNO != "" && strBSNO != "null")
{
strPortName = T_ALL_DA.GetStrSQL("scount", "select count(*) as scount from op_ctn where BSNO='" + strBSNO + "'");
}
Response.Write(strPortName);
}
protected void getCountORDNO(string strORDNO)
{
strPortName = "0";
if (strORDNO != "" && strORDNO != "null")
{
strPortName = T_ALL_DA.GetStrSQL("scount", "select count(*) as scount from crm_seaeorderctn where ORDNO='" + strORDNO + "'");
}
Response.Write(strPortName);
}
public string BuildXML()
{
StringBuilder resultBuilder = new StringBuilder();
resultBuilder.Append("<?xml version=\"1.0\" ?>");
resultBuilder.AppendFormat("<complete{0}>", iPos == 0 ? string.Empty : " add=\"true\"");
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", "整箱", "整箱");
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", "拼箱单票", "拼箱单票");
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", "拼箱主票", "拼箱主票");
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", "拼箱分票", "拼箱分票");
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", "散杂货", "散杂货");
resultBuilder.Append("</complete>");
return resultBuilder.ToString().Replace("&", "&amp;");
}
public XmlDocument GetDoc()
{
XmlDocument xmldoc = new XmlDocument();
string content = BuildXML();
try
{
xmldoc.LoadXml(content);
}
catch (Exception)
{
}
return xmldoc;
}
}
}