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.
129 lines
4.9 KiB
C#
129 lines
4.9 KiB
C#
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 CodeCountrySetAdapter : System.Web.UI.Page
|
|
{
|
|
private string strMark;
|
|
private string strPos;
|
|
private int iPos = 0;
|
|
public string strTYPE = "";
|
|
UnicodeEncoding unicode = new UnicodeEncoding();
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
string strPost = Request.Url.ToString();
|
|
|
|
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["type"] != null)
|
|
{
|
|
strTYPE = unicode.GetString(unicode.GetBytes(Request.QueryString["type"].ToString()));
|
|
if (strTYPE.Trim().Equals("chau"))
|
|
{
|
|
XmlDocument xmldoc = new XmlDocument();
|
|
Response.ContentType = "text/xml";
|
|
string content = getCHAU();
|
|
try
|
|
{
|
|
xmldoc.LoadXml(content);
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
Response.Write(xmldoc.OuterXml.ToString());
|
|
}
|
|
else if (strTYPE.Trim().Equals("guo"))
|
|
{
|
|
XmlDocument xmldoc = new XmlDocument();
|
|
Response.ContentType = "text/xml";
|
|
string content = getGUO();
|
|
try
|
|
{
|
|
xmldoc.LoadXml(content);
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
Response.Write(xmldoc.OuterXml.ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public string getGUO()
|
|
{
|
|
StringBuilder resultBuilder = new StringBuilder();
|
|
resultBuilder.Append("<?xml version=\"1.0\" ?>");
|
|
resultBuilder.AppendFormat("<complete{0}>", iPos == 0 ? string.Empty : " add=\"true\"");
|
|
if (!string.IsNullOrEmpty(strMark))
|
|
{
|
|
T_ALL_DA T_ALL_DA = new T_ALL_DA();
|
|
DataSet ds = T_ALL_DA.GetAllSQL("SELECT * FROM code_country order by COUNTRYID");
|
|
if (ds != null)
|
|
{
|
|
foreach (DataRow dr in ds.Tables[0].Rows)
|
|
{
|
|
if (dr["COUNTRYID"].ToString().Trim() != "" || dr["COUNTRY"].ToString().Trim() != "")
|
|
{
|
|
string js = dr["COUNTRYID"].ToString().Trim() + " | " + dr["COUNTRY"].ToString().Trim();
|
|
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", dr["COUNTRYID"].ToString().Trim(), js);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", "", "");
|
|
resultBuilder.Append("</complete>");
|
|
return resultBuilder.ToString().Replace("&", "&");
|
|
}
|
|
|
|
public string getCHAU()
|
|
{
|
|
StringBuilder resultBuilder = new StringBuilder();
|
|
resultBuilder.Append("<?xml version=\"1.0\" ?>");
|
|
resultBuilder.AppendFormat("<complete{0}>", iPos == 0 ? string.Empty : " add=\"true\"");
|
|
if (!string.IsNullOrEmpty(strMark))
|
|
{
|
|
T_ALL_DA T_ALL_DA = new T_ALL_DA();
|
|
DataSet ds = T_ALL_DA.GetAllSQL("SELECT CHAU=isnull(CHAU,'') FROM code_country group by CHAU order by CHAU");
|
|
if (ds != null)
|
|
{
|
|
foreach (DataRow dr in ds.Tables[0].Rows)
|
|
{
|
|
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", dr["CHAU"].ToString().Trim(), dr["CHAU"].ToString().Trim());
|
|
}
|
|
}
|
|
}
|
|
resultBuilder.AppendFormat("<option value=\"{0}\">{1}</option>", "", "");
|
|
resultBuilder.Append("</complete>");
|
|
return resultBuilder.ToString().Replace("&", "&");
|
|
}
|
|
}
|
|
}
|