コード例 #1
0
        public List<Baccount> RetrieveBaccountsPaging(BaccountSearch info,int pageIndex, int pageSize,out int count)
        {
            try
            {
                StringBuilder sqlCommand = new StringBuilder(@" SELECT ""BACCOUNT"".""ASSETNO"",""BACCOUNT"".""ASSETNAME"",""BACCOUNT"".""ACCOUNTEDDATE"",""BACCOUNT"".""ACCOUNTEDUSER"",""BACCOUNT"".""CREATEDDATE"",
                     ""BACCOUNT"".""CREATEDUSER""
                     FROM ""BACCOUNT""
                     WHERE 1=1");
                if (!string.IsNullOrEmpty(info.Assetno))
                {
                    this.Database.AddInParameter(":Assetno",DbType.AnsiString,"%"+info.Assetno+"%");
                    sqlCommand.AppendLine(@" AND ""BACCOUNT"".""ASSETNO"" LIKE :Assetno");
                }
                if (!string.IsNullOrEmpty(info.Assetname))
                {
                    this.Database.AddInParameter(":Assetname", "%"+info.Assetname+"%");
                    sqlCommand.AppendLine(@" AND ""BACCOUNT"".""ASSETNAME"" LIKE :Assetname");
                }
                if (info.StartAccounteddate.HasValue)
                {
                    this.Database.AddInParameter(":StartAccounteddate",info.StartAccounteddate.Value.Date);
                    sqlCommand.AppendLine(@" AND ""BACCOUNT"".""ACCOUNTEDDATE"" >= :StartAccounteddate");
                }
                if (info.EndAccounteddate.HasValue)
                {
                    this.Database.AddInParameter(":EndAccounteddate",info.EndAccounteddate.Value.Date.AddDays(1).AddSeconds(-1));
                    sqlCommand.AppendLine(@" AND ""BACCOUNT"".""ACCOUNTEDDATE"" <= :EndAccounteddate");
                }
                if (!string.IsNullOrEmpty(info.Accounteduser))
                {
                    this.Database.AddInParameter(":Accounteduser",DbType.AnsiString,"%"+info.Accounteduser+"%");
                    sqlCommand.AppendLine(@" AND ""BACCOUNT"".""ACCOUNTEDUSER"" LIKE :Accounteduser");
                }
                if (!string.IsNullOrEmpty(info.Createduser))
                {
                    this.Database.AddInParameter(":Createduser",DbType.AnsiString,"%"+info.Createduser+"%");
                    sqlCommand.AppendLine(@" AND ""BACCOUNT"".""CREATEDUSER"" LIKE :Createduser");
                }

                sqlCommand.AppendLine(@"  ORDER BY ""BACCOUNT"".""ASSETNO"" DESC");
                return this.ExecuteReaderPaging<Baccount>(sqlCommand.ToString(), pageIndex, pageSize, out count);
            }
            finally
            {
                this.Database.ClearParameter();
            }
        }
コード例 #2
0
 public List<Baccount> RetrieveBaccountsPaging(BaccountSearch info,int pageIndex, int pageSize,out int count)
 {
     return Management.RetrieveBaccountsPaging(info,pageIndex,pageSize,out count);
 }