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/Dispatch/DAL/InfoClientDAL.cs

59 lines
3.1 KiB
C#

using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Data;
using DSWeb.SoftMng.DBUtility;
namespace DSWeb.Dispatch.DAL
{
public partial class InfoClientDAL
{
public bool Login(string uid, string password)
{
List<SqlParameter> paraList = new List<SqlParameter>();
paraList.Add(new SqlParameter("uid", uid));
paraList.Add(new SqlParameter("pass", password));
int c = DbHelperSQL.ExcuteScalarSQL("select count(1) from info_client where loginname=@uid and loginpassword=@pass", paraList.ToArray());
if (c > 0)
{
return true;
}
return false;
}
public DataSet GetModel(string uid, string password)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("select GID, CODENAME, SHORTNAME, DESCRIPTION, NAME, EnFullName, STATUS, ADDR, EMAIL, WEB, TEL, FAX, CHIEF, SALE, OP, DOC, ISCARRIER, ISBOOKING, ISYARD, ISTRUCK, ISCONTROLLER, ISCUSTOM, ISAGENT, ISAGENTCN, ISEXPRESS, ISAIRLINES, ISSHIPPER, ISCONSIGNEE, ISNOTIFYPARTY, ISWAREHOUSE, COUNTRY, PROVINCE, CITY, CORPID, BLCONTENT, ISSTOP, BillRises1, BillRises2, USDBillRises, RMBBillRises, RMBBank, RMBAccount, RMBOnlineNO, USDBank, USDAccount, USDOnlineNO, CustomAttributes1, CustomAttributes2, USDMaxAmountCredit, RMBMaxAmountCredit, MaxAmountCredit, STLNAME, OPNAME, OPTIME, REMARK, USDExchangeRate, STLDATE, STLFIRSTHALFDATE, STLMIDDLEDATE, STLDATEPJ, LEVEL, LOGINNAME, LOGINPASSWORD, QQ, MSN, MODIFIEDUSER, MODIFIEDTIME, ISWHARF, ISSHIPPINGAGENT, FARCODE, FAPCODE, ISINSURE, ISLEASING, ISTRADINGAGENCY, ISOTHER, OTHERS, UNITPRICE, REGISTRATIONNO, ORDERNO, ISENTERP, TAXNO, EDICODE, EDICODE2, EDICODE3, ORGANIZATIONCODE, PCORPNAME, InspectionNo, ISSHIPAGENCY, blstatus, ISSP, FEEFRT, RCVMode, ICOURL, BSSOURCE, INVBANK, INVADDRTEL, SALECORPID ");
strSql.Append(" from info_client ");
strSql.Append(" where loginname=@uid and loginpassword=@pass");
List<SqlParameter> paraList = new List<SqlParameter>();
paraList.Add(new SqlParameter("uid", uid));
paraList.Add(new SqlParameter("pass", password));
return DbHelperSQL.Query(strSql.ToString(), paraList.ToArray());
}
public string GetDriverInfoClientName(string driverId)
{
StringBuilder strSql = new StringBuilder();
strSql.AppendLine("select shortname");
strSql.AppendLine("from info_client i");
strSql.AppendLine("join Disp_Driver_Info_Client_Relation r oni.gid=r.infoclientid");
strSql.AppendLine("where r.driverid=@driverId");
List<SqlParameter> paraList = new List<SqlParameter>();
paraList.Add(new SqlParameter("driverId", driverId));
var ds = DbHelperSQL.Query(strSql.ToString(), paraList.ToArray());
if(ds.Tables[0].Rows.Count>0)
{
return ds.Tables[0].Rows[0][0].ToString();
}
return string.Empty;
}
}
}