public IList<Core.Business.StimulationApplicationForCenter> GetStimulationApplicationBySql(string sqlwhere, string order) { IList<Core.Business.StimulationApplicationForCenter> stimulationlist=new List<Core.Business.StimulationApplicationForCenter>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, sqlwhere); sql.AddParameter("@OrderByExpression", SqlDbType.NVarChar, order); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectStimulationApplicationForCentersDynamic"); if (reader != null) { while (reader.Read()) { Core.Business.StimulationApplicationForCenter stimulationApplicationForCenter = new Core.Business.StimulationApplicationForCenter(); if (!reader.IsDBNull(0)) stimulationApplicationForCenter.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) stimulationApplicationForCenter.FieldType = reader.GetGuid(1); if (!reader.IsDBNull(2)) stimulationApplicationForCenter.StimulationContentType = reader.GetInt32(2); if (!reader.IsDBNull(3)) stimulationApplicationForCenter.DraftWriter = reader.GetString(3); if (!reader.IsDBNull(4)) stimulationApplicationForCenter.DetailWriter = reader.GetString(4); if (!reader.IsDBNull(5)) stimulationApplicationForCenter.FillDate = reader.GetDateTime(5); if (!reader.IsDBNull(6)) stimulationApplicationForCenter.State = reader.GetInt32(6); if (!reader.IsDBNull(7)) stimulationApplicationForCenter.PointWorkCondtion = reader.GetString(7); if (!reader.IsDBNull(8)) stimulationApplicationForCenter.WebSiteCondition = reader.GetString(8); if (!reader.IsDBNull(9)) stimulationApplicationForCenter.DatabaseCondition = reader.GetString(9); if (!reader.IsDBNull(10)) stimulationApplicationForCenter.RemoteServiceCondition = reader.GetString(10); if (!reader.IsDBNull(11)) stimulationApplicationForCenter.OtherWorkCondition = reader.GetString(11); if (!reader.IsDBNull(12)) stimulationApplicationForCenter.DynamicInfoAnalyzePaperNbr = reader.GetString(12); if (!reader.IsDBNull(13)) stimulationApplicationForCenter.PublicizeNbr = reader.GetString(13); if (!reader.IsDBNull(14)) stimulationApplicationForCenter.Score = reader.GetInt32(14); stimulationApplicationForCenter.MarkOld(); stimulationlist.Add(stimulationApplicationForCenter); } reader.Close(); } return stimulationlist; }
public IList<Core.Business.StimulationApplicationForCenter> GetStimulationApplicationForCenterBytypeId(Guid typeId) { IList<Core.Business.StimulationApplicationForCenter> stimulationlist = new List<Core.Business.StimulationApplicationForCenter>(); SqlServerUtility sql = new SqlServerUtility(); string sqlstr = "Select b.* from StimulationApplicationForCenter b ,StimulationAppliction c where b.Id=c.Id and c.StimulationAndTypeId='" + typeId + "' "; SqlDataReader reader = sql.ExecuteSqlReader(sqlstr); if (reader != null) { while (reader.Read()) { Core.Business.StimulationApplicationForCenter stimulationApplicationForCenter = new Core.Business.StimulationApplicationForCenter(); if (!reader.IsDBNull(0)) stimulationApplicationForCenter.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) stimulationApplicationForCenter.FieldType = reader.GetGuid(1); if (!reader.IsDBNull(2)) stimulationApplicationForCenter.StimulationContentType = reader.GetInt32(2); if (!reader.IsDBNull(3)) stimulationApplicationForCenter.DraftWriter = reader.GetString(3); if (!reader.IsDBNull(4)) stimulationApplicationForCenter.DetailWriter = reader.GetString(4); if (!reader.IsDBNull(5)) stimulationApplicationForCenter.FillDate = reader.GetDateTime(5); if (!reader.IsDBNull(6)) stimulationApplicationForCenter.State = reader.GetInt32(6); if (!reader.IsDBNull(7)) stimulationApplicationForCenter.PointWorkCondtion = reader.GetString(7); if (!reader.IsDBNull(8)) stimulationApplicationForCenter.WebSiteCondition = reader.GetString(8); if (!reader.IsDBNull(9)) stimulationApplicationForCenter.DatabaseCondition = reader.GetString(9); if (!reader.IsDBNull(10)) stimulationApplicationForCenter.RemoteServiceCondition = reader.GetString(10); if (!reader.IsDBNull(11)) stimulationApplicationForCenter.OtherWorkCondition = reader.GetString(11); if (!reader.IsDBNull(12)) stimulationApplicationForCenter.DynamicInfoAnalyzePaperNbr = reader.GetString(12); if (!reader.IsDBNull(13)) stimulationApplicationForCenter.PublicizeNbr = reader.GetString(13); if (!reader.IsDBNull(14)) stimulationApplicationForCenter.Score = reader.GetInt32(14); stimulationApplicationForCenter.MarkOld(); stimulationlist.Add(stimulationApplicationForCenter); } reader.Close(); } return stimulationlist; }
public Core.Business.StimulationApplicationForCenter Select(Guid id) { SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@Id", SqlDbType.UniqueIdentifier, id); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectStimulationApplicationForCenter"); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.StimulationApplicationForCenter stimulationApplicationForCenter = new Core.Business.StimulationApplicationForCenter(); if (!reader.IsDBNull(0)) stimulationApplicationForCenter.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) stimulationApplicationForCenter.FieldType = reader.GetGuid(1); if (!reader.IsDBNull(2)) stimulationApplicationForCenter.StimulationContentType = reader.GetInt32(2); if (!reader.IsDBNull(3)) stimulationApplicationForCenter.DraftWriter = reader.GetString(3); if (!reader.IsDBNull(4)) stimulationApplicationForCenter.DetailWriter = reader.GetString(4); if (!reader.IsDBNull(5)) stimulationApplicationForCenter.FillDate = reader.GetDateTime(5); if (!reader.IsDBNull(6)) stimulationApplicationForCenter.State = reader.GetInt32(6); if (!reader.IsDBNull(7)) stimulationApplicationForCenter.PointWorkCondtion = reader.GetString(7); if (!reader.IsDBNull(8)) stimulationApplicationForCenter.WebSiteCondition = reader.GetString(8); if (!reader.IsDBNull(9)) stimulationApplicationForCenter.DatabaseCondition = reader.GetString(9); if (!reader.IsDBNull(10)) stimulationApplicationForCenter.RemoteServiceCondition = reader.GetString(10); if (!reader.IsDBNull(11)) stimulationApplicationForCenter.OtherWorkCondition = reader.GetString(11); if (!reader.IsDBNull(12)) stimulationApplicationForCenter.DynamicInfoAnalyzePaperNbr = reader.GetString(12); if (!reader.IsDBNull(13)) stimulationApplicationForCenter.PublicizeNbr = reader.GetString(13); if (!reader.IsDBNull(14)) stimulationApplicationForCenter.Score = reader.GetInt32(14); reader.Close(); return stimulationApplicationForCenter; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }