protected void LoadMoveData() { var search = new AssetmovedetailSearch(); search.Assetno = Assetno;//设备编号 int recordCount = 0; var list = AssetmovedetailService.RetrieveAssetmovedetailsPaging(search, 0, 100, out recordCount); rptMoveList.DataSource = list; rptMoveList.DataBind(); }
public List<Assetmovedetail> RetrieveAssetmovedetailsPaging(AssetmovedetailSearch info,int pageIndex, int pageSize,out int count) { try { StringBuilder sqlCommand = new StringBuilder(@" SELECT ""ASSETMOVEDETAIL"".""DETAILID"",""ASSETMOVEDETAIL"".""ASSETMOVEID"",""ASSETMOVEDETAIL"".""ASSETNO"",""ASSETMOVEDETAIL"".""PLANMOVEDATE"",""ASSETMOVEDETAIL"".""ACTUALMOVEDATE"", ""ASSETMOVEDETAIL"".""MOVEDCONTENT"" ,c.StorageName,c.subcompanyname AS subcompanyname FROM ""ASSETMOVEDETAIL"" INNER JOIN ""ASSETMOVE"" ON ""ASSETMOVEDETAIL"".""ASSETMOVEID""=""ASSETMOVE"".""ASSETMOVEID"" INNER JOIN v_storage_address c on c.StorageTitle=ASSETMOVE.STORAGETITLE and c.StorageId=ASSETMOVE.STORAGEID WHERE 1=1"); #region ��ϸ��� if (!string.IsNullOrEmpty(info.Detailid)) { this.Database.AddInParameter(":Detailid",DbType.AnsiString,"%"+info.Detailid+"%"); sqlCommand.AppendLine(@" AND ""ASSETMOVEDETAIL"".""DETAILID"" LIKE :Detailid"); } #endregion #region �ƻ����� if (!string.IsNullOrEmpty(info.Assetmoveid)) { this.Database.AddInParameter(":Assetmoveid",DbType.AnsiString,"%"+info.Assetmoveid+"%"); sqlCommand.AppendLine(@" AND ""ASSETMOVEDETAIL"".""ASSETMOVEID"" LIKE :Assetmoveid"); } #endregion #region �豸��� if (!string.IsNullOrEmpty(info.Assetno)) { this.Database.AddInParameter(":Assetno", DbType.AnsiString, info.Assetno); sqlCommand.AppendLine(@" AND ""ASSETMOVEDETAIL"".""ASSETNO"" = :Assetno"); } #endregion #region �ƻ��ƻ����� if (info.StartPlanmovedate.HasValue) { this.Database.AddInParameter(":StartPlanmovedate",info.StartPlanmovedate.Value.Date); sqlCommand.AppendLine(@" AND ""ASSETMOVEDETAIL"".""PLANMOVEDATE"" >= :StartPlanmovedate"); } if (info.EndPlanmovedate.HasValue) { this.Database.AddInParameter(":EndPlanmovedate",info.EndPlanmovedate.Value.Date.AddDays(1).AddSeconds(-1)); sqlCommand.AppendLine(@" AND ""ASSETMOVEDETAIL"".""PLANMOVEDATE"" <= :EndPlanmovedate"); } #endregion #region ʵ���ƻ����� if (info.StartActualmovedate.HasValue) { this.Database.AddInParameter(":StartActualmovedate",info.StartActualmovedate.Value.Date); sqlCommand.AppendLine(@" AND ""ASSETMOVEDETAIL"".""ACTUALMOVEDATE"" >= :StartActualmovedate"); } if (info.EndActualmovedate.HasValue) { this.Database.AddInParameter(":EndActualmovedate",info.EndActualmovedate.Value.Date.AddDays(1).AddSeconds(-1)); sqlCommand.AppendLine(@" AND ""ASSETMOVEDETAIL"".""ACTUALMOVEDATE"" <= :EndActualmovedate"); } #endregion #region �ƻ�˵�� if (!string.IsNullOrEmpty(info.Movedcontent)) { this.Database.AddInParameter(":Movedcontent", "%"+info.Movedcontent+"%"); sqlCommand.AppendLine(@" AND ""ASSETMOVEDETAIL"".""MOVEDCONTENT"" LIKE :Movedcontent"); } #endregion sqlCommand.AppendLine(@" ORDER BY ""ASSETMOVEDETAIL"".""DETAILID"" DESC"); return this.ExecuteReaderPaging<Assetmovedetail>(sqlCommand.ToString(), pageIndex, pageSize, out count); } finally { this.Database.ClearParameter(); } }
public List<Assetmovedetail> RetrieveAssetmovedetailsPaging(AssetmovedetailSearch info,int pageIndex, int pageSize,out int count) { return Management.RetrieveAssetmovedetailsPaging(info,pageIndex,pageSize,out count); }