public List<Procurementcontractdetail> RetrieveProcurementcontractdetailsPaging(ProcurementcontractdetailSearch info,int pageIndex, int pageSize,out int count)
 {
     return Management.RetrieveProcurementcontractdetailsPaging(info,pageIndex,pageSize,out count);
 }
        public List<Procurementcontractdetail> RetrieveProcurementcontractdetailsPaging(ProcurementcontractdetailSearch info,int pageIndex, int pageSize,out int count)
        {
            try
            {
                StringBuilder sqlCommand = new StringBuilder(@" SELECT ""PROCUREMENTCONTRACTDETAIL"".""CONTRACTDETAILID"",""PROCUREMENTCONTRACTDETAIL"".""CONTRACTID"",""PROCUREMENTCONTRACTDETAIL"".""ASSETCATEGORYID"",""PROCUREMENTCONTRACTDETAIL"".""ASSETNAME"",""PROCUREMENTCONTRACTDETAIL"".""ASSETSPECIFICATION"",
                     ""PROCUREMENTCONTRACTDETAIL"".""UNITPRICE"",""PROCUREMENTCONTRACTDETAIL"".""PROCURENUMBER""
                     ,""PROCUREMENTCONTRACTDETAIL"".""PSDETAILID"",""PROCUREMENTCONTRACTDETAIL"".""PSID""
                     FROM ""PROCUREMENTCONTRACTDETAIL""
                     INNER JOIN ""PROCUREMENTCONTRACT"" ON ""PROCUREMENTCONTRACTDETAIL"".""CONTRACTID""=""PROCUREMENTCONTRACT"".""CONTRACTID""
                     WHERE 1=1");
                if (!string.IsNullOrEmpty(info.Contractdetailid))
                {
                    this.Database.AddInParameter(":Contractdetailid",DbType.AnsiString,"%"+info.Contractdetailid+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTCONTRACTDETAIL"".""CONTRACTDETAILID"" LIKE :Contractdetailid");
                }
                if (!string.IsNullOrEmpty(info.Contractid))
                {
                    this.Database.AddInParameter(":Contractid",DbType.AnsiString,"%"+info.Contractid+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTCONTRACTDETAIL"".""CONTRACTID"" LIKE :Contractid");
                }
                if (!string.IsNullOrEmpty(info.Assetcategoryid))
                {
                    this.Database.AddInParameter(":Assetcategoryid",DbType.AnsiString,"%"+info.Assetcategoryid+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTCONTRACTDETAIL"".""ASSETCATEGORYID"" LIKE :Assetcategoryid");
                }
                if (!string.IsNullOrEmpty(info.Assetname))
                {
                    this.Database.AddInParameter(":Assetname", "%"+info.Assetname+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTCONTRACTDETAIL"".""ASSETNAME"" LIKE :Assetname");
                }
                if (!string.IsNullOrEmpty(info.Assetspecification))
                {
                    this.Database.AddInParameter(":Assetspecification", "%"+info.Assetspecification+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTCONTRACTDETAIL"".""ASSETSPECIFICATION"" LIKE :Assetspecification");
                }

                sqlCommand.AppendLine(@"  ORDER BY ""PROCUREMENTCONTRACTDETAIL"".""CONTRACTDETAILID"" DESC");
                return this.ExecuteReaderPaging<Procurementcontractdetail>(sqlCommand.ToString(), pageIndex, pageSize, out count);
            }
            finally
            {
                this.Database.ClearParameter();
            }
        }