2023年6月21日发(作者:)
IDbDataParameter的使⽤及数据⼯⼚IDbDataParameter[] para=DbParameters(11)//DbFactory为数据⼯⼚,括号⾥的为要创建的参数的个数param[0].ParameterName=''@CreateUser";param[0].Value=''CreaterUser的值";..............................................................param[11].ParameterName=''@SearchUser";param[0].Value=''SearchUser的值"; public static List
ctNumber, nter, , ion, yName, yAddress,
umber, fyNumber, countBank, count, PoNo,
Name, cy, eSum, eTime, sCompany, sNo, sTime, eNumber, eUser, , eID,"); (@"ctNo, tNo, ype, ctMoney, dateTime,"); (@"tNo, tName, , , dateTime"); (" from tbInvoice a"); (" left join forinvoicesystem_Po b on ctnumber=ctno"); (" left join forinvoicesystem_project c on tno=tno where 1=1"); if (!OrEmpty(ng())) { (" and (User=@CreateUser or =@CreateUser or =@CreateUser)"); } if (!OrEmpty(ime) && !OrEmpty(e)) { (" and (Time>@startTime and CreateTime<@endTime)"); } if (!OrEmpty(tNumber)) { (" and tNumber like @ProjectNumber"); } if (!OrEmpty(nter)) { (" and nter=@CostCenter"); } if (!OrEmpty(eType)) { (" and eType=@InvoiceType"); } else { eType = ; } } if (!OrEmpty(eStatus)) { (" and eStatus=@invoiceStatus"); } if (!OrEmpty() && !OrEmpty()) { (" and (=@AM and =@PM)"); } else { if (!OrEmpty()) { (" and =@AM"); } if (!OrEmpty()) { (" and =@PM"); } } if (!OrEmpty(tName)) { (" and tName like @ProjectName"); } if (!OrEmpty(User)) { (" and User = @SearchUser"); } (" order by desc"); IDbDataParameter[] param = DbParameters(11); param[0].ParameterName = "@CreateUser"; param[0].Value = User; param[1].ParameterName = "@startTime"; param[1].Value = ime; param[2].ParameterName = "@endTime"; param[2].Value = e; param[3].ParameterName = "@ProjectNumber"; param[3].Value = "%" + () + "%"; param[4].ParameterName = "@CostCenter"; param[4].Value = nter; param[5].ParameterName = "@InvoiceType"; param[5].Value = eType; param[6].ParameterName = "@invoiceStatus"; param[6].Value = eStatus; param[7].ParameterName = "@AM"; param[7].Value = ; param[8].ParameterName = "@PM"; param[8].Value = ; param[9].ParameterName = "@ProjectName"; param[9].Value = "%" + tName + "%"; param[10].ParameterName = "@SearchUser"; param[10].Value = User; using (IDataReader reader = eReader(tionString,, ng(), param)) { { while (()) { ie = new InvoiceEntity(); = 32(reader, "ID"); eType = 32(reader, "InvoiceType"); th = ing(reader, "FilePath"); = ing(reader, "Rate"); yAddress = ing(reader, "CompanyAddress"); umber = ing(reader, "PhoneNumber"); fyNumber = ing(reader, "IdentifyNumber"); countBank = ing(reader, "OpenAccountBank"); count = ing(reader, "BankAccount"); PoNo = ing(reader, "ClientPoNo"); Name = ing(reader, "ClientName"); cy = ing(reader, "Currency"); eSum = imal(reader, "InvoiceSum"); eTime = eTime(reader, "OperateTime"); = ing(reader, "Memo"); sTime = ing(reader, "ExpressTime"); eNumber = ing(reader, "InvoiceNumber"); eUser = ing(reader, "OperateUser"); eStatus = 32(reader, "InvoiceStatus"); sCompany = ing(reader, "ExpressCompany"); sNo = ing(reader, "ExpressNo"); Time = eTime(reader, "CreateTime"); User = ing(reader, "CreateUser"); ctNumber = ing(reader, "ContractNumber"); tNumber = ing(reader, "ProjectNumber"); nter = ing(reader, "CostCenter"); ion = ing(reader, "Extension"); eID = d(reader, "InvoiceID").ToString(); yName = ing(reader, "CompanyName"); //ID, InvoiceType, CreateTime, CreateUser, FilePath, InvoiceStatus, ProjectNumber,
//ContractNumber, CostCenter, Rate, Extension, CompanyName, CompanyAddress,
//PhoneNumber, IdentifyNumber, OpenAccountBank, BankAccount, ClientPoNo,
//ClientName, Currency, InvoiceSum, OperateTime, ExpressCompany, ExpressNo, //ExpressTime, InvoiceNumber, OperateUser, Memo, InvoiceID = new PoEntity(); ctMoney = imal(reader, "ContractMoney"); ctNo = ing(reader, "ContractNo"); dateTime = eTime(reader, "LastUpdateTime"); ype = ing(reader, "MoneyType"); tNo = 64(reader, "ProjectNo"); t = new ProjectEntity(); tName = ing(reader, "ProjectName"); tNo = 64(reader, "ProjectNo").ToString(); dateTime = eTime(reader, "LastUpdateTime"); = ing(reader, "am"); = ing(reader, "pm"); (ie); } } return list; return list; }DbFactory的⼯⼚using System;using c;using ;using ;using ;using Utility;using ent;using Client;using ;namespace BaseDataAccess{ public class DbFactory { ///
2023年6月21日发(作者:)
IDbDataParameter的使⽤及数据⼯⼚IDbDataParameter[] para=DbParameters(11)//DbFactory为数据⼯⼚,括号⾥的为要创建的参数的个数param[0].ParameterName=''@CreateUser";param[0].Value=''CreaterUser的值";..............................................................param[11].ParameterName=''@SearchUser";param[0].Value=''SearchUser的值"; public static List
ctNumber, nter, , ion, yName, yAddress,
umber, fyNumber, countBank, count, PoNo,
Name, cy, eSum, eTime, sCompany, sNo, sTime, eNumber, eUser, , eID,"); (@"ctNo, tNo, ype, ctMoney, dateTime,"); (@"tNo, tName, , , dateTime"); (" from tbInvoice a"); (" left join forinvoicesystem_Po b on ctnumber=ctno"); (" left join forinvoicesystem_project c on tno=tno where 1=1"); if (!OrEmpty(ng())) { (" and (User=@CreateUser or =@CreateUser or =@CreateUser)"); } if (!OrEmpty(ime) && !OrEmpty(e)) { (" and (Time>@startTime and CreateTime<@endTime)"); } if (!OrEmpty(tNumber)) { (" and tNumber like @ProjectNumber"); } if (!OrEmpty(nter)) { (" and nter=@CostCenter"); } if (!OrEmpty(eType)) { (" and eType=@InvoiceType"); } else { eType = ; } } if (!OrEmpty(eStatus)) { (" and eStatus=@invoiceStatus"); } if (!OrEmpty() && !OrEmpty()) { (" and (=@AM and =@PM)"); } else { if (!OrEmpty()) { (" and =@AM"); } if (!OrEmpty()) { (" and =@PM"); } } if (!OrEmpty(tName)) { (" and tName like @ProjectName"); } if (!OrEmpty(User)) { (" and User = @SearchUser"); } (" order by desc"); IDbDataParameter[] param = DbParameters(11); param[0].ParameterName = "@CreateUser"; param[0].Value = User; param[1].ParameterName = "@startTime"; param[1].Value = ime; param[2].ParameterName = "@endTime"; param[2].Value = e; param[3].ParameterName = "@ProjectNumber"; param[3].Value = "%" + () + "%"; param[4].ParameterName = "@CostCenter"; param[4].Value = nter; param[5].ParameterName = "@InvoiceType"; param[5].Value = eType; param[6].ParameterName = "@invoiceStatus"; param[6].Value = eStatus; param[7].ParameterName = "@AM"; param[7].Value = ; param[8].ParameterName = "@PM"; param[8].Value = ; param[9].ParameterName = "@ProjectName"; param[9].Value = "%" + tName + "%"; param[10].ParameterName = "@SearchUser"; param[10].Value = User; using (IDataReader reader = eReader(tionString,, ng(), param)) { { while (()) { ie = new InvoiceEntity(); = 32(reader, "ID"); eType = 32(reader, "InvoiceType"); th = ing(reader, "FilePath"); = ing(reader, "Rate"); yAddress = ing(reader, "CompanyAddress"); umber = ing(reader, "PhoneNumber"); fyNumber = ing(reader, "IdentifyNumber"); countBank = ing(reader, "OpenAccountBank"); count = ing(reader, "BankAccount"); PoNo = ing(reader, "ClientPoNo"); Name = ing(reader, "ClientName"); cy = ing(reader, "Currency"); eSum = imal(reader, "InvoiceSum"); eTime = eTime(reader, "OperateTime"); = ing(reader, "Memo"); sTime = ing(reader, "ExpressTime"); eNumber = ing(reader, "InvoiceNumber"); eUser = ing(reader, "OperateUser"); eStatus = 32(reader, "InvoiceStatus"); sCompany = ing(reader, "ExpressCompany"); sNo = ing(reader, "ExpressNo"); Time = eTime(reader, "CreateTime"); User = ing(reader, "CreateUser"); ctNumber = ing(reader, "ContractNumber"); tNumber = ing(reader, "ProjectNumber"); nter = ing(reader, "CostCenter"); ion = ing(reader, "Extension"); eID = d(reader, "InvoiceID").ToString(); yName = ing(reader, "CompanyName"); //ID, InvoiceType, CreateTime, CreateUser, FilePath, InvoiceStatus, ProjectNumber,
//ContractNumber, CostCenter, Rate, Extension, CompanyName, CompanyAddress,
//PhoneNumber, IdentifyNumber, OpenAccountBank, BankAccount, ClientPoNo,
//ClientName, Currency, InvoiceSum, OperateTime, ExpressCompany, ExpressNo, //ExpressTime, InvoiceNumber, OperateUser, Memo, InvoiceID = new PoEntity(); ctMoney = imal(reader, "ContractMoney"); ctNo = ing(reader, "ContractNo"); dateTime = eTime(reader, "LastUpdateTime"); ype = ing(reader, "MoneyType"); tNo = 64(reader, "ProjectNo"); t = new ProjectEntity(); tName = ing(reader, "ProjectName"); tNo = 64(reader, "ProjectNo").ToString(); dateTime = eTime(reader, "LastUpdateTime"); = ing(reader, "am"); = ing(reader, "pm"); (ie); } } return list; return list; }DbFactory的⼯⼚using System;using c;using ;using ;using ;using Utility;using ent;using Client;using ;namespace BaseDataAccess{ public class DbFactory { ///
发布评论