Exemple #1
0
        public DataTable setAeronaves(AeronavesDto dto)
        {
            using (con = new SqlConnection(dbContext.ObtenerCadenaDbConexSQL(_config["config:urlConex"])))
            {
                try
                {
                    tblResult = new DataTable();
                    con.Open();
                    if (con.State == ConnectionState.Open)
                    {
                        SqlDataAdapter cmd = new SqlDataAdapter(STORE_PROCEDURES.SET_AERONAVES, con);
                        cmd.SelectCommand.CommandType = CommandType.StoredProcedure;
                        cmd.SelectCommand.Parameters.Add("@nombre", SqlDbType.VarChar).Value      = dto.nombre;
                        cmd.SelectCommand.Parameters.Add("@idLinea", SqlDbType.Int).Value         = dto.idLinea;
                        cmd.SelectCommand.Parameters.Add("@capacidad", SqlDbType.VarChar).Value   = dto.capacidad;
                        cmd.SelectCommand.Parameters.Add("@descripcion", SqlDbType.VarChar).Value = dto.descripcion;
                        cmd.SelectCommand.Parameters.Add("@estado", SqlDbType.Bit).Value          = dto.estado;
                        cmd.Fill(tblResult);

                        cmd.Dispose();
                    }
                }
                catch (SqlException ex)
                {
                    con.Close();
                    throw new InvalidOperationException("TAG: " + ex.Message + ex.ErrorCode + ex.Data, ex.InnerException);
                }
                catch (Exception)
                {
                    throw new Exception();
                }
                con.Close();
                return(tblResult);
            }
        }
 public ResultDto putAeronaves(AeronavesDto dto, int id) => _repository.putAeronaves(dto, id).AsResult();
 public ResultDto putAeronaves([FromBody] AeronavesDto dto, int id)
 {
     return(_service.putAeronaves(dto, id));
 }
 public ResultDto setAeronaves(AeronavesDto dto) => _repository.setAeronaves(dto).AsResult();
 public ResultDto setAeronaves([FromBody] AeronavesDto dto)
 {
     return(_service.setAeronaves(dto));
 }