Exemplo n.º 1
0
 protected MRS.Model.HspType Parse(SqlDataReader Reader)
 {
     MRS.Model.HspType hspType = new MRS.Model.HspType();
     hspType.Id   = Convert.ToInt32(Reader[DSL.HspType.ID_FIELD]);
     hspType.Name = Reader[DSL.HspType.NAME_FIELD].ToString().Trim();
     return(hspType);
 }
Exemplo n.º 2
0
        public IList <MRS.Model.HspType> GetHspTypes()
        {
            IList <MRS.Model.HspType> hspTypes = new List <MRS.Model.HspType>();

            using (SqlDataReader reader = SqlHelper.ExecuteReader(ConnectionString.ConnectionStringMRS, CommandType.StoredProcedure, DSL.CommandText.SELECT_HSPTYPE, null))
            {
                while (reader.Read())
                {
                    MRS.Model.HspType hspType = Parse(reader);
                    hspTypes.Add(hspType);
                }
            }
            return(hspTypes);
        }
Exemplo n.º 3
0
        public MRS.Model.HspType GetHspTypeById(int Id)
        {
            MRS.Model.HspType hspType = new MRS.Model.HspType();

            SqlParameter id_parm = new SqlParameter(DSL.HspType.ID_PARM, SqlDbType.Int);

            id_parm.Value = Id;

            using (SqlDataReader reader = SqlHelper.ExecuteReader(ConnectionString.ConnectionStringMRS, CommandType.StoredProcedure, CommandText.SELECT_HSPTYPE_BY_ID, id_parm))
            {
                if (reader.Read())
                {
                    hspType = Parse(reader);
                }
            }
            return(hspType);
        }