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.
DS7/DSWeb/FeeCodes/CUSTOMERNAMEGIDAdapter.aspx.cs

317 lines
13 KiB
C#

3 years 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 CUSTOMERNAMEGIDAdapter : System.Web.UI.Page
{
private string strSHORTNAME = "";
private string strCodename = "";
private string strShortname = "";
private string strLoginname = "";
private string strGID = "";
private string strPortName = "";
private string strLoginname2 = "";
private string strEMAIL = "";
private string strDESCRIPTION = "";
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["handle"] != null)
{
if (Request.QueryString["CUSTOMERNAME"] != null)
{
UnicodeEncoding unicode = new UnicodeEncoding();
strSHORTNAME = unicode.GetString(unicode.GetBytes(Request.QueryString["CUSTOMERNAME"].ToString()));
}
if (Request.QueryString["gid"] != null)
{
UnicodeEncoding unicode = new UnicodeEncoding();
strGID = Request.QueryString["gid"].ToString();
}
if (Request.QueryString["codename"] != null)
{
UnicodeEncoding unicode = new UnicodeEncoding();
strCodename = unicode.GetString(unicode.GetBytes(Request.QueryString["codename"].ToString()));
}
if (Request.QueryString["shortname"] != null)
{
UnicodeEncoding unicode = new UnicodeEncoding();
strShortname = unicode.GetString(unicode.GetBytes(Request.QueryString["shortname"].ToString()));
}
if (Request.QueryString["loginname"] != null)
{
UnicodeEncoding unicode = new UnicodeEncoding();
strLoginname = unicode.GetString(unicode.GetBytes(Request.QueryString["loginname"].ToString()));
}
if (Request.QueryString["loginname2"] != null)
{
UnicodeEncoding unicode = new UnicodeEncoding();
strLoginname2 = unicode.GetString(unicode.GetBytes(Request.QueryString["loginname2"].ToString()));
}
if (Request.QueryString["email"] != null)
{
UnicodeEncoding unicode = new UnicodeEncoding();
strEMAIL = unicode.GetString(unicode.GetBytes(Request.QueryString["email"].ToString()));
}
if (Request.QueryString["description"] != null)
{
UnicodeEncoding unicode = new UnicodeEncoding();
strDESCRIPTION = unicode.GetString(unicode.GetBytes(Request.QueryString["description"].ToString()));
}
//
string shandle = Request.QueryString["handle"].ToString().Trim();
if (shandle.Trim() == "gid")
{
if (strSHORTNAME != "" && strSHORTNAME != "null")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
strPortName = T_ALL_DA.GetStrSQL("GID", "select GID from info_client where SHORTNAME='" + strSHORTNAME + "' and ISSTOP=0");
}
}
else if (shandle.Trim() == "opname")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet DS = T_ALL_DA.GetAllSQL("select * from info_client where DESCRIPTION='" + strSHORTNAME + "' and ISSTOP=0");
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
string sGID = DS.Tables[0].Rows[0]["GID"].ToString();
if (sGID.Trim() == strGID.Trim())
{
strPortName = "";
}
else
{
strPortName = DS.Tables[0].Rows[0]["OPNAME"].ToString();
if (strPortName == "")
{
strPortName = "系统管理员";
}
}
}
else
{
strPortName = "";
}
}
else
{
strPortName = "";
}
}
else if (shandle.Trim() == "codename")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet DS = T_ALL_DA.GetAllSQL("select * from info_client where codename='" + strCodename + "' and ISSTOP=0");
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
string sGID = DS.Tables[0].Rows[0]["GID"].ToString();
if (sGID.Trim() == strGID.Trim())
{
strPortName = "";
}
else
{
strPortName = DS.Tables[0].Rows[0]["OPNAME"].ToString();
if (strPortName == "")
{
strPortName = "系统管理员";
}
}
}
else
{
strPortName = "";
}
}
else
{
strPortName = "";
}
}
else if (shandle.Trim() == "shortname")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet DS = T_ALL_DA.GetAllSQL("select * from info_client where shortname='" + strShortname + "' and ISSTOP=0");
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
string sGID = DS.Tables[0].Rows[0]["GID"].ToString();
if (sGID.Trim() == strGID.Trim())
{
strPortName = "";
}
else
{
strPortName = DS.Tables[0].Rows[0]["OPNAME"].ToString();
if (strPortName == "")
{
strPortName = "系统管理员";
}
}
}
else
{
strPortName = "";
}
}
else
{
strPortName = "";
}
}
else if (shandle.Trim() == "loginname")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet DS = T_ALL_DA.GetAllSQL("select * from info_client where loginname='" + strLoginname + "' and ISSTOP=0");
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
string sGID = DS.Tables[0].Rows[0]["GID"].ToString();
if (sGID.Trim() == strGID.Trim())
{
strPortName = "";
}
else
{
strPortName = DS.Tables[0].Rows[0]["OPNAME"].ToString();
if (strPortName == "")
{
strPortName = "系统管理员";
}
}
}
else
{
strPortName = "";
}
}
else
{
strPortName = "";
}
}
else if (shandle.Trim() == "loginname2")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet DS = T_ALL_DA.GetAllSQL("select * from info_client where loginname='" + strLoginname2 + "' and ISSTOP=0");
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
string sGID = DS.Tables[0].Rows[0]["GID"].ToString();
if (sGID.Trim() == strGID.Trim())
{
strPortName = "";
}
else
{
strPortName = DS.Tables[0].Rows[0]["OPNAME"].ToString();
if (strPortName == "")
{
strPortName = "系统管理员";
}
}
}
else
{
strPortName = "";
}
}
else
{
strPortName = "";
}
}
else if (shandle.Trim() == "email")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet DS = T_ALL_DA.GetAllSQL("select * from info_client where email='" + strEMAIL + "' and ISSTOP=0");
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
string sGID = DS.Tables[0].Rows[0]["GID"].ToString();
if (sGID.Trim() == strGID.Trim())
{
strPortName = "";
}
else
{
strPortName = DS.Tables[0].Rows[0]["OPNAME"].ToString();
if (strPortName == "")
{
strPortName = "系统管理员";
}
}
}
else
{
strPortName = "";
}
}
else
{
strPortName = "";
}
}
else if (shandle.Trim() == "description")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet DS = T_ALL_DA.GetAllSQL("select * from info_client where DESCRIPTION='" + strDESCRIPTION + "' and ISSTOP=0");
if (DS != null)
{
if (DS.Tables[0].Rows.Count > 0)
{
string sGID = DS.Tables[0].Rows[0]["GID"].ToString();
if (sGID.Trim() == strGID.Trim())
{
strPortName = "";
}
else
{
strPortName = DS.Tables[0].Rows[0]["OPNAME"].ToString();
if (strPortName == "")
{
strPortName = "系统管理员";
}
}
}
else
{
strPortName = "";
}
}
else
{
strPortName = "";
}
}
}
Response.Write(strPortName);
}
}
}