private void btCadastrarAula_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(mtbEntrada.Text) || string.IsNullOrEmpty(mtbSaida.Text))
            {
                MessageBox.Show("Por favor preencha todos os campos.", "Aviso");
                return;
            }
            else
            {
                AulaBLL bll = new AulaBLL();
                AulaDTO dto = new AulaDTO();

                dto.Data           = dtpData.Value;
                dto.HoraEntrada    = mtbEntrada.Text;
                dto.HoraSaida      = mtbSaida.Text;
                dto.Cod_Disciplina = Convert.ToInt16(cbbDisciplina.SelectedValue);
                dto.Cod_Professor  = Convert.ToInt16(cbbProfessor.SelectedValue);
                dto.Cod_Sala       = Convert.ToInt16(cbbSala.SelectedValue);
                dto.Cod_Serie      = Convert.ToInt16(cbbSerie.SelectedValue);
                dto.Cod_Turma      = Convert.ToInt16(cbbTurma.SelectedValue);

                bll.Inserir(dto);
                MessageBox.Show("Cadastro efetuado com sucesso!", "Sucesso");
                LimpaTela(4);
            }
        }
Example #2
0
        public JsonResult DeleteAula(int id)
        {
            var          aulBLL  = new AulaBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblAula aula = aulBLL.RetrieveAulaByID(id);

                if (aula != null)
                {
                    var eveBLL = new EventoBLL();
                    List <tblEvento> listaEventos = eveBLL.RetrieveEventosAulaByID(id);

                    if (listaEventos.Count() >= 0)
                    {
                        //significa que tiene Eventos....
                    }

                    var            areaBLL    = new AreasBLL();
                    List <tblArea> listaAreas = areaBLL.RetrieveAreasAulaByID(id);

                    if (listaAreas.Count() >= 0)
                    {
                        //significa que tiene Areas....
                    }

                    bool banderita = aulBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El Aula se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El Aula NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El Aula no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el Registro";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
Example #3
0
        public ActionResult Create()
        {
            var            aulaBLL    = new AulaBLL();
            List <tblAula> listaAulas = aulaBLL.RetrieveAll();

            ViewBag.idAula = new SelectList(listaAulas, "idAula", "nombreAula");

            var colaboradorBLL = new ColaboradorBLL();
            List <tblColaboradore> listacolaborador = colaboradorBLL.RetrieveAll();

            ViewBag.idColaborador = new SelectList(listacolaborador, "idcolaborador", "nombreColaborador");
            return(View());
        }
Example #4
0
        public void llenarDataGrid()
        {
            TableAulas.Rows.Clear();

            ListadoAulaCompleto listado = AulaBLL.ListadoCompletoAula();



            for (int i = 0; i < listado.ListadoAulas.Count(); i++)
            {
                TableAulas.Rows.Add();
                TableAulas.Rows[i].Cells["IdAula"].Value = listado.ListadoAulas[i].IdAula;
                TableAulas.Rows[i].Cells["Nombre"].Value = listado.ListadoAulas[i].NombreAula;
                TableAulas.Rows[i].Cells["Tipo"].Value   = listado.ListadoAulas[i].Tipo;
            }
        }
        // GET: Edificio/Delete/5
        public JsonResult DeleteEdificio(int id)
        {
            var          ediBLL  = new EdificioBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblEdificio edificio = ediBLL.RetrieveEdificioByID(id);

                if (edificio != null)
                {
                    var            aulaBLL   = new AulaBLL();
                    List <tblAula> listaAula = aulaBLL.RetrieveAulaEdificioByID(id);

                    if (listaAula.Count() >= 0)
                    {
                        //significa que tiene Aulas....
                    }

                    bool banderita = ediBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El edificio se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El edificio NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El edificio no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el edificio";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
Example #6
0
        // GET: TipoAula/Delete/5
        public JsonResult DeleteTipoAula(int id)
        {
            var          taBLL   = new TipoAulaBLL();
            wmJsonResult objJson = new wmJsonResult();

            try
            {
                tblTipoAula tipoaula = taBLL.RetrieveTipoAulaByID(id);

                if (tipoaula != null)
                {
                    var            auBLL      = new AulaBLL();
                    List <tblAula> listaAulas = auBLL.RetrieveAulaTipoAulaByID(id);

                    if (listaAulas.Count() >= 0)
                    {
                        //significa que tiene Aulas....
                    }

                    bool banderita = taBLL.Delete(id);

                    if (banderita == true)
                    {
                        objJson.bandera = true;
                        objJson.mensaje = "El Tipo Aula se eliminó correctamente";
                    }
                    else
                    {
                        objJson.bandera = false;
                        objJson.mensaje = "El Tipo Aula NO se eliminó correctamente";
                    }
                }
                else
                {
                    objJson.bandera = false;
                    objJson.mensaje = "El Tipo Aula no se encontró";
                }
            }
            catch
            {
                objJson.bandera = false;
                objJson.mensaje = "Ocurrio una excepcion al eliminar el Tipo Aula";
            }

            return(Json(objJson, JsonRequestBehavior.AllowGet));
        }
Example #7
0
        // GET: Aulas/Edit/5
        public ActionResult Edit(int id)
        {
            var                AuBLL          = new AulaBLL();
            tblAula            objCol         = AuBLL.RetrieveAulaByID(id);
            var                ediBLL         = new EdificioBLL();
            List <tblEdificio> listaEdificios = ediBLL.RetrieveAll();

            ViewBag.idEdificio = new SelectList(listaEdificios, "idEdificio", "nombreEdificio", objCol.idEdificio);


            var ti_auBLL = new TipoAulaBLL();
            List <tblTipoAula> listaTipoAula = ti_auBLL.RetrieveAll();

            ViewBag.idTipoAula = new SelectList(listaTipoAula, "idTipoAula", "tipoAula", objCol.idTipoAula);


            return(View(objCol));
        }
Example #8
0
        // GET: Area/Edit/5
        public ActionResult Edit(int id)
        {
            var     areaBLL = new AreasBLL();
            tblArea objArea = areaBLL.RetrieveAreaByID(id);

            var            aulaBLL    = new AulaBLL();
            List <tblAula> listaAulas = aulaBLL.RetrieveAll();

            ViewBag.idAula = new SelectList(listaAulas, "idAula", "nombreAula", objArea.idAula);

            var colaboradorBLL = new ColaboradorBLL();
            List <tblColaboradore> listacolaborador = colaboradorBLL.RetrieveAll();

            ViewBag.idColaborador = new SelectList(listacolaborador, "idcolaborador", "nombreColaborador", objArea.idColaborador);


            return(View(objArea));
        }
Example #9
0
        // GET: Eventos
        public ActionResult Index()
        {
            var eveBLL = new EventoBLL();
            List <tblEvento> listaEventos = eveBLL.RetrieveAll();

            var      lvlBLL = new NivelBLL();
            tblNivel objLvl;

            var             ColBLL = new ColaboradorBLL();
            tblColaboradore objCol;

            var     AulBLL = new AulaBLL();
            tblAula objAul;

            vmListaEventos        objTemp;
            List <vmListaEventos> listaFinal = new List <vmListaEventos>();

            foreach (var i in listaEventos)
            {
                objLvl = lvlBLL.RetrieveNivelByID(i.idNivel);
                string nivelNombre = objLvl.nivelNombre;

                objCol = ColBLL.RetrieveColaboradorByID(i.idColaborador);
                string ColaboradorNombre = objCol.nombreColaborador;

                objAul = AulBLL.RetrieveAulaByID(i.idAula);
                string AulaNombre = objAul.nombreAula;

                objTemp = new vmListaEventos()
                {
                    idEvento          = i.idEvento,
                    nombreEvento      = i.nombreEvento,
                    descripcionEvento = i.descripcionEvento,
                    fechaEvento       = i.fechaEvento.ToShortDateString(),
                    horaInicio        = i.horaInicio.ToShortTimeString(),
                    horaFinal         = i.horaFinal.ToShortTimeString(),
                    idNivel           = nivelNombre,
                    idAula            = AulaNombre,
                    idColaborador     = ColaboradorNombre
                };
                listaFinal.Add(objTemp);
            }
            return(View(listaFinal));
        }
        private void btnAceptarAula_Click(object sender, EventArgs e)
        {
            BorrarError();
            if (ValidarCampos())
            {
                if (txtNombreAula.Text == "")
                {
                    MessageBox.Show("No puede dejar campos en blanco");
                }
                else

                {
                    /*
                     * Aula a = new Aula();
                     *
                     *
                     * a.atributo
                     *
                     */
                    Aula aulas = new Aula
                    {
                        NombreAula        = txtNombreAula.Text,
                        IdTipoAula        = int.Parse(cmbTipoAula.SelectedValue.ToString()),
                        IdControllUsuario = 1
                    };


                    ResultadoPorSP resultado = AulaBLL.AgregarAula(aulas, control.MiUsuario);

                    MessageBox.Show("Insertado Correctamente");

                    control.refrescarTablaAulas();

                    this.Visible = false;

                    limpiartxt();
                }
            }
            else
            {
                MessageBox.Show("Error al ingresar datos");
            }
        }
Example #11
0
        public ActionResult Create(tblAula Aulas)
        {
            var          AuBLL  = new AulaBLL();
            ActionResult Result = null;

            try
            {
                if (ModelState.IsValid)
                {
                    AuBLL.Create(Aulas);
                    Result = RedirectToAction("Index");
                }
            }
            catch
            {
                return(View());
            }

            return(Result);
        }
Example #12
0
        /// <summary>
        /// Este metodo va a crear una lista del modelo vmListaAreas
        /// y tengo que ir a la BD a tomar los registros y despues
        /// construir la lista manualmente....
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            var            areaBLL    = new AreasBLL();
            List <tblArea> listaAreas = areaBLL.RetrieveAll();

            var             colBLL = new ColaboradorBLL();
            tblColaboradore objCol;

            var     aulaBLL = new AulaBLL();
            tblAula objAula;

            //creo un objeto de la vm para almacenar temporalmente los registros....
            vmListaAreas objTemp;

            //creo una lista vm para almacenar los objetos....
            List <vmListaAreas> listaFinal = new List <vmListaAreas>();

            foreach (var i in listaAreas)
            {
                objCol = colBLL.RetrieveColaboradorByID(i.idColaborador);
                string nombreColaborador = objCol.nombreColaborador;

                objAula = aulaBLL.RetrieveAulaByID(i.idAula);
                string nombreAula = objAula.nombreAula;

                objTemp = new vmListaAreas()
                {
                    idArea        = i.idArea,
                    nombreArea    = i.nombreArea,
                    horaInicio    = i.horaInicio.ToShortTimeString(),
                    horaFinal     = i.horaFinal.ToShortTimeString(),
                    idColaborador = nombreColaborador,
                    idAula        = nombreAula
                };

                listaFinal.Add(objTemp);
            }


            return(View(listaFinal));
        }
Example #13
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (this.TableAulas.Columns[e.ColumnIndex].Name == "Eliminar")
            {
                int idEliminar = Convert.ToInt32(TableAulas.Rows[TableAulas.CurrentRow.Index].Cells[0].Value);


                AulaBLL.EliminarAula(idEliminar);

                //Refrescar tabla
                control.refrescarTablaAulas();
            }
            else if (this.TableAulas.Columns[e.ColumnIndex].Name == "Ver")
            {
                int IdBuscar = Convert.ToInt32(TableAulas.Rows[TableAulas.CurrentRow.Index].Cells[0].Value);

                control.limpiarGridCaracteristicas();

                control.AbrirFormActivosPorAulas(IdBuscar);
            }
        }
Example #14
0
        // GET: Aulas
        public ActionResult Index()
        {
            var            aulasBLL   = new AulaBLL();
            List <tblAula> listaAulas = aulasBLL.RetrieveAll();

            var         tipoAulaBLL = new TipoAulaBLL();
            tblTipoAula objTipoAula;

            var         edificioBLL = new EdificioBLL();
            tblEdificio objEdificio;

            //creo un objeto de la vm para almacenar temporalmente los registros....
            vmListaAulas objTemp;

            //creo una lista vm para almacenar los objetos....
            List <vmListaAulas> listaFinal = new List <vmListaAulas>();

            foreach (var i in listaAulas)
            {
                objTipoAula = tipoAulaBLL.RetrieveTipoAulaByID(i.idTipoAula);
                string nombreTipoAula = objTipoAula.tipoAula;

                objEdificio = edificioBLL.RetrieveEdificioByID(i.idEdificio);
                string nombreEdificio = objEdificio.nombreEdificio;

                objTemp = new vmListaAulas()
                {
                    idAula     = i.idAula,
                    nombreAula = i.nombreAula,
                    idTipoAula = nombreTipoAula,
                    idEdificio = nombreEdificio,
                };

                listaFinal.Add(objTemp);
            }


            return(View(listaFinal));
        }
Example #15
0
        // GET: Eventos/Edit/5
        public ActionResult Edit(int id)
        {
            var       eveBLL = new EventoBLL();
            tblEvento objEve = eveBLL.RetrievEventoByID(id);

            var            aulaBLL    = new AulaBLL();
            List <tblAula> listaAulas = aulaBLL.RetrieveAll();

            ViewBag.idAula = new SelectList(listaAulas, "idAula", "nombreAula", objEve.idAula);

            var colaboradorBLL = new ColaboradorBLL();
            List <tblColaboradore> listacolaborador = colaboradorBLL.RetrieveAll();

            ViewBag.idColaborador = new SelectList(listacolaborador, "idcolaborador", "nombreColaborador", objEve.idColaborador);

            var             nivelBLL   = new NivelBLL();
            List <tblNivel> listaNivel = nivelBLL.RetrieveAll();

            ViewBag.idNivel = new SelectList(listaNivel, "idNivel", "nivelNombre", objEve.idNivel);

            return(View(objEve));
        }