public IList<Core.Business.INSTRSERVICE> GetAllINSTRSERVICE() { IList<Core.Business.INSTRSERVICE> iNSTRSERVICElist = new List<Core.Business.INSTRSERVICE>(); SqlServerUtility sql = new SqlServerUtility(); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectINSTRSERVICEsAll"); if (reader != null) { while (reader.Read()) { Core.Business.INSTRSERVICE iNSTRSERVICE = new Core.Business.INSTRSERVICE(); if (!reader.IsDBNull(0)) iNSTRSERVICE.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) iNSTRSERVICE.INSTRUMENTID = reader.GetGuid(1); if (!reader.IsDBNull(2)) iNSTRSERVICE.OUTOFFERED = reader.GetInt32(2); if (!reader.IsDBNull(3)) iNSTRSERVICE.OFFERTIME = reader.GetInt32(3); if (!reader.IsDBNull(4)) iNSTRSERVICE.SERVICEEXPLAIN = reader.GetString(4); if (!reader.IsDBNull(5)) iNSTRSERVICE.SERVICECLASS = reader.GetString(5); if (!reader.IsDBNull(6)) iNSTRSERVICE.ServiceIncome = reader.GetDecimal(6); if (!reader.IsDBNull(7)) iNSTRSERVICE.TestSampleNum = reader.GetInt32(7); if (!reader.IsDBNull(8)) iNSTRSERVICE.ATLASMANUFACTURER = reader.GetString(8); if (!reader.IsDBNull(9)) iNSTRSERVICE.ATLASNAME = reader.GetString(9); if (!reader.IsDBNull(10)) iNSTRSERVICE.REMARK = reader.GetString(10); if (!reader.IsDBNull(11)) iNSTRSERVICE.WRITEDATE = reader.GetDateTime(11); if (!reader.IsDBNull(12)) iNSTRSERVICE.UPDATEDATE = reader.GetDateTime(12); iNSTRSERVICE.MarkOld(); iNSTRSERVICElist.Add(iNSTRSERVICE); } reader.Close(); } return iNSTRSERVICElist; }
public IList<CY.CSTS.Core.Business.INSTRSERVICE> GetINSTRSERVICEDynamic(string whereCondition, string orderByExpression) { if (string.IsNullOrEmpty(whereCondition)) { return this.GetAllINSTRSERVICE(); } IList<Core.Business.INSTRSERVICE> iNSTRSERVICElist = new List<Core.Business.INSTRSERVICE>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@WhereCondition", SqlDbType.NVarChar, whereCondition); sql.AddParameter("@OrderByExpression", SqlDbType.NVarChar, orderByExpression); SqlDataReader reader = sql.ExecuteSPReader("usp_SelectINSTRSERVICEsDynamic"); if (reader != null) { while (reader.Read()) { Core.Business.INSTRSERVICE iNSTRSERVICE = new Core.Business.INSTRSERVICE(); if (!reader.IsDBNull(0)) iNSTRSERVICE.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) iNSTRSERVICE.INSTRUMENTID = reader.GetGuid(1); if (!reader.IsDBNull(2)) iNSTRSERVICE.OUTOFFERED = reader.GetInt32(2); if (!reader.IsDBNull(3)) iNSTRSERVICE.OFFERTIME = reader.GetInt32(3); if (!reader.IsDBNull(4)) iNSTRSERVICE.SERVICEEXPLAIN = reader.GetString(4); if (!reader.IsDBNull(5)) iNSTRSERVICE.SERVICECLASS = reader.GetString(5); if (!reader.IsDBNull(6)) iNSTRSERVICE.ServiceIncome = reader.GetDecimal(6); if (!reader.IsDBNull(7)) iNSTRSERVICE.TestSampleNum = reader.GetInt32(7); if (!reader.IsDBNull(8)) iNSTRSERVICE.ATLASMANUFACTURER = reader.GetString(8); if (!reader.IsDBNull(9)) iNSTRSERVICE.ATLASNAME = reader.GetString(9); if (!reader.IsDBNull(10)) iNSTRSERVICE.REMARK = reader.GetString(10); if (!reader.IsDBNull(11)) iNSTRSERVICE.WRITEDATE = reader.GetDateTime(11); if (!reader.IsDBNull(12)) iNSTRSERVICE.UPDATEDATE = reader.GetDateTime(12); iNSTRSERVICE.MarkOld(); iNSTRSERVICElist.Add(iNSTRSERVICE); } reader.Close(); } return iNSTRSERVICElist; }
public IEnumerable<INSTRSERVICE> GetServiceInfo(Guid id) { IList<Core.Business.INSTRSERVICE> iNSTRSERVICElist = new List<Core.Business.INSTRSERVICE>(); SqlServerUtility sql = new SqlServerUtility(); sql.AddParameter("@id", SqlDbType.UniqueIdentifier, id); SqlDataReader reader = sql.ExecuteSqlReader(Sql_GetServiceInfo); if (reader != null) { while (reader.Read()) { Core.Business.INSTRSERVICE iNSTRSERVICE = new Core.Business.INSTRSERVICE(); if (!reader.IsDBNull(0)) iNSTRSERVICE.Id = reader.GetGuid(0); if (!reader.IsDBNull(1)) iNSTRSERVICE.INSTRUMENTID = reader.GetGuid(1); if (!reader.IsDBNull(2)) iNSTRSERVICE.OUTOFFERED = reader.GetInt32(2); if (!reader.IsDBNull(3)) iNSTRSERVICE.OFFERTIME = reader.GetInt32(3); if (!reader.IsDBNull(4)) iNSTRSERVICE.SERVICEEXPLAIN = reader.GetString(4); if (!reader.IsDBNull(5)) iNSTRSERVICE.SERVICECLASS = reader.GetString(5); if (!reader.IsDBNull(6)) iNSTRSERVICE.ServiceIncome = reader.GetDecimal(6); if (!reader.IsDBNull(7)) iNSTRSERVICE.TestSampleNum = reader.GetInt32(7); if (!reader.IsDBNull(8)) iNSTRSERVICE.ATLASMANUFACTURER = reader.GetString(8); if (!reader.IsDBNull(9)) iNSTRSERVICE.ATLASNAME = reader.GetString(9); if (!reader.IsDBNull(10)) iNSTRSERVICE.REMARK = reader.GetString(10); if (!reader.IsDBNull(11)) iNSTRSERVICE.WRITEDATE = reader.GetDateTime(11); if (!reader.IsDBNull(12)) iNSTRSERVICE.UPDATEDATE = reader.GetDateTime(12); iNSTRSERVICE.MarkOld(); iNSTRSERVICElist.Add(iNSTRSERVICE); } reader.Close(); } return iNSTRSERVICElist; }