public List<ProcurementscheduledetailEx> RetrieveProcurementscheduledetailsPaging(ProcurementscheduledetailSearch info,int pageIndex, int pageSize,out int count)
 {
     return Management.RetrieveProcurementscheduledetailsPaging(info,pageIndex,pageSize,out count);
 }
        public List<ProcurementscheduledetailEx> RetrieveProcurementscheduledetailsPaging(ProcurementscheduledetailSearch info,int pageIndex, int pageSize,out int count)
        {
            try
            {
                StringBuilder sqlCommand = new StringBuilder(@" SELECT ""PROCUREMENTSCHEDULEDETAIL"".""DETAILID"",""PROCUREMENTSCHEDULEDETAIL"".""ASSETCATEGORYID"",""PROCUREMENTSCHEDULEDETAIL"".""ASSETNAME"",""PROCUREMENTSCHEDULEDETAIL"".""ASSETSPECIFICATION"",""PROCUREMENTSCHEDULEDETAIL"".""UNITPRICE"",
                     ""PROCUREMENTSCHEDULEDETAIL"".""PLANNUMBER"",""PROCUREMENTSCHEDULEDETAIL"".""PSID""

                     FROM ""PROCUREMENTSCHEDULEDETAIL""
                     INNER JOIN ""PROCUREMENTSCHEDULEHEAD"" ON ""PROCUREMENTSCHEDULEDETAIL"".""PSID""=""PROCUREMENTSCHEDULEHEAD"".""PSID""
                     WHERE 1=1");
                if (!string.IsNullOrEmpty(info.Detailid))
                {
                    this.Database.AddInParameter(":Detailid",DbType.AnsiString,"%"+info.Detailid+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTSCHEDULEDETAIL"".""DETAILID"" LIKE :Detailid");
                }
                if (!string.IsNullOrEmpty(info.Assetcategoryid))
                {
                    this.Database.AddInParameter(":Assetcategoryid",DbType.AnsiString,"%"+info.Assetcategoryid+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTSCHEDULEDETAIL"".""ASSETCATEGORYID"" LIKE :Assetcategoryid");
                }
                if (!string.IsNullOrEmpty(info.Assetname))
                {
                    this.Database.AddInParameter(":Assetname", "%"+info.Assetname+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTSCHEDULEDETAIL"".""ASSETNAME"" LIKE :Assetname");
                }
                if (!string.IsNullOrEmpty(info.Assetspecification))
                {
                    this.Database.AddInParameter(":Assetspecification", "%"+info.Assetspecification+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTSCHEDULEDETAIL"".""ASSETSPECIFICATION"" LIKE :Assetspecification");
                }
                if (!string.IsNullOrEmpty(info.Psid))
                {
                    this.Database.AddInParameter(":Psid",DbType.AnsiString,"%"+info.Psid+"%");
                    sqlCommand.AppendLine(@" AND ""PROCUREMENTSCHEDULEDETAIL"".""PSID"" LIKE :Psid");
                }

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