Beispiel #1
0
        public JsonResult IsRegister(string idSeccion, string tipo)
        {
            RCasilla result = null;
            var      rBLL   = new RCasillaBLL();

            result = rBLL.VerificarExistente(idSeccion, tipo);
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public JsonResult DesbloquearEditable(string idRegistroCasilla)
        {
            bool Result  = false;
            var  rBLL    = new RCasillaBLL();
            var  casilla = rBLL.RetrieveByIdRCasilla(idRegistroCasilla);

            casilla.Editable = true;
            try
            {
                rBLL.Update(casilla);
                Result = true;
            }
            catch
            {
                Result = false;
            }

            return(Json(Result, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public ActionResult Update(string idRCasilla)
        {
            var sBLL  = new SeccionBLL();
            var rcBLL = new RCasillaBLL();

            RCasilla casilla = rcBLL.RetrieveByIdRCasilla(idRCasilla);

            casilla.Editable = false;

            Guid g = Guid.NewGuid();

            var secciones = sBLL.RetrieveSeccions();
            var casillas  = sBLL.RetrieveBySeccion(casilla.Seccione.seccion);

            ViewBag.seccion = new SelectList(secciones, casilla.Seccione.seccion);
            ViewBag.casilla = new SelectList(casillas, "idSeccion", "casilla", casilla.Seccione.casilla);
            string tipo = "", id = casilla.tipoEleccion;

            if (id == "A")
            {
                tipo = "PRESIDENTE MUNICIPAL";
            }
            else
            if (id == "D")
            {
                tipo = "DIPUTADOS LOCALES";
            }
            else
            if (id == "F")
            {
                tipo = "DIPUTADOS FEDERALES";
            }
            else
            if (id == "S")
            {
                tipo = "SENADORES";
            }
            else
            if (id == "P")
            {
                tipo = "PRESIDENTES";
            }
            else
            {
                return(View("Index"));
            }

            var oRR = new EstadoCasillaRepository();
            List <EstadoCasilla> estados = new List <EstadoCasilla>();

            if (Rol != null)
            {
                if (Rol == "A")
                {
                    estados = oRR.RetrieveAllEstadosCasilla();
                }

                if (Rol == "C")
                {
                    estados = oRR.RetrieveAllEstadosCasillaCapturista();
                }
            }

            ViewBag.status = new SelectList(estados, "idEstado", "descripcion", casilla.status);

            ViewBag.Tipo = tipo;

            return(PartialView("_Update", casilla));
        }
Beispiel #4
0
        public ActionResult Update(RCasilla casilla)
        {
            var rcBLL = new RCasillaBLL();

            if (ModelState.IsValid)
            {
                try
                {
                    rcBLL.Update(casilla);
                    return(RedirectToAction("Register", "Home", new { id = casilla.tipoEleccion, message = "El registro se ha actualizado correctamente." }));
                }catch
                {
                    var sBLL = new SeccionBLL();

                    var secciones = sBLL.RetrieveSeccions();
                    var casillas  = sBLL.RetrieveBySeccion(casilla.Seccione.seccion);
                    ViewBag.seccion = new SelectList(secciones, casilla.Seccione.seccion);
                    ViewBag.casilla = new SelectList(casillas, "idSeccion", "casilla", casilla.Seccione.casilla);
                    string tipo = "", id = casilla.tipoEleccion;

                    if (id == "A")
                    {
                        tipo = "PRESIDENTE MUNICIPAL";
                    }
                    else
                    if (id == "D")
                    {
                        tipo = "DIPUTADOS LOCALES";
                    }
                    else
                    if (id == "F")
                    {
                        tipo = "DIPUTADOS FEDERALES";
                    }
                    else
                    if (id == "S")
                    {
                        tipo = "SENADORES";
                    }
                    else
                    if (id == "P")
                    {
                        tipo = "PRESIDENTES";
                    }
                    else
                    {
                        return(View("Index"));
                    }

                    ViewBag.Tipo = tipo;

                    var oRR = new EstadoCasillaRepository();
                    List <EstadoCasilla> estados = new List <EstadoCasilla>();

                    if (Rol != null)
                    {
                        if (Rol == "A")
                        {
                            estados = oRR.RetrieveAllEstadosCasilla();
                        }

                        if (Rol == "C")
                        {
                            estados = oRR.RetrieveAllEstadosCasillaCapturista();
                        }
                    }

                    ViewBag.status = new SelectList(estados, "idEstado", "descripcion", casilla.status);

                    return(View());
                }
            }
            else
            {
                var sBLL = new SeccionBLL();

                var secciones = sBLL.RetrieveSeccions();
                var casillas  = sBLL.RetrieveBySeccion(casilla.Seccione.seccion);
                ViewBag.seccion = new SelectList(secciones, casilla.Seccione.seccion);
                ViewBag.casilla = new SelectList(casillas, "idSeccion", "casilla", casilla.Seccione.casilla);
                string tipo = "", id = casilla.tipoEleccion;

                if (id == "A")
                {
                    tipo = "PRESIDENTE MUNICIPAL";
                }
                else
                if (id == "D")
                {
                    tipo = "DIPUTADOS LOCALES";
                }
                else
                if (id == "F")
                {
                    tipo = "DIPUTADOS FEDERALES";
                }
                else
                if (id == "S")
                {
                    tipo = "SENADORES";
                }
                else
                if (id == "P")
                {
                    tipo = "PRESIDENTES";
                }
                else
                {
                    return(View("Index"));
                }

                ViewBag.Tipo = tipo;

                var oRR = new EstadoCasillaRepository();
                List <EstadoCasilla> estados = new List <EstadoCasilla>();

                if (Rol != null)
                {
                    if (Rol == "A")
                    {
                        estados = oRR.RetrieveAllEstadosCasilla();
                    }

                    if (Rol == "C")
                    {
                        estados = oRR.RetrieveAllEstadosCasillaCapturista();
                    }
                }

                ViewBag.status = new SelectList(estados, "idEstado", "descripcion", casilla.status);

                return(View());
            }
        }
Beispiel #5
0
        public ActionResult Register(RCasilla rCasilla)
        {
            var rcBLL = new RCasillaBLL();

            if (ModelState.IsValid)
            {
                Guid g = Guid.NewGuid();
                rCasilla.idRegistroCasilla = g.ToString();
                rCasilla.fecha             = DateTime.Now;
                rcBLL.Create(rCasilla);
                return(RedirectToAction("Register", new { id = rCasilla.tipoEleccion, message = "El registro se guardó exitosamente." }));
            }
            else
            {
                var sBLL      = new SeccionBLL();
                var secciones = sBLL.RetrieveSeccions();
                ViewBag.seccion = new SelectList(secciones);
                ViewBag.casilla = new SelectList(Enumerable.Empty <SelectListItem>());
                string tipo = "";

                if (rCasilla.tipoEleccion == "A")
                {
                    tipo = "PRESIDENTE MUNICIPAL";
                }
                else
                if (rCasilla.tipoEleccion == "D")
                {
                    tipo = "DIPUTADOS LOCALES";
                }
                else
                if (rCasilla.tipoEleccion == "F")
                {
                    tipo = "DIPUTADOS FEDERALES";
                }
                else
                if (rCasilla.tipoEleccion == "S")
                {
                    tipo = "SENADORES";
                }
                else
                if (rCasilla.tipoEleccion == "P")
                {
                    tipo = "PRESIDENTES";
                }
                else
                {
                    return(View("Index"));
                }

                ViewBag.Tipo = tipo;

                var oRR = new EstadoCasillaRepository();
                List <EstadoCasilla> estados = new List <EstadoCasilla>();

                if (Rol != null)
                {
                    if (Rol == "A")
                    {
                        estados = oRR.RetrieveAllEstadosCasilla();
                    }

                    if (Rol == "C")
                    {
                        estados = oRR.RetrieveAllEstadosCasillaCapturista();
                    }
                }

                ViewBag.status = new SelectList(estados, "idEstado", "descripcion", "A");

                return(View());
            }
        }