Пример #1
0
        private void listarCarreras()
        {
            CarreraModel carreraModel = new CarreraModel();

            this.cmb_carrera.DataSource    = carreraModel.listarCarreras();
            this.cmb_carrera.DisplayMember = "carrera";
            this.cmb_carrera.ValueMember   = "idCarrera";
        }
Пример #2
0
        public IHttpActionResult Post(CarreraModel carrera)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest());
                }

                _carreraRules.Insert(_mapper.Map <Carrera>(carrera));
                return(Ok(carrera));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }