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/CRMClientInfoAdapter.aspx.cs

157 lines
6.0 KiB
C#

2 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 CRMClientInfoAdapter : System.Web.UI.Page
{
private string strCodename = "";
private string strShortname = "";
private string strGID = "";
private string strPortName = "";
private string strDESCRIPTION = "";
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["handle"] != null)
{
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["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() == "codename")
{
T_ALL_DA T_ALL_DA = new T_ALL_DA();
DataSet DS = T_ALL_DA.GetAllSQL("select * from crm_info_client where codename='" + strCodename + "'");
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 crm_info_client where shortname='" + strShortname + "'");
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 crm_info_client where DESCRIPTION='" + strDESCRIPTION + "'");
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);
}
}
}