| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415 |
- /** 版本信息模板在安装目录下,可自行修改。
- * T_Cus_CustomerBase.cs
- *
- * 功 能: N/A
- * 类 名: T_Cus_CustomerBase
- *
- * Ver 变更日期 负责人 变更内容
- * ───────────────────────────────────
- * V0.01 2015/2/27 16:05:58 N/A 初版
- *
- * Copyright (c) 2012 Maticsoft Corporation. All rights reserved.
- *┌──────────────────────────────────┐
- *│ 此技术信息为本公司机密信息,未经本公司书面同意禁止向第三方披露. │
- *│ 版权所有:动软卓越(北京)科技有限公司 │
- *└──────────────────────────────────┘
- */
- using System;
- using System.Data;
- using System.Text;
- using System.Data.SqlClient;
- using YTSoft.DBUtility;//Please add references
- namespace YTSoft.BaseCallCenter.DAL
- {
- /// <summary>
- /// 数据访问类:T_Cus_CustomerBase
- /// </summary>
- public partial class T_Cus_CustomerBase
- {
- public T_Cus_CustomerBase()
- { }
- #region BasicMethod
- /// <summary>
- /// 得到最大ID
- /// </summary>
- public int GetMaxId()
- {
- return DbHelperSQL.GetMaxID("F_CustomerId", "T_Cus_CustomerBase");
- }
- /// <summary>
- /// 是否存在该记录
- /// </summary>
- public bool Exists(int F_CustomerId)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select count(1) from T_Cus_CustomerBase");
- strSql.Append(" where F_CustomerId=@F_CustomerId");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerId", SqlDbType.Int,4)
- };
- parameters[0].Value = F_CustomerId;
- return DbHelperSQL.Exists(strSql.ToString(), parameters);
- }
- /// <summary>
- /// 增加一条数据
- /// </summary>
- public int Add(YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("insert into T_Cus_CustomerBase(");
- strSql.Append("F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID)");
- strSql.Append(" values (");
- strSql.Append("@F_CustomerName,@F_CustomerCode,@F_CustomerEName,@F_CustomerPym,@F_Layer,@F_CustomerLayer,@F_CategoryId,@F_TradeId,@F_RegionId,@F_IndustryId,@F_Address,@F_Url,@F_Telephone,@F_Mobile,@F_Fax,@F_Email,@F_Website,@F_PostCode,@F_ScaleResume,@F_BusinessProfile,@F_BusinessLicenseID,@F_TaxID,@F_OpeningBank,@F_BankAccount,@F_LegalRepresentative,@F_LegalRepresentativeCardID,@F_Nature,@F_Kind,@F_CustomerType,@F_MainProduct,@F_CustomerFrom,@F_TrackInfo,@F_TrackState,@F_ImportDegree,@F_IntentProduct,@F_CreateBy,@F_CreatedOn,@F_ModifyBy,@F_ModifiedOn,@F_DeleteFlag,@F_StatusCode,@F_ServiceDept,@F_ChargeName,@F_ChargeTelephone,@F_Province,@F_ProductLine,@F_ChargeDept,@F_AfterSaleName,@F_CustomerNature,@F_CustomerClass,@F_CustomerIndustry,@F_RelationShipClass,@F_CurrentVersion,@F_SystemStartTime,@F_QualityGuaranteeEndTime,@F_AfterSaleTelephone,@F_Notes,@F_SystemType,@F_City,@F_CustomerStatus,@F_DeviceCount,@F_MaintenanceType,@F_ERPCustomerCode,@F_ServiceDeptID,@F_ProductLineID,@F_AfterSaleNameID,@F_CustomerNatureID,@F_CustomerClassID,@F_RelationShipClassID,@F_CityID)");
- strSql.Append(";select @@IDENTITY");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerName", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerCode", SqlDbType.VarChar,100),
- new SqlParameter("@F_CustomerEName", SqlDbType.NVarChar,800),
- new SqlParameter("@F_CustomerPym", SqlDbType.NVarChar,50),
- new SqlParameter("@F_Layer", SqlDbType.SmallInt,2),
- new SqlParameter("@F_CustomerLayer", SqlDbType.NVarChar,50),
- new SqlParameter("@F_CategoryId", SqlDbType.Int,4),
- new SqlParameter("@F_TradeId", SqlDbType.Int,4),
- new SqlParameter("@F_RegionId", SqlDbType.Int,4),
- new SqlParameter("@F_IndustryId", SqlDbType.Int,4),
- new SqlParameter("@F_Address", SqlDbType.NVarChar,300),
- new SqlParameter("@F_Url", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Telephone", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Mobile", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Fax", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Email", SqlDbType.VarChar,200),
- new SqlParameter("@F_Website", SqlDbType.VarChar,200),
- new SqlParameter("@F_PostCode", SqlDbType.NVarChar,50),
- new SqlParameter("@F_ScaleResume", SqlDbType.NVarChar,2000),
- new SqlParameter("@F_BusinessProfile", SqlDbType.NVarChar,2000),
- new SqlParameter("@F_BusinessLicenseID", SqlDbType.VarChar,80),
- new SqlParameter("@F_TaxID", SqlDbType.VarChar,80),
- new SqlParameter("@F_OpeningBank", SqlDbType.NVarChar,100),
- new SqlParameter("@F_BankAccount", SqlDbType.VarChar,80),
- new SqlParameter("@F_LegalRepresentative", SqlDbType.VarChar,50),
- new SqlParameter("@F_LegalRepresentativeCardID", SqlDbType.VarChar,30),
- new SqlParameter("@F_Nature", SqlDbType.NVarChar,80),
- new SqlParameter("@F_Kind", SqlDbType.NVarChar,80),
- new SqlParameter("@F_CustomerType", SqlDbType.Int,4),
- new SqlParameter("@F_MainProduct", SqlDbType.Text),
- new SqlParameter("@F_CustomerFrom", SqlDbType.NVarChar,200),
- new SqlParameter("@F_TrackInfo", SqlDbType.NVarChar,200),
- new SqlParameter("@F_TrackState", SqlDbType.NVarChar,50),
- new SqlParameter("@F_ImportDegree", SqlDbType.NVarChar,50),
- new SqlParameter("@F_IntentProduct", SqlDbType.Text),
- new SqlParameter("@F_CreateBy", SqlDbType.Int,4),
- new SqlParameter("@F_CreatedOn", SqlDbType.DateTime),
- new SqlParameter("@F_ModifyBy", SqlDbType.Int,4),
- new SqlParameter("@F_ModifiedOn", SqlDbType.DateTime),
- new SqlParameter("@F_DeleteFlag", SqlDbType.SmallInt,2),
- new SqlParameter("@F_StatusCode", SqlDbType.SmallInt,2),
- new SqlParameter("@F_ServiceDept", SqlDbType.NVarChar,20),
- new SqlParameter("@F_ChargeName", SqlDbType.NVarChar,20),
- new SqlParameter("@F_ChargeTelephone", SqlDbType.VarChar,15),
- new SqlParameter("@F_Province", SqlDbType.NVarChar,20),
- new SqlParameter("@F_ProductLine", SqlDbType.NVarChar,50),
- new SqlParameter("@F_ChargeDept", SqlDbType.NVarChar,20),
- new SqlParameter("@F_AfterSaleName", SqlDbType.NVarChar,20),
- new SqlParameter("@F_CustomerNature", SqlDbType.NVarChar,20),
- new SqlParameter("@F_CustomerClass", SqlDbType.NVarChar,10),
- new SqlParameter("@F_CustomerIndustry", SqlDbType.NVarChar,10),
- new SqlParameter("@F_RelationShipClass", SqlDbType.NVarChar,10),
- new SqlParameter("@F_CurrentVersion", SqlDbType.VarChar,100),
- new SqlParameter("@F_SystemStartTime", SqlDbType.DateTime),
- new SqlParameter("@F_QualityGuaranteeEndTime", SqlDbType.DateTime),
- new SqlParameter("@F_AfterSaleTelephone", SqlDbType.VarChar,15),
- new SqlParameter("@F_Notes", SqlDbType.NVarChar,500),
- new SqlParameter("@F_SystemType", SqlDbType.NVarChar,100),
- new SqlParameter("@F_City", SqlDbType.NVarChar,10),
- new SqlParameter("@F_CustomerStatus", SqlDbType.NVarChar,10),
- new SqlParameter("@F_DeviceCount", SqlDbType.Int,4),
- new SqlParameter("@F_MaintenanceType", SqlDbType.NVarChar,30),
- new SqlParameter("@F_ERPCustomerCode", SqlDbType.VarChar,100),
- new SqlParameter("@F_ServiceDeptID", SqlDbType.Int,4),
- new SqlParameter("@F_ProductLineID", SqlDbType.Int,4),
- new SqlParameter("@F_AfterSaleNameID", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerNatureID", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerClassID", SqlDbType.Int,4),
- new SqlParameter("@F_RelationShipClassID", SqlDbType.Int,4),
- new SqlParameter("@F_CityID", SqlDbType.Int,4)};
- parameters[0].Value = model.F_CustomerName;
- parameters[1].Value = model.F_CustomerCode;
- parameters[2].Value = model.F_CustomerEName;
- parameters[3].Value = model.F_CustomerPym;
- parameters[4].Value = model.F_Layer;
- parameters[5].Value = model.F_CustomerLayer;
- parameters[6].Value = model.F_CategoryId;
- parameters[7].Value = model.F_TradeId;
- parameters[8].Value = model.F_RegionId;
- parameters[9].Value = model.F_IndustryId;
- parameters[10].Value = model.F_Address;
- parameters[11].Value = model.F_Url;
- parameters[12].Value = model.F_Telephone;
- parameters[13].Value = model.F_Mobile;
- parameters[14].Value = model.F_Fax;
- parameters[15].Value = model.F_Email;
- parameters[16].Value = model.F_Website;
- parameters[17].Value = model.F_PostCode;
- parameters[18].Value = model.F_ScaleResume;
- parameters[19].Value = model.F_BusinessProfile;
- parameters[20].Value = model.F_BusinessLicenseID;
- parameters[21].Value = model.F_TaxID;
- parameters[22].Value = model.F_OpeningBank;
- parameters[23].Value = model.F_BankAccount;
- parameters[24].Value = model.F_LegalRepresentative;
- parameters[25].Value = model.F_LegalRepresentativeCardID;
- parameters[26].Value = model.F_Nature;
- parameters[27].Value = model.F_Kind;
- parameters[28].Value = model.F_CustomerType;
- parameters[29].Value = model.F_MainProduct;
- parameters[30].Value = model.F_CustomerFrom;
- parameters[31].Value = model.F_TrackInfo;
- parameters[32].Value = model.F_TrackState;
- parameters[33].Value = model.F_ImportDegree;
- parameters[34].Value = model.F_IntentProduct;
- parameters[35].Value = model.F_CreateBy;
- parameters[36].Value = model.F_CreatedOn;
- parameters[37].Value = model.F_ModifyBy;
- parameters[38].Value = model.F_ModifiedOn;
- parameters[39].Value = model.F_DeleteFlag;
- parameters[40].Value = model.F_StatusCode;
- parameters[41].Value = model.F_ServiceDept;
- parameters[42].Value = model.F_ChargeName;
- parameters[43].Value = model.F_ChargeTelephone;
- parameters[44].Value = model.F_Province;
- parameters[45].Value = model.F_ProductLine;
- parameters[46].Value = model.F_ChargeDept;
- parameters[47].Value = model.F_AfterSaleName;
- parameters[48].Value = model.F_CustomerNature;
- parameters[49].Value = model.F_CustomerClass;
- parameters[50].Value = model.F_CustomerIndustry;
- parameters[51].Value = model.F_RelationShipClass;
- parameters[52].Value = model.F_CurrentVersion;
- parameters[53].Value = model.F_SystemStartTime;
- parameters[54].Value = model.F_QualityGuaranteeEndTime;
- parameters[55].Value = model.F_AfterSaleTelephone;
- parameters[56].Value = model.F_Notes;
- parameters[57].Value = model.F_SystemType;
- parameters[58].Value = model.F_City;
- parameters[59].Value = model.F_CustomerStatus;
- parameters[60].Value = model.F_DeviceCount;
- parameters[61].Value = model.F_MaintenanceType;
- parameters[62].Value = model.F_ERPCustomerCode;
- parameters[63].Value = model.F_ServiceDeptID;
- parameters[64].Value = model.F_ProductLineID;
- parameters[65].Value = model.F_AfterSaleNameID;
- parameters[66].Value = model.F_CustomerNatureID;
- parameters[67].Value = model.F_CustomerClassID;
- parameters[68].Value = model.F_RelationShipClassID;
- parameters[69].Value = model.F_CityID;
- object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
- if (obj == null)
- {
- return 0;
- }
- else
- {
- return Convert.ToInt32(obj);
- }
- }
- /// <summary>
- /// 更新一条数据
- /// </summary>
- public bool Update(YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("update T_Cus_CustomerBase set ");
- strSql.Append("F_CustomerName=@F_CustomerName,");
- strSql.Append("F_CustomerCode=@F_CustomerCode,");
- strSql.Append("F_CustomerEName=@F_CustomerEName,");
- strSql.Append("F_CustomerPym=@F_CustomerPym,");
- strSql.Append("F_Layer=@F_Layer,");
- strSql.Append("F_CustomerLayer=@F_CustomerLayer,");
- strSql.Append("F_CategoryId=@F_CategoryId,");
- strSql.Append("F_TradeId=@F_TradeId,");
- strSql.Append("F_RegionId=@F_RegionId,");
- strSql.Append("F_IndustryId=@F_IndustryId,");
- strSql.Append("F_Address=@F_Address,");
- strSql.Append("F_Url=@F_Url,");
- strSql.Append("F_Telephone=@F_Telephone,");
- strSql.Append("F_Mobile=@F_Mobile,");
- strSql.Append("F_Fax=@F_Fax,");
- strSql.Append("F_Email=@F_Email,");
- strSql.Append("F_Website=@F_Website,");
- strSql.Append("F_PostCode=@F_PostCode,");
- strSql.Append("F_ScaleResume=@F_ScaleResume,");
- strSql.Append("F_BusinessProfile=@F_BusinessProfile,");
- strSql.Append("F_BusinessLicenseID=@F_BusinessLicenseID,");
- strSql.Append("F_TaxID=@F_TaxID,");
- strSql.Append("F_OpeningBank=@F_OpeningBank,");
- strSql.Append("F_BankAccount=@F_BankAccount,");
- strSql.Append("F_LegalRepresentative=@F_LegalRepresentative,");
- strSql.Append("F_LegalRepresentativeCardID=@F_LegalRepresentativeCardID,");
- strSql.Append("F_Nature=@F_Nature,");
- strSql.Append("F_Kind=@F_Kind,");
- strSql.Append("F_CustomerType=@F_CustomerType,");
- strSql.Append("F_MainProduct=@F_MainProduct,");
- strSql.Append("F_CustomerFrom=@F_CustomerFrom,");
- strSql.Append("F_TrackInfo=@F_TrackInfo,");
- strSql.Append("F_TrackState=@F_TrackState,");
- strSql.Append("F_ImportDegree=@F_ImportDegree,");
- strSql.Append("F_IntentProduct=@F_IntentProduct,");
- strSql.Append("F_CreateBy=@F_CreateBy,");
- strSql.Append("F_CreatedOn=@F_CreatedOn,");
- strSql.Append("F_ModifyBy=@F_ModifyBy,");
- strSql.Append("F_ModifiedOn=@F_ModifiedOn,");
- strSql.Append("F_DeleteFlag=@F_DeleteFlag,");
- strSql.Append("F_StatusCode=@F_StatusCode,");
- strSql.Append("F_ServiceDept=@F_ServiceDept,");
- strSql.Append("F_ChargeName=@F_ChargeName,");
- strSql.Append("F_ChargeTelephone=@F_ChargeTelephone,");
- strSql.Append("F_Province=@F_Province,");
- strSql.Append("F_ProductLine=@F_ProductLine,");
- strSql.Append("F_ChargeDept=@F_ChargeDept,");
- strSql.Append("F_AfterSaleName=@F_AfterSaleName,");
- strSql.Append("F_CustomerNature=@F_CustomerNature,");
- strSql.Append("F_CustomerClass=@F_CustomerClass,");
- strSql.Append("F_CustomerIndustry=@F_CustomerIndustry,");
- strSql.Append("F_RelationShipClass=@F_RelationShipClass,");
- strSql.Append("F_CurrentVersion=@F_CurrentVersion,");
- strSql.Append("F_SystemStartTime=@F_SystemStartTime,");
- strSql.Append("F_QualityGuaranteeEndTime=@F_QualityGuaranteeEndTime,");
- strSql.Append("F_AfterSaleTelephone=@F_AfterSaleTelephone,");
- strSql.Append("F_Notes=@F_Notes,");
- strSql.Append("F_SystemType=@F_SystemType,");
- strSql.Append("F_City=@F_City,");
- strSql.Append("F_CustomerStatus=@F_CustomerStatus,");
- strSql.Append("F_DeviceCount=@F_DeviceCount,");
- strSql.Append("F_MaintenanceType=@F_MaintenanceType,");
- strSql.Append("F_ERPCustomerCode=@F_ERPCustomerCode,");
- strSql.Append("F_ServiceDeptID=@F_ServiceDeptID,");
- strSql.Append("F_ProductLineID=@F_ProductLineID,");
- strSql.Append("F_AfterSaleNameID=@F_AfterSaleNameID,");
- strSql.Append("F_CustomerNatureID=@F_CustomerNatureID,");
- strSql.Append("F_CustomerClassID=@F_CustomerClassID,");
- strSql.Append("F_RelationShipClassID=@F_RelationShipClassID,");
- strSql.Append("F_CityID=@F_CityID");
- strSql.Append(" where F_CustomerId=@F_CustomerId");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerName", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerCode", SqlDbType.VarChar,100),
- new SqlParameter("@F_CustomerEName", SqlDbType.NVarChar,800),
- new SqlParameter("@F_CustomerPym", SqlDbType.NVarChar,50),
- new SqlParameter("@F_Layer", SqlDbType.SmallInt,2),
- new SqlParameter("@F_CustomerLayer", SqlDbType.NVarChar,50),
- new SqlParameter("@F_CategoryId", SqlDbType.Int,4),
- new SqlParameter("@F_TradeId", SqlDbType.Int,4),
- new SqlParameter("@F_RegionId", SqlDbType.Int,4),
- new SqlParameter("@F_IndustryId", SqlDbType.Int,4),
- new SqlParameter("@F_Address", SqlDbType.NVarChar,300),
- new SqlParameter("@F_Url", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Telephone", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Mobile", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Fax", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Email", SqlDbType.VarChar,200),
- new SqlParameter("@F_Website", SqlDbType.VarChar,200),
- new SqlParameter("@F_PostCode", SqlDbType.NVarChar,50),
- new SqlParameter("@F_ScaleResume", SqlDbType.NVarChar,2000),
- new SqlParameter("@F_BusinessProfile", SqlDbType.NVarChar,2000),
- new SqlParameter("@F_BusinessLicenseID", SqlDbType.VarChar,80),
- new SqlParameter("@F_TaxID", SqlDbType.VarChar,80),
- new SqlParameter("@F_OpeningBank", SqlDbType.NVarChar,100),
- new SqlParameter("@F_BankAccount", SqlDbType.VarChar,80),
- new SqlParameter("@F_LegalRepresentative", SqlDbType.VarChar,50),
- new SqlParameter("@F_LegalRepresentativeCardID", SqlDbType.VarChar,30),
- new SqlParameter("@F_Nature", SqlDbType.NVarChar,80),
- new SqlParameter("@F_Kind", SqlDbType.NVarChar,80),
- new SqlParameter("@F_CustomerType", SqlDbType.Int,4),
- new SqlParameter("@F_MainProduct", SqlDbType.Text),
- new SqlParameter("@F_CustomerFrom", SqlDbType.NVarChar,200),
- new SqlParameter("@F_TrackInfo", SqlDbType.NVarChar,200),
- new SqlParameter("@F_TrackState", SqlDbType.NVarChar,50),
- new SqlParameter("@F_ImportDegree", SqlDbType.NVarChar,50),
- new SqlParameter("@F_IntentProduct", SqlDbType.Text),
- new SqlParameter("@F_CreateBy", SqlDbType.Int,4),
- new SqlParameter("@F_CreatedOn", SqlDbType.DateTime),
- new SqlParameter("@F_ModifyBy", SqlDbType.Int,4),
- new SqlParameter("@F_ModifiedOn", SqlDbType.DateTime),
- new SqlParameter("@F_DeleteFlag", SqlDbType.SmallInt,2),
- new SqlParameter("@F_StatusCode", SqlDbType.SmallInt,2),
- new SqlParameter("@F_ServiceDept", SqlDbType.NVarChar,20),
- new SqlParameter("@F_ChargeName", SqlDbType.NVarChar,20),
- new SqlParameter("@F_ChargeTelephone", SqlDbType.VarChar,15),
- new SqlParameter("@F_Province", SqlDbType.NVarChar,20),
- new SqlParameter("@F_ProductLine", SqlDbType.NVarChar,50),
- new SqlParameter("@F_ChargeDept", SqlDbType.NVarChar,20),
- new SqlParameter("@F_AfterSaleName", SqlDbType.NVarChar,20),
- new SqlParameter("@F_CustomerNature", SqlDbType.NVarChar,20),
- new SqlParameter("@F_CustomerClass", SqlDbType.NVarChar,10),
- new SqlParameter("@F_CustomerIndustry", SqlDbType.NVarChar,10),
- new SqlParameter("@F_RelationShipClass", SqlDbType.NVarChar,10),
- new SqlParameter("@F_CurrentVersion", SqlDbType.VarChar,100),
- new SqlParameter("@F_SystemStartTime", SqlDbType.DateTime),
- new SqlParameter("@F_QualityGuaranteeEndTime", SqlDbType.DateTime),
- new SqlParameter("@F_AfterSaleTelephone", SqlDbType.VarChar,15),
- new SqlParameter("@F_Notes", SqlDbType.NVarChar,500),
- new SqlParameter("@F_SystemType", SqlDbType.NVarChar,100),
- new SqlParameter("@F_City", SqlDbType.NVarChar,10),
- new SqlParameter("@F_CustomerStatus", SqlDbType.NVarChar,10),
- new SqlParameter("@F_DeviceCount", SqlDbType.Int,4),
- new SqlParameter("@F_MaintenanceType", SqlDbType.NVarChar,30),
- new SqlParameter("@F_ERPCustomerCode", SqlDbType.VarChar,100),
- new SqlParameter("@F_ServiceDeptID", SqlDbType.Int,4),
- new SqlParameter("@F_ProductLineID", SqlDbType.Int,4),
- new SqlParameter("@F_AfterSaleNameID", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerNatureID", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerClassID", SqlDbType.Int,4),
- new SqlParameter("@F_RelationShipClassID", SqlDbType.Int,4),
- new SqlParameter("@F_CityID", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerId", SqlDbType.Int,4)};
- parameters[0].Value = model.F_CustomerName;
- parameters[1].Value = model.F_CustomerCode;
- parameters[2].Value = model.F_CustomerEName;
- parameters[3].Value = model.F_CustomerPym;
- parameters[4].Value = model.F_Layer;
- parameters[5].Value = model.F_CustomerLayer;
- parameters[6].Value = model.F_CategoryId;
- parameters[7].Value = model.F_TradeId;
- parameters[8].Value = model.F_RegionId;
- parameters[9].Value = model.F_IndustryId;
- parameters[10].Value = model.F_Address;
- parameters[11].Value = model.F_Url;
- parameters[12].Value = model.F_Telephone;
- parameters[13].Value = model.F_Mobile;
- parameters[14].Value = model.F_Fax;
- parameters[15].Value = model.F_Email;
- parameters[16].Value = model.F_Website;
- parameters[17].Value = model.F_PostCode;
- parameters[18].Value = model.F_ScaleResume;
- parameters[19].Value = model.F_BusinessProfile;
- parameters[20].Value = model.F_BusinessLicenseID;
- parameters[21].Value = model.F_TaxID;
- parameters[22].Value = model.F_OpeningBank;
- parameters[23].Value = model.F_BankAccount;
- parameters[24].Value = model.F_LegalRepresentative;
- parameters[25].Value = model.F_LegalRepresentativeCardID;
- parameters[26].Value = model.F_Nature;
- parameters[27].Value = model.F_Kind;
- parameters[28].Value = model.F_CustomerType;
- parameters[29].Value = model.F_MainProduct;
- parameters[30].Value = model.F_CustomerFrom;
- parameters[31].Value = model.F_TrackInfo;
- parameters[32].Value = model.F_TrackState;
- parameters[33].Value = model.F_ImportDegree;
- parameters[34].Value = model.F_IntentProduct;
- parameters[35].Value = model.F_CreateBy;
- parameters[36].Value = model.F_CreatedOn;
- parameters[37].Value = model.F_ModifyBy;
- parameters[38].Value = model.F_ModifiedOn;
- parameters[39].Value = model.F_DeleteFlag;
- parameters[40].Value = model.F_StatusCode;
- parameters[41].Value = model.F_ServiceDept;
- parameters[42].Value = model.F_ChargeName;
- parameters[43].Value = model.F_ChargeTelephone;
- parameters[44].Value = model.F_Province;
- parameters[45].Value = model.F_ProductLine;
- parameters[46].Value = model.F_ChargeDept;
- parameters[47].Value = model.F_AfterSaleName;
- parameters[48].Value = model.F_CustomerNature;
- parameters[49].Value = model.F_CustomerClass;
- parameters[50].Value = model.F_CustomerIndustry;
- parameters[51].Value = model.F_RelationShipClass;
- parameters[52].Value = model.F_CurrentVersion;
- parameters[53].Value = model.F_SystemStartTime;
- parameters[54].Value = model.F_QualityGuaranteeEndTime;
- parameters[55].Value = model.F_AfterSaleTelephone;
- parameters[56].Value = model.F_Notes;
- parameters[57].Value = model.F_SystemType;
- parameters[58].Value = model.F_City;
- parameters[59].Value = model.F_CustomerStatus;
- parameters[60].Value = model.F_DeviceCount;
- parameters[61].Value = model.F_MaintenanceType;
- parameters[62].Value = model.F_ERPCustomerCode;
- parameters[63].Value = model.F_ServiceDeptID;
- parameters[64].Value = model.F_ProductLineID;
- parameters[65].Value = model.F_AfterSaleNameID;
- parameters[66].Value = model.F_CustomerNatureID;
- parameters[67].Value = model.F_CustomerClassID;
- parameters[68].Value = model.F_RelationShipClassID;
- parameters[69].Value = model.F_CityID;
- parameters[70].Value = model.F_CustomerId;
- int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
- if (rows > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 删除一条数据
- /// </summary>
- public bool Delete(int F_CustomerId)
- {
- StringBuilder strSql = new StringBuilder();
- //strSql.Append("delete from T_Cus_CustomerBase ");
- strSql.Append("update T_Cus_CustomerBase set F_DeleteFlag=1");
- strSql.Append(" where F_CustomerId=@F_CustomerId");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerId", SqlDbType.Int,4)
- };
- parameters[0].Value = F_CustomerId;
- int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
- if (rows > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 批量删除数据
- /// </summary>
- public bool DeleteList(string F_CustomerIdlist)
- {
- StringBuilder strSql = new StringBuilder();
- //strSql.Append("delete from T_Cus_CustomerBase ");
- strSql.Append("update T_Cus_CustomerBase set F_DeleteFlag=1");
- strSql.Append(" where F_CustomerId in (" + F_CustomerIdlist + ") ");
- int rows = DbHelperSQL.ExecuteSql(strSql.ToString());
- if (rows > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- /// <summary>
- /// 得到一个对象实体
- /// </summary>
- public YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase GetModel(int F_CustomerId)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select top 1 F_CustomerId,F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID from T_Cus_CustomerBase ");
- strSql.Append(" where F_CustomerId=@F_CustomerId");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerId", SqlDbType.Int,4)
- };
- parameters[0].Value = F_CustomerId;
- YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model = new YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase();
- DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
- if (ds.Tables[0].Rows.Count > 0)
- {
- return DataRowToModel(ds.Tables[0].Rows[0]);
- }
- else
- {
- return null;
- }
- }
- /// <summary>
- /// 得到一个对象实体
- /// </summary>
- public YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase DataRowToModel(DataRow row)
- {
- YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model = new YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase();
- if (row != null)
- {
- if (row["F_CustomerId"] != null && row["F_CustomerId"].ToString() != "")
- {
- model.F_CustomerId = int.Parse(row["F_CustomerId"].ToString());
- }
- if (row["F_CustomerName"] != null)
- {
- model.F_CustomerName = row["F_CustomerName"].ToString();
- }
- if (row["F_CustomerCode"] != null)
- {
- model.F_CustomerCode = row["F_CustomerCode"].ToString();
- }
- if (row["F_CustomerEName"] != null)
- {
- model.F_CustomerEName = row["F_CustomerEName"].ToString();
- }
- if (row["F_CustomerPym"] != null)
- {
- model.F_CustomerPym = row["F_CustomerPym"].ToString();
- }
- if (row["F_Layer"] != null && row["F_Layer"].ToString() != "")
- {
- model.F_Layer = int.Parse(row["F_Layer"].ToString());
- }
- if (row["F_CustomerLayer"] != null)
- {
- model.F_CustomerLayer = row["F_CustomerLayer"].ToString();
- }
- if (row["F_CategoryId"] != null && row["F_CategoryId"].ToString() != "")
- {
- model.F_CategoryId = int.Parse(row["F_CategoryId"].ToString());
- }
- if (row["F_TradeId"] != null && row["F_TradeId"].ToString() != "")
- {
- model.F_TradeId = int.Parse(row["F_TradeId"].ToString());
- }
- if (row["F_RegionId"] != null && row["F_RegionId"].ToString() != "")
- {
- model.F_RegionId = int.Parse(row["F_RegionId"].ToString());
- }
- if (row["F_IndustryId"] != null && row["F_IndustryId"].ToString() != "")
- {
- model.F_IndustryId = int.Parse(row["F_IndustryId"].ToString());
- }
- if (row["F_Address"] != null)
- {
- model.F_Address = row["F_Address"].ToString();
- }
- if (row["F_Url"] != null)
- {
- model.F_Url = row["F_Url"].ToString();
- }
- if (row["F_Telephone"] != null)
- {
- model.F_Telephone = row["F_Telephone"].ToString();
- }
- if (row["F_Mobile"] != null)
- {
- model.F_Mobile = row["F_Mobile"].ToString();
- }
- if (row["F_Fax"] != null)
- {
- model.F_Fax = row["F_Fax"].ToString();
- }
- if (row["F_Email"] != null)
- {
- model.F_Email = row["F_Email"].ToString();
- }
- if (row["F_Website"] != null)
- {
- model.F_Website = row["F_Website"].ToString();
- }
- if (row["F_PostCode"] != null)
- {
- model.F_PostCode = row["F_PostCode"].ToString();
- }
- if (row["F_ScaleResume"] != null)
- {
- model.F_ScaleResume = row["F_ScaleResume"].ToString();
- }
- if (row["F_BusinessProfile"] != null)
- {
- model.F_BusinessProfile = row["F_BusinessProfile"].ToString();
- }
- if (row["F_BusinessLicenseID"] != null)
- {
- model.F_BusinessLicenseID = row["F_BusinessLicenseID"].ToString();
- }
- if (row["F_TaxID"] != null)
- {
- model.F_TaxID = row["F_TaxID"].ToString();
- }
- if (row["F_OpeningBank"] != null)
- {
- model.F_OpeningBank = row["F_OpeningBank"].ToString();
- }
- if (row["F_BankAccount"] != null)
- {
- model.F_BankAccount = row["F_BankAccount"].ToString();
- }
- if (row["F_LegalRepresentative"] != null)
- {
- model.F_LegalRepresentative = row["F_LegalRepresentative"].ToString();
- }
- if (row["F_LegalRepresentativeCardID"] != null)
- {
- model.F_LegalRepresentativeCardID = row["F_LegalRepresentativeCardID"].ToString();
- }
- if (row["F_Nature"] != null)
- {
- model.F_Nature = row["F_Nature"].ToString();
- }
- if (row["F_Kind"] != null)
- {
- model.F_Kind = row["F_Kind"].ToString();
- }
- if (row["F_CustomerType"] != null && row["F_CustomerType"].ToString() != "")
- {
- model.F_CustomerType = int.Parse(row["F_CustomerType"].ToString());
- }
- if (row["F_MainProduct"] != null)
- {
- model.F_MainProduct = row["F_MainProduct"].ToString();
- }
- if (row["F_CustomerFrom"] != null)
- {
- model.F_CustomerFrom = row["F_CustomerFrom"].ToString();
- }
- if (row["F_TrackInfo"] != null)
- {
- model.F_TrackInfo = row["F_TrackInfo"].ToString();
- }
- if (row["F_TrackState"] != null)
- {
- model.F_TrackState = row["F_TrackState"].ToString();
- }
- if (row["F_ImportDegree"] != null)
- {
- model.F_ImportDegree = row["F_ImportDegree"].ToString();
- }
- if (row["F_IntentProduct"] != null)
- {
- model.F_IntentProduct = row["F_IntentProduct"].ToString();
- }
- if (row["F_CreateBy"] != null && row["F_CreateBy"].ToString() != "")
- {
- model.F_CreateBy = int.Parse(row["F_CreateBy"].ToString());
- }
- if (row["F_CreatedOn"] != null && row["F_CreatedOn"].ToString() != "")
- {
- model.F_CreatedOn = DateTime.Parse(row["F_CreatedOn"].ToString());
- }
- if (row["F_ModifyBy"] != null && row["F_ModifyBy"].ToString() != "")
- {
- model.F_ModifyBy = int.Parse(row["F_ModifyBy"].ToString());
- }
- if (row["F_ModifiedOn"] != null && row["F_ModifiedOn"].ToString() != "")
- {
- model.F_ModifiedOn = DateTime.Parse(row["F_ModifiedOn"].ToString());
- }
- if (row["F_DeleteFlag"] != null && row["F_DeleteFlag"].ToString() != "")
- {
- model.F_DeleteFlag = int.Parse(row["F_DeleteFlag"].ToString());
- }
- if (row["F_StatusCode"] != null && row["F_StatusCode"].ToString() != "")
- {
- model.F_StatusCode = int.Parse(row["F_StatusCode"].ToString());
- }
- if (row["F_ServiceDept"] != null)
- {
- model.F_ServiceDept = row["F_ServiceDept"].ToString();
- }
- if (row["F_ChargeName"] != null)
- {
- model.F_ChargeName = row["F_ChargeName"].ToString();
- }
- if (row["F_ChargeTelephone"] != null)
- {
- model.F_ChargeTelephone = row["F_ChargeTelephone"].ToString();
- }
- if (row["F_Province"] != null)
- {
- model.F_Province = row["F_Province"].ToString();
- }
- if (row["F_ProductLine"] != null)
- {
- model.F_ProductLine = row["F_ProductLine"].ToString();
- }
- if (row["F_ChargeDept"] != null)
- {
- model.F_ChargeDept = row["F_ChargeDept"].ToString();
- }
- if (row["F_AfterSaleName"] != null)
- {
- model.F_AfterSaleName = row["F_AfterSaleName"].ToString();
- }
- if (row["F_CustomerNature"] != null)
- {
- model.F_CustomerNature = row["F_CustomerNature"].ToString();
- }
- if (row["F_CustomerClass"] != null)
- {
- model.F_CustomerClass = row["F_CustomerClass"].ToString();
- }
- if (row["F_CustomerIndustry"] != null)
- {
- model.F_CustomerIndustry = row["F_CustomerIndustry"].ToString();
- }
- if (row["F_RelationShipClass"] != null)
- {
- model.F_RelationShipClass = row["F_RelationShipClass"].ToString();
- }
- if (row["F_CurrentVersion"] != null)
- {
- model.F_CurrentVersion = row["F_CurrentVersion"].ToString();
- }
- if (row["F_SystemStartTime"] != null && row["F_SystemStartTime"].ToString() != "")
- {
- model.F_SystemStartTime = DateTime.Parse(row["F_SystemStartTime"].ToString());
- }
- if (row["F_QualityGuaranteeEndTime"] != null && row["F_QualityGuaranteeEndTime"].ToString() != "")
- {
- model.F_QualityGuaranteeEndTime = DateTime.Parse(row["F_QualityGuaranteeEndTime"].ToString());
- }
- if (row["F_AfterSaleTelephone"] != null)
- {
- model.F_AfterSaleTelephone = row["F_AfterSaleTelephone"].ToString();
- }
- if (row["F_Notes"] != null)
- {
- model.F_Notes = row["F_Notes"].ToString();
- }
- if (row["F_SystemType"] != null)
- {
- model.F_SystemType = row["F_SystemType"].ToString();
- }
- if (row["F_City"] != null)
- {
- model.F_City = row["F_City"].ToString();
- }
- if (row["F_CustomerStatus"] != null)
- {
- model.F_CustomerStatus = row["F_CustomerStatus"].ToString();
- }
- if (row["F_DeviceCount"] != null && row["F_DeviceCount"].ToString() != "")
- {
- model.F_DeviceCount = int.Parse(row["F_DeviceCount"].ToString());
- }
- if (row["F_MaintenanceType"] != null)
- {
- model.F_MaintenanceType = row["F_MaintenanceType"].ToString();
- }
- if (row["F_ERPCustomerCode"] != null)
- {
- model.F_ERPCustomerCode = row["F_ERPCustomerCode"].ToString();
- }
- if (row["F_ServiceDeptID"] != null && row["F_ServiceDeptID"].ToString() != "")
- {
- model.F_ServiceDeptID = int.Parse(row["F_ServiceDeptID"].ToString());
- }
- if (row["F_ProductLineID"] != null && row["F_ProductLineID"].ToString() != "")
- {
- model.F_ProductLineID = int.Parse(row["F_ProductLineID"].ToString());
- }
- if (row["F_AfterSaleNameID"] != null && row["F_AfterSaleNameID"].ToString() != "")
- {
- model.F_AfterSaleNameID = int.Parse(row["F_AfterSaleNameID"].ToString());
- }
- if (row["F_CustomerNatureID"] != null && row["F_CustomerNatureID"].ToString() != "")
- {
- model.F_CustomerNatureID = int.Parse(row["F_CustomerNatureID"].ToString());
- }
- if (row["F_CustomerClassID"] != null && row["F_CustomerClassID"].ToString() != "")
- {
- model.F_CustomerClassID = int.Parse(row["F_CustomerClassID"].ToString());
- }
- if (row["F_RelationShipClassID"] != null && row["F_RelationShipClassID"].ToString() != "")
- {
- model.F_RelationShipClassID = int.Parse(row["F_RelationShipClassID"].ToString());
- }
- if (row["F_CityID"] != null && row["F_CityID"].ToString() != "")
- {
- model.F_CityID = int.Parse(row["F_CityID"].ToString());
- }
- }
- return model;
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public DataSet GetList(string strWhere)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select F_CustomerId,F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID ");
- strSql.Append(" FROM T_Cus_CustomerBase ");
- 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(" F_CustomerId,F_CustomerName,F_CustomerCode,F_CustomerEName,F_CustomerPym,F_Layer,F_CustomerLayer,F_CategoryId,F_TradeId,F_RegionId,F_IndustryId,F_Address,F_Url,F_Telephone,F_Mobile,F_Fax,F_Email,F_Website,F_PostCode,F_ScaleResume,F_BusinessProfile,F_BusinessLicenseID,F_TaxID,F_OpeningBank,F_BankAccount,F_LegalRepresentative,F_LegalRepresentativeCardID,F_Nature,F_Kind,F_CustomerType,F_MainProduct,F_CustomerFrom,F_TrackInfo,F_TrackState,F_ImportDegree,F_IntentProduct,F_CreateBy,F_CreatedOn,F_ModifyBy,F_ModifiedOn,F_DeleteFlag,F_StatusCode,F_ServiceDept,F_ChargeName,F_ChargeTelephone,F_Province,F_ProductLine,F_ChargeDept,F_AfterSaleName,F_CustomerNature,F_CustomerClass,F_CustomerIndustry,F_RelationShipClass,F_CurrentVersion,F_SystemStartTime,F_QualityGuaranteeEndTime,F_AfterSaleTelephone,F_Notes,F_SystemType,F_City,F_CustomerStatus,F_DeviceCount,F_MaintenanceType,F_ERPCustomerCode,F_ServiceDeptID,F_ProductLineID,F_AfterSaleNameID,F_CustomerNatureID,F_CustomerClassID,F_RelationShipClassID,F_CityID ");
- strSql.Append(" FROM T_Cus_CustomerBase ");
- if (strWhere.Trim() != "")
- {
- strSql.Append(" where " + strWhere);
- }
- strSql.Append(" order by " + filedOrder);
- return DbHelperSQL.Query(strSql.ToString());
- }
- /// <summary>
- /// 获取记录总数
- /// </summary>
- public int GetRecordCount(string strWhere)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select count(1) FROM T_Cus_CustomerBase ");
- if (strWhere.Trim() != "")
- {
- strSql.Append(" where " + strWhere);
- }
- object obj = DbHelperSQL.GetSingle(strSql.ToString());
- if (obj == null)
- {
- return 0;
- }
- else
- {
- return Convert.ToInt32(obj);
- }
- }
- /// <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);
- }
- else
- {
- strSql.Append("order by T.F_CustomerId desc");
- }
- strSql.Append(")AS Row, T.* from T_Cus_CustomerBase T ");
- if (!string.IsNullOrEmpty(strWhere.Trim()))
- {
- strSql.Append(" WHERE " + strWhere);
- }
- strSql.Append(" ) TT");
- strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
- return DbHelperSQL.Query(strSql.ToString());
- }
- /*
- /// <summary>
- /// 分页获取数据列表
- /// </summary>
- public DataSet GetList(int PageSize,int PageIndex,string strWhere)
- {
- SqlParameter[] parameters = {
- new SqlParameter("@tblName", SqlDbType.VarChar, 255),
- new SqlParameter("@fldName", SqlDbType.VarChar, 255),
- new SqlParameter("@PageSize", SqlDbType.Int),
- new SqlParameter("@PageIndex", SqlDbType.Int),
- new SqlParameter("@IsReCount", SqlDbType.Bit),
- new SqlParameter("@OrderType", SqlDbType.Bit),
- new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
- };
- parameters[0].Value = "T_Cus_CustomerBase";
- parameters[1].Value = "F_CustomerId";
- parameters[2].Value = PageSize;
- parameters[3].Value = PageIndex;
- parameters[4].Value = 0;
- parameters[5].Value = 0;
- parameters[6].Value = strWhere;
- return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
- }*/
- #endregion BasicMethod
- #region 获取客户信息通过电话号码
- /// <summary>
- /// 获取客户信息通过电话号码
- /// </summary>
- /// <param name="pnoneNumber">电话号码</param>
- /// <returns></returns>
- public YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase GetCusInfoModel(string pnoneNumber)
- {
- StringBuilder strSql = new StringBuilder();
- strSql.Append("select top 1 * from T_Cus_CustomerBase ");
- strSql.Append(" where F_Telephone = '" + pnoneNumber + "' order by F_CustomerId desc ");
- YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model = new YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase();
- DataSet ds = DbHelperSQL.Query(strSql.ToString());
- if (ds.Tables[0].Rows.Count > 0)
- {
- return DataRowToModel(ds.Tables[0].Rows[0]);
- }
- else
- {
- return model;
- }
- }
- /// <summary>
- /// 获取客户信息通过微信号/微博号
- /// </summary>
- /// <param name="types">1、微信号/2、微博号</param>
- /// <param name="pnoneNumber">微信号/微博号</param>
- /// <returns></returns>
- public YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase GetCusInfoModel(int types, string pnoneNumber)
- {
- StringBuilder strSql = new StringBuilder();
- if (types == 1)//微信
- {
- strSql.Append("select top 1 * from T_Cus_CustomerBase ");
- strSql.Append(" where F_CustomerEName=@F_CustomerEName order by F_CustomerId desc ");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerEName", SqlDbType.NVarChar ,50)
- };
- parameters[0].Value = pnoneNumber;
- YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model = new YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase();
- DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
- if (ds.Tables[0].Rows.Count > 0)
- {
- return DataRowToModel(ds.Tables[0].Rows[0]);
- }
- else
- {
- return model;
- }
- }
- else if (types == 2)//微博
- {
- strSql.Append("select top 1 * from T_Cus_CustomerBase ");
- strSql.Append(" where F_PostCode=@F_PostCode order by F_CustomerId desc ");
- SqlParameter[] parameters = {
- new SqlParameter("@F_PostCode", SqlDbType.NVarChar ,50)
- };
- parameters[0].Value = pnoneNumber;
- YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model = new YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase();
- DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
- if (ds.Tables[0].Rows.Count > 0)
- {
- return DataRowToModel(ds.Tables[0].Rows[0]);
- }
- else
- {
- return model;
- }
- }
- else
- {
- return new Model.T_Cus_CustomerBase();
- }
- }
- #endregion ExtensionMethod
- #region 编辑用户信息
- /// <summary>
- /// 获取客户信息通过电话号码
- /// </summary>
- /// <param name="pnoneNumber">电话号码</param>
- /// <returns></returns>
- public bool UpdateCusInfoModel(YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model)
- {
- StringBuilder strSql = new StringBuilder();
- if (model.F_CustomerId > 0)
- {
- strSql.Append("update T_Cus_CustomerBase set ");
- strSql.Append("F_CustomerName=@F_CustomerName,");
- strSql.Append("F_CustomerPym=@F_CustomerPym,");
- strSql.Append("F_CustomerEName=@F_CustomerEName,");
- strSql.Append("F_PostCode=@F_PostCode,");
- strSql.Append("F_CustomerLayer=@F_CustomerLayer,");
- strSql.Append("F_CustomerCode=@F_CustomerCode,");
- strSql.Append("F_Telephone=@F_Telephone,");
- strSql.Append("F_Kind=@F_Kind,");
- strSql.Append("F_CustomerNature=@F_CustomerNature,");
- strSql.Append("F_ScaleResume=@F_ScaleResume,");
- strSql.Append("F_CustomerClass=@F_CustomerClass,");
- strSql.Append("F_ModifyBy=@F_ModifyBy,");
- strSql.Append("F_ModifiedOn=getdate()");
- strSql.Append(" where F_CustomerId=@F_CustomerId");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerName", model.F_CustomerName),
- new SqlParameter("@F_CustomerPym", model.F_CustomerPym),
- new SqlParameter("@F_CustomerEName", model.F_CustomerEName),
- new SqlParameter("@F_PostCode", model.F_PostCode),
- new SqlParameter("@F_CustomerLayer", model.F_CustomerLayer),
- new SqlParameter("@F_CustomerCode", model.F_CustomerCode),
- new SqlParameter("@F_Telephone", model.F_Telephone),
- new SqlParameter("@F_Kind", model.F_Kind),
- new SqlParameter("@F_CustomerNature", model.F_CustomerNature),
- new SqlParameter("@F_ScaleResume", model.F_ScaleResume),
- new SqlParameter("@F_CustomerClass",model.F_CustomerClass),
- new SqlParameter("@F_ModifyBy",model.F_ModifyBy),
- new SqlParameter("@F_CustomerId", model.F_CustomerId)};
- //parameters[0].Value = model.F_CustomerName;
- //parameters[1].Value = model.F_CustomerPym;
- //parameters[2].Value = model.F_CustomerEName;
- //parameters[3].Value = model.F_PostCode;
- //parameters[4].Value = model.F_CustomerLayer;
- //parameters[5].Value = model.F_CustomerCode;
- //parameters[6].Value = model.F_Telephone;
- //parameters[7].Value = model.F_Kind;
- //parameters[8].Value = model.F_CustomerNature;
- //parameters[9].Value = model.F_ScaleResume;
- //parameters[10].Value = model.F_CustomerClass;
- //parameters[11].Value = model.F_ModifyBy;
- //parameters[12].Value = model.F_CustomerId;
- int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
- if (rows > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- strSql.Append("insert into T_Cus_CustomerBase(");
- strSql.Append("F_CustomerName,F_CustomerPym,F_CustomerEName,F_PostCode,F_CustomerLayer,F_CustomerCode,F_Telephone,F_Kind,F_CustomerNature,F_ScaleResume,F_CustomerClass,F_CreateBy,F_CreatedOn,F_ModifiedOn)");
- strSql.Append(" values (@F_CustomerName,@F_CustomerPym,@F_CustomerEName,@F_PostCode,@F_CustomerLayer,@F_CustomerCode,@F_Telephone,@F_Kind,@F_CustomerNature,@F_ScaleResume,@F_CustomerClass,@F_CreateBy,getdate(),getdate())");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerName", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerPym", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerEName", SqlDbType.NVarChar,200),
- new SqlParameter("@F_PostCode", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerLayer", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerCode", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Telephone", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Kind", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerNature", SqlDbType.NVarChar,200),
- new SqlParameter("@F_ScaleResume", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerClass", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CreateBy", SqlDbType.Int,4) };
- parameters[0].Value = model.F_CustomerName;
- parameters[1].Value = model.F_CustomerPym;
- parameters[2].Value = model.F_CustomerEName;
- parameters[3].Value = model.F_PostCode;
- parameters[4].Value = model.F_CustomerLayer;
- parameters[5].Value = model.F_CustomerCode;
- parameters[6].Value = model.F_Telephone;
- parameters[7].Value = model.F_Kind;
- parameters[8].Value = model.F_CustomerNature;
- parameters[9].Value = model.F_ScaleResume;
- parameters[10].Value = model.F_CustomerClass;
- parameters[11].Value = model.F_CreateBy;
- int obj = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
- if (obj > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
- /// <summary>
- /// 包含工单信息的客户信息
- /// </summary>
- /// <param name="pnoneNumber">电话号码</param>
- /// <returns></returns>
- public int EditCusInfoModel(YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase model)
- {
- StringBuilder strSql = new StringBuilder();
- if (model.F_CustomerId > 1)
- {
- strSql.Append("update T_Cus_CustomerBase set ");
- strSql.Append("F_CustomerName=@F_CustomerName,");
- strSql.Append("F_CustomerPym=@F_CustomerPym,");
- strSql.Append("F_CustomerCode=@F_CustomerCode,");
- strSql.Append("F_Kind=@F_Kind,");
- strSql.Append("F_CustomerNature=@F_CustomerNature,");
- //strSql.Append("F_ScaleResume=@F_ScaleResume,");//客户等级
- //strSql.Append("F_CustomerClass=@F_CustomerClass,");
- strSql.Append("F_DeviceCount=@F_DeviceCount,");
- strSql.Append("F_Fax=@F_Fax,");
- strSql.Append("F_AfterSaleNameID=@F_AfterSaleNameID,");
- strSql.Append("F_Email=@F_Email,");
- strSql.Append("F_IndustryId=@F_IndustryId,");
- strSql.Append("F_Url=@F_Url,");
- strSql.Append("F_ModifyBy=@F_ModifyBy,");
- strSql.Append("F_Mobile=@F_Mobile,");
- strSql.Append("F_ModifiedOn=getdate()");
- strSql.Append(" where F_CustomerId=@F_CustomerId");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerName", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerPym", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerCode", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Kind", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerNature", SqlDbType.NVarChar,200),
- //new SqlParameter("@F_ScaleResume", SqlDbType.Int,4),
- //new SqlParameter("@F_CustomerClass", SqlDbType.NVarChar,200),
- new SqlParameter("@F_DeviceCount", SqlDbType.Int,4),
- new SqlParameter("@F_Fax", SqlDbType.NVarChar,200),
- new SqlParameter("@F_AfterSaleNameID", SqlDbType.Int,4),
- new SqlParameter("@F_Email", SqlDbType.NVarChar,200),
- new SqlParameter("@F_IndustryId", SqlDbType.Int,4),
- new SqlParameter("@F_Url", SqlDbType.NVarChar,200),
- new SqlParameter("@F_ModifyBy", SqlDbType.Int,4),
- new SqlParameter("@F_Mobile", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerId", SqlDbType.Int,4)};
- parameters[0].Value = model.F_CustomerName;
- parameters[1].Value = model.F_CustomerPym;
- parameters[2].Value = model.F_CustomerCode;
- parameters[3].Value = model.F_Kind;
- parameters[4].Value = model.F_CustomerNature;
- //parameters[5].Value = model.F_ScaleResume;
- //parameters[6].Value = model.F_CustomerClass;
- parameters[5].Value = model.F_DeviceCount;
- parameters[6].Value = model.F_Fax;
- parameters[7].Value = model.F_AfterSaleNameID;
- parameters[8].Value = model.F_Email;
- parameters[9].Value = model.F_IndustryId;
- parameters[10].Value = model.F_Url;
- parameters[11].Value = model.F_ModifyBy;
- parameters[12].Value = model.F_Mobile;
- parameters[13].Value = model.F_CustomerId;
- int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
- if (rows > 0)
- {
- return model.F_CustomerId;
- }
- else
- {
- return 0;
- }
- }
- else
- {
- strSql.Append("insert into T_Cus_CustomerBase(");
- strSql.Append("F_CustomerName,F_CustomerPym,F_CustomerEName,F_PostCode,F_CustomerLayer,F_CustomerCode,F_Telephone,F_Kind,F_CustomerNature,F_ScaleResume,F_CustomerClass,F_DeviceCount,F_Fax,F_AfterSaleNameID,F_Email,F_IndustryId,F_Url,F_Mobile,F_CreateBy,F_CreatedOn,F_ModifiedOn)");
- strSql.Append(" values (@F_CustomerName,@F_CustomerPym,@F_CustomerEName,@F_PostCode,@F_CustomerLayer,@F_CustomerCode,@F_Telephone,@F_Kind,@F_CustomerNature,@F_ScaleResume,@F_CustomerClass,@F_DeviceCount,@F_Fax,@F_AfterSaleNameID,@F_Email,@F_IndustryId,@F_Url,@F_Mobile,@F_CreateBy,getdate(),getdate())");
- strSql.Append(";select @@IDENTITY");
- SqlParameter[] parameters = {
- new SqlParameter("@F_CustomerName", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerPym", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerEName", SqlDbType.NVarChar,200),
- new SqlParameter("@F_PostCode", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerLayer", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CustomerCode", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Telephone", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Kind", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerNature", SqlDbType.NVarChar,200),
- new SqlParameter("@F_ScaleResume", SqlDbType.Int,4),
- new SqlParameter("@F_CustomerClass", SqlDbType.NVarChar,200),
- new SqlParameter("@F_DeviceCount", SqlDbType.Int,4),
- new SqlParameter("@F_Fax", SqlDbType.NVarChar,200),
- new SqlParameter("@F_AfterSaleNameID", SqlDbType.Int,4),
- new SqlParameter("@F_Email", SqlDbType.NVarChar,200),
- new SqlParameter("@F_IndustryId", SqlDbType.Int,4),
- new SqlParameter("@F_Url", SqlDbType.NVarChar,200),
- new SqlParameter("@F_Mobile", SqlDbType.NVarChar,200),
- new SqlParameter("@F_CreateBy", SqlDbType.Int,4) };
- parameters[0].Value = model.F_CustomerName;
- parameters[1].Value = model.F_CustomerPym;
- parameters[2].Value = model.F_CustomerEName;
- parameters[3].Value = model.F_PostCode;
- parameters[4].Value = model.F_CustomerLayer;
- parameters[5].Value = model.F_CustomerCode;
- parameters[6].Value = model.F_Telephone;
- parameters[7].Value = model.F_Kind;
- parameters[8].Value = model.F_CustomerNature;
- parameters[9].Value = model.F_ScaleResume;
- parameters[10].Value = model.F_CustomerClass;
- parameters[11].Value = model.F_DeviceCount;
- parameters[12].Value = model.F_Fax;
- parameters[13].Value = model.F_AfterSaleNameID;
- parameters[14].Value = model.F_Email;
- parameters[15].Value = model.F_IndustryId;
- parameters[16].Value = model.F_Url;
- parameters[17].Value = model.F_Mobile;
- parameters[18].Value = model.F_CreateBy;
- object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
- if (obj == null)
- {
- return 0;
- }
- else
- {
- return Convert.ToInt32(obj);
- }
- }
- }
- #endregion ExtensionMethod
- #region 编辑用户状态
- /// <summary>
- /// 获取客户信息通过电话号码
- /// </summary>
- /// <param name="pnoneNumber">电话号码</param>
- /// <returns></returns>
- public bool EditCustonStatus(string fidStr, int status,int createuserid=0)
- {
- bool result = false;
- StringBuilder strSql = new StringBuilder();
- if (!string.IsNullOrEmpty(fidStr) && status > 0)
- {
- string statusName = "一般客户";
- if (status == 1)
- {
- statusName = "一般客户";
- #region 取消黑名单
- try
- {
- string arrid = "";
- foreach (string cid in fidStr.Split(','))
- {
- arrid += "'" + cid.Trim() + "',";
- }
- arrid += "!@#";
- arrid = arrid.Replace(",!@#", "").Replace("!@#", "");
- int c = DbHelperSQL.ExecuteSql("UPDATE [T_Call_Blacklist] SET [F_IsDelete] = 1 WHERE [F_CallId] in(" + arrid + ")");
- }
- catch
- {
- }
- #endregion
- }
- else if (status == 2)
- {
- statusName = "特别关注";
- #region 取消黑名单
- try
- {
- string arrid = "";
- foreach (string cid in fidStr.Split(','))
- {
- arrid += "'" + cid.Trim() + "',";
- }
- arrid += "!@#";
- arrid = arrid.Replace(",!@#", "").Replace("!@#", "");
- int c = DbHelperSQL.ExecuteSql("UPDATE [T_Call_Blacklist] SET [F_IsDelete] = 1 WHERE [F_CallId] in(" + arrid + ")");
- }
- catch
- {
- }
- #endregion
- }
- else if (status == 3)
- {
- statusName = "黑名单";
- #region 添加到黑名单表
- DataTable dt = new DataTable();
- try
- {
- dt = GetList(" F_CustomerId in (" + fidStr + ") ").Tables[0];
- foreach (DataRow dr in dt.Rows)
- {
- try
- {
- string phone = dr["F_Telephone"].ToString();
- if (phone == "" || phone == "null")
- {
- phone = dr["F_Mobile"].ToString();
- }
- if (phone != "")
- {
- #region 判断是否为白名单
- if (GetRecordCount(string.Format(" F_CustomerClass='白名单' and (F_Telephone='{0}' or F_Mobile='{0}')", phone)) > 0)
- {
- //白名单不能加入黑名单 客户没有要求,先注释
- //continue;
- }
- #endregion
- Model.T_Call_Blacklist orderModel = new Model.T_Call_Blacklist();
- orderModel.F_TelPhone = phone;
- orderModel.F_CallId = dr["F_CustomerId"].ToString().Trim();
- orderModel.F_SetTime = DateTime.Now;
- orderModel.F_RemoveTime = DateTime.Now.AddYears(10);
- orderModel.F_Describe = "客户id:" + dr["F_CustomerId"].ToString();
- orderModel.F_InterceptNum = 0;
- orderModel.F_UserId = createuserid;
- int count = new T_Call_Blacklist().Add(orderModel);
- }
- }
- catch
- { }
- }
- }
- catch
- {
- }
- finally
- {
- dt.Clear();
- dt.Dispose();
- }
- #endregion
- }
- else if (status == 4)
- {
- statusName = "白名单";
- #region 取消黑名单
- try
- {
- string arrid = "";
- foreach (string cid in fidStr.Split(','))
- {
- arrid += "'" + cid.Trim() + "',";
- }
- arrid += "!@#";
- arrid = arrid.Replace(",!@#", "").Replace("!@#", "");
- int c = DbHelperSQL.ExecuteSql("UPDATE [T_Call_Blacklist] SET [F_IsDelete] = 1 WHERE [F_CallId] in(" + arrid + ")");
- }
- catch
- {
- }
- #endregion
- }
- strSql.Append("update T_Cus_CustomerBase set ");
- strSql.Append("F_ScaleResume=" + status + ",");
- strSql.Append("F_CreateBy=" + createuserid + ",");
- strSql.Append("F_CustomerClass='" + statusName + "'");
- strSql.Append(" where F_CustomerId in (" + fidStr + ")");
- return DbHelperSQL.ExecuteSql(strSql.ToString()) > 0;
- }
- return result;
- }
- #endregion
- }
- }
|