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/Areas/SoftMng/DAL/info_client.cs

652 lines
48 KiB
C#

3 years ago
using System;
using System.Text;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Data;
using DSWeb.SoftMng.DBUtility;
// ReSharper disable once CheckNamespace
namespace DSWeb.SoftMng.DAL
{
//info_client
public partial class info_clientDAL
{
public bool Exists(string GID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select count(1) from info_client");
strSql.Append(" where ");
strSql.Append(" GID = @GID");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,36)};
parameters[0].Value = GID;
return DbHelperSQL.Exists(strSql.ToString(),parameters);
}
/// <summary>
/// 增加一条数据
/// </summary>
public int Add(DSWeb.SoftMng.Model.info_client model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into info_client(");
strSql.Append("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(") values (");
strSql.Append("@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(") ");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,36) ,
new SqlParameter("@CODENAME", SqlDbType.VarChar,50) ,
new SqlParameter("@SHORTNAME", SqlDbType.VarChar,200) ,
new SqlParameter("@DESCRIPTION", SqlDbType.VarChar,500) ,
new SqlParameter("@NAME", SqlDbType.VarChar,200) ,
new SqlParameter("@EnFullName", SqlDbType.VarChar,50) ,
new SqlParameter("@STATUS", SqlDbType.Int,4) ,
new SqlParameter("@ADDR", SqlDbType.VarChar,1000) ,
new SqlParameter("@EMAIL", SqlDbType.VarChar,50) ,
new SqlParameter("@WEB", SqlDbType.VarChar,50) ,
new SqlParameter("@TEL", SqlDbType.VarChar,50) ,
new SqlParameter("@FAX", SqlDbType.VarChar,50) ,
new SqlParameter("@CHIEF", SqlDbType.VarChar,20) ,
new SqlParameter("@SALE", SqlDbType.VarChar,20) ,
new SqlParameter("@OP", SqlDbType.VarChar,20) ,
new SqlParameter("@DOC", SqlDbType.VarChar,20) ,
new SqlParameter("@ISCARRIER", SqlDbType.Bit,1) ,
new SqlParameter("@ISBOOKING", SqlDbType.Bit,1) ,
new SqlParameter("@ISYARD", SqlDbType.Bit,1) ,
new SqlParameter("@ISTRUCK", SqlDbType.Bit,1) ,
new SqlParameter("@ISCONTROLLER", SqlDbType.Bit,1) ,
new SqlParameter("@ISCUSTOM", SqlDbType.Bit,1) ,
new SqlParameter("@ISAGENT", SqlDbType.Bit,1) ,
new SqlParameter("@ISAGENTCN", SqlDbType.Bit,1) ,
new SqlParameter("@ISEXPRESS", SqlDbType.Bit,1) ,
new SqlParameter("@ISAIRLINES", SqlDbType.Bit,1) ,
new SqlParameter("@ISSHIPPER", SqlDbType.Bit,1) ,
new SqlParameter("@ISCONSIGNEE", SqlDbType.Bit,1) ,
new SqlParameter("@ISNOTIFYPARTY", SqlDbType.Bit,1) ,
new SqlParameter("@ISWAREHOUSE", SqlDbType.Bit,1) ,
new SqlParameter("@COUNTRY", SqlDbType.VarChar,50) ,
new SqlParameter("@PROVINCE", SqlDbType.VarChar,50) ,
new SqlParameter("@CITY", SqlDbType.VarChar,50) ,
new SqlParameter("@CORPID", SqlDbType.VarChar,36) ,
new SqlParameter("@BLCONTENT", SqlDbType.VarChar,600) ,
new SqlParameter("@ISSTOP", SqlDbType.Bit,1) ,
new SqlParameter("@BillRises1", SqlDbType.VarChar,60) ,
new SqlParameter("@BillRises2", SqlDbType.VarChar,60) ,
new SqlParameter("@USDBillRises", SqlDbType.VarChar,60) ,
new SqlParameter("@RMBBillRises", SqlDbType.VarChar,60) ,
new SqlParameter("@RMBBank", SqlDbType.VarChar,60) ,
new SqlParameter("@RMBAccount", SqlDbType.VarChar,30) ,
new SqlParameter("@RMBOnlineNO", SqlDbType.VarChar,20) ,
new SqlParameter("@USDBank", SqlDbType.VarChar,60) ,
new SqlParameter("@USDAccount", SqlDbType.VarChar,30) ,
new SqlParameter("@USDOnlineNO", SqlDbType.VarChar,20) ,
new SqlParameter("@CustomAttributes1", SqlDbType.VarChar,12) ,
new SqlParameter("@CustomAttributes2", SqlDbType.VarChar,12) ,
new SqlParameter("@USDMaxAmountCredit", SqlDbType.Decimal,9) ,
new SqlParameter("@RMBMaxAmountCredit", SqlDbType.Decimal,9) ,
new SqlParameter("@MaxAmountCredit", SqlDbType.Decimal,9) ,
new SqlParameter("@STLNAME", SqlDbType.VarChar,30) ,
new SqlParameter("@OPNAME", SqlDbType.VarChar,20) ,
new SqlParameter("@OPTIME", SqlDbType.DateTime) ,
new SqlParameter("@REMARK", SqlDbType.VarChar,200) ,
new SqlParameter("@USDExchangeRate", SqlDbType.Decimal,9) ,
new SqlParameter("@STLDATE", SqlDbType.VarChar,2) ,
new SqlParameter("@STLFIRSTHALFDATE", SqlDbType.VarChar,2) ,
new SqlParameter("@STLMIDDLEDATE", SqlDbType.VarChar,2) ,
new SqlParameter("@STLDATEPJ", SqlDbType.VarChar,2) ,
new SqlParameter("@LEVEL", SqlDbType.VarChar,1) ,
new SqlParameter("@LOGINNAME", SqlDbType.VarChar,20) ,
new SqlParameter("@LOGINPASSWORD", SqlDbType.VarChar,100) ,
new SqlParameter("@QQ", SqlDbType.VarChar,50) ,
new SqlParameter("@MSN", SqlDbType.VarChar,50) ,
new SqlParameter("@MODIFIEDUSER", SqlDbType.VarChar,36) ,
new SqlParameter("@MODIFIEDTIME", SqlDbType.DateTime) ,
new SqlParameter("@ISWHARF", SqlDbType.Bit,1) ,
new SqlParameter("@ISSHIPPINGAGENT", SqlDbType.Bit,1) ,
new SqlParameter("@FARCODE", SqlDbType.VarChar,20) ,
new SqlParameter("@FAPCODE", SqlDbType.VarChar,20) ,
new SqlParameter("@ISINSURE", SqlDbType.Bit,1) ,
new SqlParameter("@ISLEASING", SqlDbType.Bit,1) ,
new SqlParameter("@ISTRADINGAGENCY", SqlDbType.Bit,1) ,
new SqlParameter("@ISOTHER", SqlDbType.Bit,1) ,
new SqlParameter("@OTHERS", SqlDbType.VarChar,100) ,
new SqlParameter("@UNITPRICE", SqlDbType.VarChar,50) ,
new SqlParameter("@REGISTRATIONNO", SqlDbType.VarChar,50) ,
new SqlParameter("@ORDERNO", SqlDbType.VarChar,50) ,
new SqlParameter("@ISENTERP", SqlDbType.Bit,1) ,
new SqlParameter("@TAXNO", SqlDbType.VarChar,30) ,
new SqlParameter("@EDICODE", SqlDbType.VarChar,20) ,
new SqlParameter("@EDICODE2", SqlDbType.VarChar,20) ,
new SqlParameter("@EDICODE3", SqlDbType.VarChar,20) ,
new SqlParameter("@ORGANIZATIONCODE", SqlDbType.VarChar,50) ,
new SqlParameter("@PCORPNAME", SqlDbType.VarChar,60) ,
new SqlParameter("@InspectionNo", SqlDbType.VarChar,50) ,
new SqlParameter("@ISSHIPAGENCY", SqlDbType.Bit,1) ,
new SqlParameter("@blstatus", SqlDbType.TinyInt,1) ,
new SqlParameter("@ISSP", SqlDbType.Bit,1) ,
new SqlParameter("@FEEFRT", SqlDbType.VarChar,20) ,
new SqlParameter("@RCVMode", SqlDbType.Int,4) ,
new SqlParameter("@ICOURL", SqlDbType.VarChar,200) ,
new SqlParameter("@BSSOURCE", SqlDbType.VarChar,36) ,
new SqlParameter("@INVBANK", SqlDbType.VarChar,150) ,
new SqlParameter("@INVADDRTEL", SqlDbType.VarChar,150) ,
new SqlParameter("@SALECORPID", SqlDbType.VarChar,36)
};
parameters[0].Value = model.GID??(Object)DBNull.Value;
parameters[1].Value = model.CODENAME??(Object)DBNull.Value;
parameters[2].Value = model.SHORTNAME??(Object)DBNull.Value;
parameters[3].Value = model.DESCRIPTION??(Object)DBNull.Value;
parameters[4].Value = model.NAME??(Object)DBNull.Value;
parameters[5].Value = model.EnFullName??(Object)DBNull.Value;
parameters[6].Value = model.STATUS??(Object)DBNull.Value;
parameters[7].Value = model.ADDR??(Object)DBNull.Value;
parameters[8].Value = model.EMAIL??(Object)DBNull.Value;
parameters[9].Value = model.WEB??(Object)DBNull.Value;
parameters[10].Value = model.TEL??(Object)DBNull.Value;
parameters[11].Value = model.FAX??(Object)DBNull.Value;
parameters[12].Value = model.CHIEF??(Object)DBNull.Value;
parameters[13].Value = model.SALE??(Object)DBNull.Value;
parameters[14].Value = model.OP??(Object)DBNull.Value;
parameters[15].Value = model.DOC??(Object)DBNull.Value;
parameters[16].Value = model.ISCARRIER??(Object)DBNull.Value;
parameters[17].Value = model.ISBOOKING??(Object)DBNull.Value;
parameters[18].Value = model.ISYARD??(Object)DBNull.Value;
parameters[19].Value = model.ISTRUCK??(Object)DBNull.Value;
parameters[20].Value = model.ISCONTROLLER??(Object)DBNull.Value;
parameters[21].Value = model.ISCUSTOM??(Object)DBNull.Value;
parameters[22].Value = model.ISAGENT??(Object)DBNull.Value;
parameters[23].Value = model.ISAGENTCN??(Object)DBNull.Value;
parameters[24].Value = model.ISEXPRESS??(Object)DBNull.Value;
parameters[25].Value = model.ISAIRLINES??(Object)DBNull.Value;
parameters[26].Value = model.ISSHIPPER??(Object)DBNull.Value;
parameters[27].Value = model.ISCONSIGNEE??(Object)DBNull.Value;
parameters[28].Value = model.ISNOTIFYPARTY??(Object)DBNull.Value;
parameters[29].Value = model.ISWAREHOUSE??(Object)DBNull.Value;
parameters[30].Value = model.COUNTRY??(Object)DBNull.Value;
parameters[31].Value = model.PROVINCE??(Object)DBNull.Value;
parameters[32].Value = model.CITY??(Object)DBNull.Value;
parameters[33].Value = model.CORPID??(Object)DBNull.Value;
parameters[34].Value = model.BLCONTENT??(Object)DBNull.Value;
parameters[35].Value = model.ISSTOP??(Object)DBNull.Value;
parameters[36].Value = model.BillRises1??(Object)DBNull.Value;
parameters[37].Value = model.BillRises2??(Object)DBNull.Value;
parameters[38].Value = model.USDBillRises??(Object)DBNull.Value;
parameters[39].Value = model.RMBBillRises??(Object)DBNull.Value;
parameters[40].Value = model.RMBBank??(Object)DBNull.Value;
parameters[41].Value = model.RMBAccount??(Object)DBNull.Value;
parameters[42].Value = model.RMBOnlineNO??(Object)DBNull.Value;
parameters[43].Value = model.USDBank??(Object)DBNull.Value;
parameters[44].Value = model.USDAccount??(Object)DBNull.Value;
parameters[45].Value = model.USDOnlineNO??(Object)DBNull.Value;
parameters[46].Value = model.CustomAttributes1??(Object)DBNull.Value;
parameters[47].Value = model.CustomAttributes2??(Object)DBNull.Value;
parameters[48].Value = model.USDMaxAmountCredit??(Object)DBNull.Value;
parameters[49].Value = model.RMBMaxAmountCredit??(Object)DBNull.Value;
parameters[50].Value = model.MaxAmountCredit??(Object)DBNull.Value;
parameters[51].Value = model.STLNAME??(Object)DBNull.Value;
parameters[52].Value = model.OPNAME??(Object)DBNull.Value;
parameters[53].Value = model.OPTIME??(Object)DBNull.Value;
parameters[54].Value = model.REMARK??(Object)DBNull.Value;
parameters[55].Value = model.USDExchangeRate??(Object)DBNull.Value;
parameters[56].Value = model.STLDATE??(Object)DBNull.Value;
parameters[57].Value = model.STLFIRSTHALFDATE??(Object)DBNull.Value;
parameters[58].Value = model.STLMIDDLEDATE??(Object)DBNull.Value;
parameters[59].Value = model.STLDATEPJ??(Object)DBNull.Value;
parameters[60].Value = model.LEVEL??(Object)DBNull.Value;
parameters[61].Value = model.LOGINNAME??(Object)DBNull.Value;
parameters[62].Value = model.LOGINPASSWORD??(Object)DBNull.Value;
parameters[63].Value = model.QQ??(Object)DBNull.Value;
parameters[64].Value = model.MSN??(Object)DBNull.Value;
parameters[65].Value = model.MODIFIEDUSER??(Object)DBNull.Value;
parameters[66].Value = model.MODIFIEDTIME??(Object)DBNull.Value;
parameters[67].Value = model.ISWHARF??(Object)DBNull.Value;
parameters[68].Value = model.ISSHIPPINGAGENT??(Object)DBNull.Value;
parameters[69].Value = model.FARCODE??(Object)DBNull.Value;
parameters[70].Value = model.FAPCODE??(Object)DBNull.Value;
parameters[71].Value = model.ISINSURE??(Object)DBNull.Value;
parameters[72].Value = model.ISLEASING??(Object)DBNull.Value;
parameters[73].Value = model.ISTRADINGAGENCY??(Object)DBNull.Value;
parameters[74].Value = model.ISOTHER??(Object)DBNull.Value;
parameters[75].Value = model.OTHERS??(Object)DBNull.Value;
parameters[76].Value = model.UNITPRICE??(Object)DBNull.Value;
parameters[77].Value = model.REGISTRATIONNO??(Object)DBNull.Value;
parameters[78].Value = model.ORDERNO??(Object)DBNull.Value;
parameters[79].Value = model.ISENTERP??(Object)DBNull.Value;
parameters[80].Value = model.TAXNO??(Object)DBNull.Value;
parameters[81].Value = model.EDICODE??(Object)DBNull.Value;
parameters[82].Value = model.EDICODE2??(Object)DBNull.Value;
parameters[83].Value = model.EDICODE3??(Object)DBNull.Value;
parameters[84].Value = model.ORGANIZATIONCODE??(Object)DBNull.Value;
parameters[85].Value = model.PCORPNAME??(Object)DBNull.Value;
parameters[86].Value = model.InspectionNo??(Object)DBNull.Value;
parameters[87].Value = model.ISSHIPAGENCY??(Object)DBNull.Value;
parameters[88].Value = model.blstatus??(Object)DBNull.Value;
parameters[89].Value = model.ISSP??(Object)DBNull.Value;
parameters[90].Value = model.FEEFRT??(Object)DBNull.Value;
parameters[91].Value = model.RCVMode??(Object)DBNull.Value;
parameters[92].Value = model.ICOURL??(Object)DBNull.Value;
parameters[93].Value = model.BSSOURCE??(Object)DBNull.Value;
parameters[94].Value = model.INVBANK??(Object)DBNull.Value;
parameters[95].Value = model.INVADDRTEL??(Object)DBNull.Value;
parameters[96].Value = model.SALECORPID??(Object)DBNull.Value;
return DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
/// <summary>
/// 更新一条数据
/// </summary>
public int Update(DSWeb.SoftMng.Model.info_client model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("update info_client set ");
strSql.Append(" GID = @GID,");
strSql.Append(" CODENAME = @CODENAME,");
strSql.Append(" SHORTNAME = @SHORTNAME,");
strSql.Append(" DESCRIPTION = @DESCRIPTION,");
strSql.Append(" NAME = @NAME,");
strSql.Append(" EnFullName = @EnFullName,");
strSql.Append(" STATUS = @STATUS,");
strSql.Append(" ADDR = @ADDR,");
strSql.Append(" EMAIL = @EMAIL,");
strSql.Append(" WEB = @WEB,");
strSql.Append(" TEL = @TEL,");
strSql.Append(" FAX = @FAX,");
strSql.Append(" CHIEF = @CHIEF,");
strSql.Append(" SALE = @SALE,");
strSql.Append(" OP = @OP,");
strSql.Append(" DOC = @DOC,");
strSql.Append(" ISCARRIER = @ISCARRIER,");
strSql.Append(" ISBOOKING = @ISBOOKING,");
strSql.Append(" ISYARD = @ISYARD,");
strSql.Append(" ISTRUCK = @ISTRUCK,");
strSql.Append(" ISCONTROLLER = @ISCONTROLLER,");
strSql.Append(" ISCUSTOM = @ISCUSTOM,");
strSql.Append(" ISAGENT = @ISAGENT,");
strSql.Append(" ISAGENTCN = @ISAGENTCN,");
strSql.Append(" ISEXPRESS = @ISEXPRESS,");
strSql.Append(" ISAIRLINES = @ISAIRLINES,");
strSql.Append(" ISSHIPPER = @ISSHIPPER,");
strSql.Append(" ISCONSIGNEE = @ISCONSIGNEE,");
strSql.Append(" ISNOTIFYPARTY = @ISNOTIFYPARTY,");
strSql.Append(" ISWAREHOUSE = @ISWAREHOUSE,");
strSql.Append(" COUNTRY = @COUNTRY,");
strSql.Append(" PROVINCE = @PROVINCE,");
strSql.Append(" CITY = @CITY,");
strSql.Append(" CORPID = @CORPID,");
strSql.Append(" BLCONTENT = @BLCONTENT,");
strSql.Append(" ISSTOP = @ISSTOP,");
strSql.Append(" BillRises1 = @BillRises1,");
strSql.Append(" BillRises2 = @BillRises2,");
strSql.Append(" USDBillRises = @USDBillRises,");
strSql.Append(" RMBBillRises = @RMBBillRises,");
strSql.Append(" RMBBank = @RMBBank,");
strSql.Append(" RMBAccount = @RMBAccount,");
strSql.Append(" RMBOnlineNO = @RMBOnlineNO,");
strSql.Append(" USDBank = @USDBank,");
strSql.Append(" USDAccount = @USDAccount,");
strSql.Append(" USDOnlineNO = @USDOnlineNO,");
strSql.Append(" CustomAttributes1 = @CustomAttributes1,");
strSql.Append(" CustomAttributes2 = @CustomAttributes2,");
strSql.Append(" USDMaxAmountCredit = @USDMaxAmountCredit,");
strSql.Append(" RMBMaxAmountCredit = @RMBMaxAmountCredit,");
strSql.Append(" MaxAmountCredit = @MaxAmountCredit,");
strSql.Append(" STLNAME = @STLNAME,");
strSql.Append(" OPNAME = @OPNAME,");
strSql.Append(" OPTIME = @OPTIME,");
strSql.Append(" REMARK = @REMARK,");
strSql.Append(" USDExchangeRate = @USDExchangeRate,");
strSql.Append(" STLDATE = @STLDATE,");
strSql.Append(" STLFIRSTHALFDATE = @STLFIRSTHALFDATE,");
strSql.Append(" STLMIDDLEDATE = @STLMIDDLEDATE,");
strSql.Append(" STLDATEPJ = @STLDATEPJ,");
strSql.Append(" LEVEL = @LEVEL,");
strSql.Append(" LOGINNAME = @LOGINNAME,");
strSql.Append(" LOGINPASSWORD = @LOGINPASSWORD,");
strSql.Append(" QQ = @QQ,");
strSql.Append(" MSN = @MSN,");
strSql.Append(" MODIFIEDUSER = @MODIFIEDUSER,");
strSql.Append(" MODIFIEDTIME = @MODIFIEDTIME,");
strSql.Append(" ISWHARF = @ISWHARF,");
strSql.Append(" ISSHIPPINGAGENT = @ISSHIPPINGAGENT,");
strSql.Append(" FARCODE = @FARCODE,");
strSql.Append(" FAPCODE = @FAPCODE,");
strSql.Append(" ISINSURE = @ISINSURE,");
strSql.Append(" ISLEASING = @ISLEASING,");
strSql.Append(" ISTRADINGAGENCY = @ISTRADINGAGENCY,");
strSql.Append(" ISOTHER = @ISOTHER,");
strSql.Append(" OTHERS = @OTHERS,");
strSql.Append(" UNITPRICE = @UNITPRICE,");
strSql.Append(" REGISTRATIONNO = @REGISTRATIONNO,");
strSql.Append(" ORDERNO = @ORDERNO,");
strSql.Append(" ISENTERP = @ISENTERP,");
strSql.Append(" TAXNO = @TAXNO,");
strSql.Append(" EDICODE = @EDICODE,");
strSql.Append(" EDICODE2 = @EDICODE2,");
strSql.Append(" EDICODE3 = @EDICODE3,");
strSql.Append(" ORGANIZATIONCODE = @ORGANIZATIONCODE,");
strSql.Append(" PCORPNAME = @PCORPNAME,");
strSql.Append(" InspectionNo = @InspectionNo,");
strSql.Append(" ISSHIPAGENCY = @ISSHIPAGENCY,");
strSql.Append(" blstatus = @blstatus,");
strSql.Append(" ISSP = @ISSP,");
strSql.Append(" FEEFRT = @FEEFRT,");
strSql.Append(" RCVMode = @RCVMode,");
strSql.Append(" ICOURL = @ICOURL,");
strSql.Append(" BSSOURCE = @BSSOURCE,");
strSql.Append(" INVBANK = @INVBANK,");
strSql.Append(" INVADDRTEL = @INVADDRTEL,");
strSql.Append(" SALECORPID = @SALECORPID");
strSql.Append(" where GID=@GID");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,36) ,
new SqlParameter("@CODENAME", SqlDbType.VarChar,50) ,
new SqlParameter("@SHORTNAME", SqlDbType.VarChar,200) ,
new SqlParameter("@DESCRIPTION", SqlDbType.VarChar,500) ,
new SqlParameter("@NAME", SqlDbType.VarChar,200) ,
new SqlParameter("@EnFullName", SqlDbType.VarChar,50) ,
new SqlParameter("@STATUS", SqlDbType.Int,4) ,
new SqlParameter("@ADDR", SqlDbType.VarChar,1000) ,
new SqlParameter("@EMAIL", SqlDbType.VarChar,50) ,
new SqlParameter("@WEB", SqlDbType.VarChar,50) ,
new SqlParameter("@TEL", SqlDbType.VarChar,50) ,
new SqlParameter("@FAX", SqlDbType.VarChar,50) ,
new SqlParameter("@CHIEF", SqlDbType.VarChar,20) ,
new SqlParameter("@SALE", SqlDbType.VarChar,20) ,
new SqlParameter("@OP", SqlDbType.VarChar,20) ,
new SqlParameter("@DOC", SqlDbType.VarChar,20) ,
new SqlParameter("@ISCARRIER", SqlDbType.Bit,1) ,
new SqlParameter("@ISBOOKING", SqlDbType.Bit,1) ,
new SqlParameter("@ISYARD", SqlDbType.Bit,1) ,
new SqlParameter("@ISTRUCK", SqlDbType.Bit,1) ,
new SqlParameter("@ISCONTROLLER", SqlDbType.Bit,1) ,
new SqlParameter("@ISCUSTOM", SqlDbType.Bit,1) ,
new SqlParameter("@ISAGENT", SqlDbType.Bit,1) ,
new SqlParameter("@ISAGENTCN", SqlDbType.Bit,1) ,
new SqlParameter("@ISEXPRESS", SqlDbType.Bit,1) ,
new SqlParameter("@ISAIRLINES", SqlDbType.Bit,1) ,
new SqlParameter("@ISSHIPPER", SqlDbType.Bit,1) ,
new SqlParameter("@ISCONSIGNEE", SqlDbType.Bit,1) ,
new SqlParameter("@ISNOTIFYPARTY", SqlDbType.Bit,1) ,
new SqlParameter("@ISWAREHOUSE", SqlDbType.Bit,1) ,
new SqlParameter("@COUNTRY", SqlDbType.VarChar,50) ,
new SqlParameter("@PROVINCE", SqlDbType.VarChar,50) ,
new SqlParameter("@CITY", SqlDbType.VarChar,50) ,
new SqlParameter("@CORPID", SqlDbType.VarChar,36) ,
new SqlParameter("@BLCONTENT", SqlDbType.VarChar,600) ,
new SqlParameter("@ISSTOP", SqlDbType.Bit,1) ,
new SqlParameter("@BillRises1", SqlDbType.VarChar,60) ,
new SqlParameter("@BillRises2", SqlDbType.VarChar,60) ,
new SqlParameter("@USDBillRises", SqlDbType.VarChar,60) ,
new SqlParameter("@RMBBillRises", SqlDbType.VarChar,60) ,
new SqlParameter("@RMBBank", SqlDbType.VarChar,60) ,
new SqlParameter("@RMBAccount", SqlDbType.VarChar,30) ,
new SqlParameter("@RMBOnlineNO", SqlDbType.VarChar,20) ,
new SqlParameter("@USDBank", SqlDbType.VarChar,60) ,
new SqlParameter("@USDAccount", SqlDbType.VarChar,30) ,
new SqlParameter("@USDOnlineNO", SqlDbType.VarChar,20) ,
new SqlParameter("@CustomAttributes1", SqlDbType.VarChar,12) ,
new SqlParameter("@CustomAttributes2", SqlDbType.VarChar,12) ,
new SqlParameter("@USDMaxAmountCredit", SqlDbType.Decimal,9) ,
new SqlParameter("@RMBMaxAmountCredit", SqlDbType.Decimal,9) ,
new SqlParameter("@MaxAmountCredit", SqlDbType.Decimal,9) ,
new SqlParameter("@STLNAME", SqlDbType.VarChar,30) ,
new SqlParameter("@OPNAME", SqlDbType.VarChar,20) ,
new SqlParameter("@OPTIME", SqlDbType.DateTime) ,
new SqlParameter("@REMARK", SqlDbType.VarChar,200) ,
new SqlParameter("@USDExchangeRate", SqlDbType.Decimal,9) ,
new SqlParameter("@STLDATE", SqlDbType.VarChar,2) ,
new SqlParameter("@STLFIRSTHALFDATE", SqlDbType.VarChar,2) ,
new SqlParameter("@STLMIDDLEDATE", SqlDbType.VarChar,2) ,
new SqlParameter("@STLDATEPJ", SqlDbType.VarChar,2) ,
new SqlParameter("@LEVEL", SqlDbType.VarChar,1) ,
new SqlParameter("@LOGINNAME", SqlDbType.VarChar,20) ,
new SqlParameter("@LOGINPASSWORD", SqlDbType.VarChar,100) ,
new SqlParameter("@QQ", SqlDbType.VarChar,50) ,
new SqlParameter("@MSN", SqlDbType.VarChar,50) ,
new SqlParameter("@MODIFIEDUSER", SqlDbType.VarChar,36) ,
new SqlParameter("@MODIFIEDTIME", SqlDbType.DateTime) ,
new SqlParameter("@ISWHARF", SqlDbType.Bit,1) ,
new SqlParameter("@ISSHIPPINGAGENT", SqlDbType.Bit,1) ,
new SqlParameter("@FARCODE", SqlDbType.VarChar,20) ,
new SqlParameter("@FAPCODE", SqlDbType.VarChar,20) ,
new SqlParameter("@ISINSURE", SqlDbType.Bit,1) ,
new SqlParameter("@ISLEASING", SqlDbType.Bit,1) ,
new SqlParameter("@ISTRADINGAGENCY", SqlDbType.Bit,1) ,
new SqlParameter("@ISOTHER", SqlDbType.Bit,1) ,
new SqlParameter("@OTHERS", SqlDbType.VarChar,100) ,
new SqlParameter("@UNITPRICE", SqlDbType.VarChar,50) ,
new SqlParameter("@REGISTRATIONNO", SqlDbType.VarChar,50) ,
new SqlParameter("@ORDERNO", SqlDbType.VarChar,50) ,
new SqlParameter("@ISENTERP", SqlDbType.Bit,1) ,
new SqlParameter("@TAXNO", SqlDbType.VarChar,30) ,
new SqlParameter("@EDICODE", SqlDbType.VarChar,20) ,
new SqlParameter("@EDICODE2", SqlDbType.VarChar,20) ,
new SqlParameter("@EDICODE3", SqlDbType.VarChar,20) ,
new SqlParameter("@ORGANIZATIONCODE", SqlDbType.VarChar,50) ,
new SqlParameter("@PCORPNAME", SqlDbType.VarChar,60) ,
new SqlParameter("@InspectionNo", SqlDbType.VarChar,50) ,
new SqlParameter("@ISSHIPAGENCY", SqlDbType.Bit,1) ,
new SqlParameter("@blstatus", SqlDbType.TinyInt,1) ,
new SqlParameter("@ISSP", SqlDbType.Bit,1) ,
new SqlParameter("@FEEFRT", SqlDbType.VarChar,20) ,
new SqlParameter("@RCVMode", SqlDbType.Int,4) ,
new SqlParameter("@ICOURL", SqlDbType.VarChar,200) ,
new SqlParameter("@BSSOURCE", SqlDbType.VarChar,36) ,
new SqlParameter("@INVBANK", SqlDbType.VarChar,150) ,
new SqlParameter("@INVADDRTEL", SqlDbType.VarChar,150) ,
new SqlParameter("@SALECORPID", SqlDbType.VarChar,36)
};
parameters[0].Value = model.GID??(Object)DBNull.Value;
parameters[1].Value = model.CODENAME??(Object)DBNull.Value;
parameters[2].Value = model.SHORTNAME??(Object)DBNull.Value;
parameters[3].Value = model.DESCRIPTION??(Object)DBNull.Value;
parameters[4].Value = model.NAME??(Object)DBNull.Value;
parameters[5].Value = model.EnFullName??(Object)DBNull.Value;
parameters[6].Value = model.STATUS??(Object)DBNull.Value;
parameters[7].Value = model.ADDR??(Object)DBNull.Value;
parameters[8].Value = model.EMAIL??(Object)DBNull.Value;
parameters[9].Value = model.WEB??(Object)DBNull.Value;
parameters[10].Value = model.TEL??(Object)DBNull.Value;
parameters[11].Value = model.FAX??(Object)DBNull.Value;
parameters[12].Value = model.CHIEF??(Object)DBNull.Value;
parameters[13].Value = model.SALE??(Object)DBNull.Value;
parameters[14].Value = model.OP??(Object)DBNull.Value;
parameters[15].Value = model.DOC??(Object)DBNull.Value;
parameters[16].Value = model.ISCARRIER??(Object)DBNull.Value;
parameters[17].Value = model.ISBOOKING??(Object)DBNull.Value;
parameters[18].Value = model.ISYARD??(Object)DBNull.Value;
parameters[19].Value = model.ISTRUCK??(Object)DBNull.Value;
parameters[20].Value = model.ISCONTROLLER??(Object)DBNull.Value;
parameters[21].Value = model.ISCUSTOM??(Object)DBNull.Value;
parameters[22].Value = model.ISAGENT??(Object)DBNull.Value;
parameters[23].Value = model.ISAGENTCN??(Object)DBNull.Value;
parameters[24].Value = model.ISEXPRESS??(Object)DBNull.Value;
parameters[25].Value = model.ISAIRLINES??(Object)DBNull.Value;
parameters[26].Value = model.ISSHIPPER??(Object)DBNull.Value;
parameters[27].Value = model.ISCONSIGNEE??(Object)DBNull.Value;
parameters[28].Value = model.ISNOTIFYPARTY??(Object)DBNull.Value;
parameters[29].Value = model.ISWAREHOUSE??(Object)DBNull.Value;
parameters[30].Value = model.COUNTRY??(Object)DBNull.Value;
parameters[31].Value = model.PROVINCE??(Object)DBNull.Value;
parameters[32].Value = model.CITY??(Object)DBNull.Value;
parameters[33].Value = model.CORPID??(Object)DBNull.Value;
parameters[34].Value = model.BLCONTENT??(Object)DBNull.Value;
parameters[35].Value = model.ISSTOP??(Object)DBNull.Value;
parameters[36].Value = model.BillRises1??(Object)DBNull.Value;
parameters[37].Value = model.BillRises2??(Object)DBNull.Value;
parameters[38].Value = model.USDBillRises??(Object)DBNull.Value;
parameters[39].Value = model.RMBBillRises??(Object)DBNull.Value;
parameters[40].Value = model.RMBBank??(Object)DBNull.Value;
parameters[41].Value = model.RMBAccount??(Object)DBNull.Value;
parameters[42].Value = model.RMBOnlineNO??(Object)DBNull.Value;
parameters[43].Value = model.USDBank??(Object)DBNull.Value;
parameters[44].Value = model.USDAccount??(Object)DBNull.Value;
parameters[45].Value = model.USDOnlineNO??(Object)DBNull.Value;
parameters[46].Value = model.CustomAttributes1??(Object)DBNull.Value;
parameters[47].Value = model.CustomAttributes2??(Object)DBNull.Value;
parameters[48].Value = model.USDMaxAmountCredit??(Object)DBNull.Value;
parameters[49].Value = model.RMBMaxAmountCredit??(Object)DBNull.Value;
parameters[50].Value = model.MaxAmountCredit??(Object)DBNull.Value;
parameters[51].Value = model.STLNAME??(Object)DBNull.Value;
parameters[52].Value = model.OPNAME??(Object)DBNull.Value;
parameters[53].Value = model.OPTIME??(Object)DBNull.Value;
parameters[54].Value = model.REMARK??(Object)DBNull.Value;
parameters[55].Value = model.USDExchangeRate??(Object)DBNull.Value;
parameters[56].Value = model.STLDATE??(Object)DBNull.Value;
parameters[57].Value = model.STLFIRSTHALFDATE??(Object)DBNull.Value;
parameters[58].Value = model.STLMIDDLEDATE??(Object)DBNull.Value;
parameters[59].Value = model.STLDATEPJ??(Object)DBNull.Value;
parameters[60].Value = model.LEVEL??(Object)DBNull.Value;
parameters[61].Value = model.LOGINNAME??(Object)DBNull.Value;
parameters[62].Value = model.LOGINPASSWORD??(Object)DBNull.Value;
parameters[63].Value = model.QQ??(Object)DBNull.Value;
parameters[64].Value = model.MSN??(Object)DBNull.Value;
parameters[65].Value = model.MODIFIEDUSER??(Object)DBNull.Value;
parameters[66].Value = model.MODIFIEDTIME??(Object)DBNull.Value;
parameters[67].Value = model.ISWHARF??(Object)DBNull.Value;
parameters[68].Value = model.ISSHIPPINGAGENT??(Object)DBNull.Value;
parameters[69].Value = model.FARCODE??(Object)DBNull.Value;
parameters[70].Value = model.FAPCODE??(Object)DBNull.Value;
parameters[71].Value = model.ISINSURE??(Object)DBNull.Value;
parameters[72].Value = model.ISLEASING??(Object)DBNull.Value;
parameters[73].Value = model.ISTRADINGAGENCY??(Object)DBNull.Value;
parameters[74].Value = model.ISOTHER??(Object)DBNull.Value;
parameters[75].Value = model.OTHERS??(Object)DBNull.Value;
parameters[76].Value = model.UNITPRICE??(Object)DBNull.Value;
parameters[77].Value = model.REGISTRATIONNO??(Object)DBNull.Value;
parameters[78].Value = model.ORDERNO??(Object)DBNull.Value;
parameters[79].Value = model.ISENTERP??(Object)DBNull.Value;
parameters[80].Value = model.TAXNO??(Object)DBNull.Value;
parameters[81].Value = model.EDICODE??(Object)DBNull.Value;
parameters[82].Value = model.EDICODE2??(Object)DBNull.Value;
parameters[83].Value = model.EDICODE3??(Object)DBNull.Value;
parameters[84].Value = model.ORGANIZATIONCODE??(Object)DBNull.Value;
parameters[85].Value = model.PCORPNAME??(Object)DBNull.Value;
parameters[86].Value = model.InspectionNo??(Object)DBNull.Value;
parameters[87].Value = model.ISSHIPAGENCY??(Object)DBNull.Value;
parameters[88].Value = model.blstatus??(Object)DBNull.Value;
parameters[89].Value = model.ISSP??(Object)DBNull.Value;
parameters[90].Value = model.FEEFRT??(Object)DBNull.Value;
parameters[91].Value = model.RCVMode??(Object)DBNull.Value;
parameters[92].Value = model.ICOURL??(Object)DBNull.Value;
parameters[93].Value = model.BSSOURCE??(Object)DBNull.Value;
parameters[94].Value = model.INVBANK??(Object)DBNull.Value;
parameters[95].Value = model.INVADDRTEL??(Object)DBNull.Value;
parameters[96].Value = model.SALECORPID??(Object)DBNull.Value;
return DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
/// <summary>
/// 删除一条数据
/// </summary>
public int Delete(string GID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("delete from info_client ");
strSql.Append(" where GID=@GID");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,36)};
parameters[0].Value = GID;
return DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
/// <summary>
/// 按条件批量删除
/// </summary>
public int DeleteListWhere(string strWhere)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("delete from info_client ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
return DbHelperSQL.ExecuteSql(strSql.ToString());
}
/// <summary>
/// 得到一个对象实体
/// </summary>
public DataSet GetModel(string GID)
{
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 GID=@GID");
SqlParameter[] parameters = {
new SqlParameter("@GID", SqlDbType.VarChar,36)};
parameters[0].Value = GID;
DSWeb.SoftMng.Model.info_client model=new DSWeb.SoftMng.Model.info_client();
return DbHelperSQL.Query(strSql.ToString(),parameters);
}
/// <summary>
/// 获得数据列表
/// </summary>
public DataSet GetList(string strWhere)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select * ");
strSql.Append(" FROM info_client ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
return DbHelperSQL.Query(strSql.ToString());
}
/// <summary>
/// 获得前几行数据
/// </summary>
public DataSet GetList(int Top,string strWhere,string filedOrder)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select ");
if(Top>0)
{
strSql.Append(" top "+Top.ToString());
}
strSql.Append(" * ");
strSql.Append(" FROM info_client ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
strSql.Append(" order by " + filedOrder);
return DbHelperSQL.Query(strSql.ToString());
}
/// <summary>
/// 分页获取数据列表
/// </summary>
public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
{
//动软代码
StringBuilder strSql = new StringBuilder();
strSql.Append("SELECT * FROM ( ");
strSql.Append(" SELECT ROW_NUMBER() OVER (");
if (!string.IsNullOrEmpty(orderby.Trim()))
strSql.Append("order by T." + orderby);
strSql.Append(")AS Row, T.* from info_client T ");
if (!string.IsNullOrEmpty(strWhere.Trim()))
{
strSql.Append(" WHERE " + strWhere);
}
strSql.Append(" ) TT");
strSql.AppendFormat(" WHERE TT.Row > {0} and TT.Row <= {1}", startIndex, endIndex);
//公共代码
return DbHelperSQL.Query(strSql.ToString());
}
/// <summary>
/// 获取记录总数
/// </summary>
public int GetRecordCount(string strWhere)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select count(1) FROM info_client ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
return DbHelperSQL.ExcuteScalarSQL(strSql.ToString());
}
}
}