Beispiel #1
0
        public Modelo Select(int id)
        {
            Modelo modelo = null;

            System.Data.IDbConnection objConexao;
            System.Data.IDbCommand objCommand;
            System.Data.IDataReader objDataReader;

            objConexao = Mapped.Connection();
            objCommand = Mapped.Command("SELECT * FROM TBL_MODELO WHERE MOD_ID = ?codigo", objConexao);
            objCommand.Parameters.Add(Mapped.Parameter("?codigo", id));

            objDataReader = objCommand.ExecuteReader();
            while (objDataReader.Read())
            {
                modelo = new Modelo();
                modelo.ID = Convert.ToInt32(objDataReader["MOD_ID"]);
                modelo.Nome = Convert.ToString(objDataReader["MOD_NOME"]);
                modelo.Peso = Convert.ToDouble(objDataReader["MOD_PESO"]);
                modelo.Descricao = Convert.ToString(objDataReader["MOD_DESCRICAO"]);
                modelo.Largura = Convert.ToDouble(objDataReader["MOD_LARGURA"]);
                modelo.Altura = Convert.ToDouble(objDataReader["MOD_ALTURA"]);
                modelo.Ativado = Convert.ToBoolean(objDataReader["MOD_ATIVADO"]);
            }

            objDataReader.Close();
            objConexao.Close();

            objCommand.Dispose();
            objConexao.Dispose();
            objDataReader.Dispose();

            return modelo;
        }
Beispiel #2
0
 public Alianca()
 {
     Ativado = true;
     modelo = new Modelo();
 }
Beispiel #3
0
 public Alianca()
 {
     Ativado = true;
     modelo  = new Modelo();
 }