Esempio n. 1
0
        public async Task <IActionResult> OnPostAsync(int edificio_, int espacio_, int evento_, int zona_, int horario_, int boleto_)
        {
            res_evento_zona_boleto_estatus.FechaEstatus = DateTime.Now;
            if (!ModelState.IsValid)
            {
                return(Page());
            }


            IQueryable <res_evento_zona_boleto_estatus> eventos = from s in _context.res_evento_zona_boleto_estatus
                                                                  select s;

            anteriores_res_evento_zona_boleto_estatus = await eventos.Where(m => m.IdBoleto == boleto_)
                                                        .AsNoTracking()
                                                        .ToListAsync();

            _context.res_evento_zona_boleto_estatus.Add(res_evento_zona_boleto_estatus);
            await _context.SaveChangesAsync();

            foreach (res_evento_zona_boleto_estatus d in anteriores_res_evento_zona_boleto_estatus)
            {
                d.Actual = "N";
                _context.Attach(d).State = EntityState.Modified;
                await _context.SaveChangesAsync();
            }



            return(RedirectToPage("./Index", new { id = res_evento_zona_boleto_estatus.IdBoleto,
                                                   edificio = edificio_,
                                                   espacio = espacio_,
                                                   evento = evento_,
                                                   zona = zona_,
                                                   horario = horario_ }));
        }
Esempio n. 2
0
        public async Task <IActionResult> OnPostAsync()
        {
            res_evento_horarios.FechaReg = DateTime.Now;
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            res_evento_horarios.Dia = getDia(res_evento_horarios.FechaHoraIni.DayOfWeek);
            _context.Attach(res_evento_horarios).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!res_evento_horariosExists(res_evento_horarios.IdHorarioDet))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index", new { id = res_evento_horarios.IdEvento }));
        }
Esempio n. 3
0
        public async Task <IActionResult> OnPostAsync()
        {
            seg_usuarios_estatu.FechaReg = DateTime.Now;
            //seg_usuarios_estatu.FechaUltMod = DateTime.Now;
            seg_usuarios_estatu.Activo  = "S";
            seg_usuarios_estatu.Borrado = "N";
            //seg_usuarios_estatu.UsuarioMod = Microsoft.AspNetCore.Mvc.Razor.Global.name;
            seg_usuarios_estatu.UsuarioReg    = Microsoft.AspNetCore.Mvc.Razor.Global.name;
            seg_usuarios_estatu.Actual        = "S";
            seg_usuarios_estatu.FechaEstatus  = DateTime.Now;
            seg_usuarios_estatu.IdTipoEstatus = 4;

            _context.seg_usuarios_estatus.Add(seg_usuarios_estatu);
            await _context.SaveChangesAsync();

            var cambiarPrincipal = await _context.seg_usuarios_estatus.SingleOrDefaultAsync
                                       (m => m.IdCrtlEstatus != seg_usuarios_estatu.IdCrtlEstatus && m.Actual == "S" && m.IdUsuario == seg_usuarios_estatu.IdUsuario);

            //Si es nulo significa que aun no registraban ningun domicilio como principal
            if (cambiarPrincipal != null)
            {
                cambiarPrincipal.Actual = "N";
                _context.SaveChanges();
            }//if cambiarPrincipal != null

            return(RedirectToPage("./Index"));
        }
Esempio n. 4
0
        public async Task <IActionResult> OnPostAsync(bool ExpiraP)
        {
            var usuarioExiste = await _context.cat_usuarios.SingleOrDefaultAsync(m => m.Usuario == cat_usuario.Usuario);

            //Signfica que si encontro coincidencias, entonces le mandamos un mensaje de que ya existe
            if (usuarioExiste != null)
            {
                ViewData["IdPersona"] = new SelectList(_context.rh_cat_personas, "IdPersona", "Nombre");
                ViewData["Error"]     = "El usuario \"" + cat_usuario.Usuario + "\" ya se encuentra registrado!";
                return(Page());
            }

            cat_usuario.Conectado   = "N";
            cat_usuario.FechaAlta   = DateTime.Now;
            cat_usuario.FechaReg    = DateTime.Now;
            cat_usuario.FechaUltMod = DateTime.Now;
            cat_usuario.Activo      = "S";
            cat_usuario.Borrado     = "N";
            cat_usuario.UsuarioMod  = Microsoft.AspNetCore.Mvc.Razor.Global.name;
            cat_usuario.UsuarioReg  = Microsoft.AspNetCore.Mvc.Razor.Global.name;

            //Si selecciono de expirar o no
            if (ExpiraP)
            {
                cat_usuario.Expira = "S";
            }
            else
            {
                cat_usuario.Expira = "N";
            }

            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.cat_usuarios.Add(cat_usuario);
            await _context.SaveChangesAsync();

            //Una ve que se crea el usuario, se le asigna el estatus activo por defecto
            estatu.IdUsuario    = cat_usuario.IdUsuario;
            estatu.FechaEstatus = DateTime.Now;
            estatu.Actual       = "S";
            estatu.Observacion  = "Creación del usuario";
            //estatu.FechaUltMod = DateTime.Now;
            estatu.UsuarioReg = "Admin";
            //estatu.UsuarioMod = "Admin";
            estatu.Activo        = "S";
            estatu.Borrado       = "N";
            estatu.FechaReg      = DateTime.Now;
            estatu.IdTipoEstatus = 4;
            estatu.IdEstatus     = 1;

            var result = _context.Add(estatu);

            _context.SaveChanges(); // Saving Data in database


            return(RedirectToPage("./Index"));
        }
Esempio n. 5
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(cat_prod_serv_especifico).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!cat_prod_serv_especificoExists(cat_prod_serv_especifico.IdProdServEsp))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index", new { id = cat_prod_serv_especifico.IdProdServ }));
        }
        public async Task <IActionResult> OnPostAsync(int id, int IdHorario_)
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            int d = _context.res_evento_zona_boletos.Count();

            int cantidad_ = id;

            res_evento_zona_boletos.IdBoleto = d + res_evento_zona_boletos.IdBoleto;
            for (int i = 1; i <= cantidad_; i++)
            {
                res_evento_zona_boletos.NumBoleto = "BOLETO_" + (i + d);
                res_evento_zona_boletos.Ubicacion = "Asiento No. " + (i + d);
                res_evento_zona_boletos.IdBoleto  = res_evento_zona_boletos.IdBoleto + 1;
                _context.res_evento_zona_boletos.Add(res_evento_zona_boletos);
                await _context.SaveChangesAsync();
            }


            return(RedirectToPage("./Index", new { edificio = res_evento_zona_boletos.IdEdificio,
                                                   espacio = res_evento_zona_boletos.IdEspacio,
                                                   evento = res_evento_zona_boletos.IdEvento,
                                                   zona = res_evento_zona_boletos.IdZona,
                                                   horario = IdHorario_ }));
        }
Esempio n. 7
0
        public async Task <IActionResult> OnPostAsync()
        {
            //seg_usuarios_estatu.FechaUltMod = DateTime.Now;
            //seg_usuarios_estatu.UsuarioMod = Microsoft.AspNetCore.Mvc.Razor.Global.name;

            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(seg_usuarios_estatu).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!seg_usuarios_estatuExists(seg_usuarios_estatu.IdCrtlEstatus))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 8
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            res_cat_zonas.CapacidadPer           = res_cat_zonas.Filas * res_cat_zonas.AsientosPorFila;
            _context.Attach(res_cat_zonas).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!res_cat_zonasExists(res_cat_zonas.IdZona))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index", new { espacio = res_cat_zonas.IdEspacio, edificio = res_cat_zonas.IdEdificio }));
        }
Esempio n. 9
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(eva_cat_edificios).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!eva_cat_edificiosExists(eva_cat_edificios.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 10
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (SeleccionoProductoServicio())
            {
                getTiposProdServEsp();
                IdEvento = res_evento_servicios.IdEvento;
            }
            if (!ModelState.IsValid || res_evento_servicios.IdEvento == 0)
            {
                return(Page());
            }

            if (seRepite(
                    res_evento_servicios.IdEvento,
                    res_evento_servicios.Requerido,
                    res_evento_servicios.IdProdServ,
                    res_evento_servicios.IdProdServEsp))
            {
                seRepiteRegistro = true;
                return(Page());
            }

            if (res_evento_servicios.Requerido != "S" && res_evento_servicios.Requerido != "N")
            {
                res_evento_servicios.Requerido = "S";
            }

            _context.res_evento_servicios.Add(res_evento_servicios);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index", new { id = res_evento_servicios.IdEvento }));
        }
Esempio n. 11
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(res_evento_cliente_boletos).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!res_evento_cliente_boletosExists(res_evento_cliente_boletos.IdReservaCliente, res_evento_cliente_boletos.IdEvento, res_evento_cliente_boletos.IdBoleto))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 12
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            cat_usuario = await _context.cat_usuarios.FindAsync(id);

            //Insertar seg_usuario_estatus Nuevo
            SqlConnection sqlConnection1 = new SqlConnection("Server=(local); Database=Proyecto_DAE; Trusted_Connection=True; MultipleActiveResultSets=true");
            SqlCommand    cmd            = new SqlCommand();

            SqlDataReader reader;

            //Contraseñas
            sqlConnection1.Open();

            cmd.CommandText = "delete seg_expira_claves where IdUsuario = " + cat_usuario.IdUsuario + ";";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = sqlConnection1;

            reader = cmd.ExecuteReader();

            sqlConnection1.Close();

            //Estatus
            sqlConnection1.Open();

            cmd.CommandText = "delete seg_usuarios_estatus where IdUsuario = " + cat_usuario.IdUsuario + ";";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = sqlConnection1;

            reader = cmd.ExecuteReader();

            sqlConnection1.Close();

            //Grupos
            sqlConnection1.Open();

            cmd.CommandText = "delete seg_usuarios_grupos where IdUsuario = " + cat_usuario.IdUsuario + ";";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = sqlConnection1;

            reader = cmd.ExecuteReader();

            sqlConnection1.Close();

            if (cat_usuario != null)
            {
                //Eliminamos el usuario
                _context.cat_usuarios.Remove(cat_usuario);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 13
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.res_evento_zonas.Add(res_evento_zonas);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Esempio n. 14
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.eva_cat_espacios.Add(eva_cat_espacios);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Esempio n. 15
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            res_cat_zonas.CapacidadPer = res_cat_zonas.AsientosPorFila * res_cat_zonas.Filas;
            _context.res_cat_zonas.Add(res_cat_zonas);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index", new { espacio = res_cat_zonas.IdEspacio, edificio = res_cat_zonas.IdEdificio }));
        }
Esempio n. 16
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.cat_prod_serv_especifico.Add(cat_prod_serv_especifico);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Esempio n. 17
0
        public async Task <IActionResult> OnPostAsync(int id_, int edificio_, int espacio_, int evento_)
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.res_evento_cliente_boletos.Add(res_evento_cliente_boletos);
            await _context.SaveChangesAsync();

            return(RedirectToPage("../EventoZonaBoletosVenta/Index", new { id = id_, edificio = edificio_, espacio = espacio_, evento = evento_ }));
        }
Esempio n. 18
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.cat_tipos_generales.Add(cat_tipos_generales);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Esempio n. 19
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            res_zonas_servicios.IdProdServ = getIDProductoServicio(res_zonas_servicios.IdProdServEsp);

            _context.res_zonas_servicios.Add(res_zonas_servicios);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index", new { edificio = res_zonas_servicios.IdEdificio, espacio = res_zonas_servicios.IdEspacio, zona = res_zonas_servicios.IdZona }));
        }
Esempio n. 20
0
        public async Task <IActionResult> OnPostAsync(int edificio_, int espacio_, int evento_)
        {
            res_evento_clientes.FechaRegistro = DateTime.Now;
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.res_evento_clientes.Add(res_evento_clientes);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index", new { edificio = edificio_, espacio = espacio_, evento = evento_ }));
        }
Esempio n. 21
0
        public async Task <IActionResult> OnPostAsync()
        {
            res_evento_horarios.FechaReg = DateTime.Now;
            res_evento_horarios.Dia      = getDia(res_evento_horarios.FechaHoraIni.DayOfWeek);
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.res_evento_horarios.Add(res_evento_horarios);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./index", new { id = res_evento_horarios.IdEvento }));
        }
Esempio n. 22
0
        public async Task <IActionResult> OnPostAsync(bool ActivoP, bool BorradoP)
        {
            rh_cat_persona.FechaUltMod = DateTime.Now;
            rh_cat_persona.UsuarioReg  = Microsoft.AspNetCore.Mvc.Razor.Global.name;

            if (!ModelState.IsValid)
            {
                return(Page());
            }

            //Activo
            if (ActivoP)
            {
                rh_cat_persona.Activo = "S";
            }
            else
            {
                rh_cat_persona.Activo = "N";
            }
            //Borrado
            if (BorradoP)
            {
                rh_cat_persona.Borrado = "S";
            }
            else
            {
                rh_cat_persona.Borrado = "N";
            }

            _context.Attach(rh_cat_persona).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!rh_cat_personaExists(rh_cat_persona.IdPersona))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 23
0
        public async Task <IActionResult> OnPostAsync(String search)
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            res_evento_cliente_prod_serv.IdProdServ = getIDProductoServicio(res_evento_cliente_prod_serv.IdProdServEsp);
            res_evento_cliente_prod_serv.IdEvento   = getIdEvento(res_evento_cliente_prod_serv.IdReservaCliente);
            res_evento_cliente_prod_serv.Importe    = res_evento_cliente_prod_serv.Cantidad * (
                res_evento_cliente_prod_serv.Precio + res_evento_cliente_prod_serv.Precio * res_evento_cliente_prod_serv.IVA / 100);
            _context.res_evento_cliente_prod_serv.Add(res_evento_cliente_prod_serv);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Esempio n. 24
0
        public async Task <IActionResult> OnPostAsync(string persona)
        {
            res_eventos.FechaReg     = DateTime.Now;
            res_eventos.IdPersonaReg = buscar(persona);
            if (!ModelState.IsValid || res_eventos.IdPersonaReg == -1)
            {
                return(Page());
            }


            _context.res_eventos.Add(res_eventos);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./Index"));
        }
Esempio n. 25
0
        public async Task <IActionResult> OnPostAsync(int reserva, int evento, int boleto)
        {
            res_evento_cliente_boletos = await _context.res_evento_cliente_boletos.SingleOrDefaultAsync(m =>
                                                                                                        m.IdBoleto == boleto &&
                                                                                                        m.IdEvento == evento &&
                                                                                                        m.IdReservaCliente == reserva);

            if (res_evento_cliente_boletos != null)
            {
                _context.res_evento_cliente_boletos.Remove(res_evento_cliente_boletos);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 26
0
        public async Task <IActionResult> OnPostAsync(int evento, string requerido, int prodserv, int prodservesp)
        {
            res_evento_servicios = await _context.res_evento_servicios.SingleOrDefaultAsync(m =>
                                                                                            m.IdEvento == evento &&
                                                                                            m.Requerido.Contains(requerido) &&
                                                                                            m.IdProdServ == prodserv &&
                                                                                            m.IdProdServEsp == prodservesp);

            if (res_evento_servicios != null)
            {
                _context.res_evento_servicios.Remove(res_evento_servicios);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index", new { id = res_evento_servicios.IdEvento }));
        }
Esempio n. 27
0
        public async Task <IActionResult> OnPostAsync(int id, int IdHorario_)
        {
            res_evento_zona_boletos = await _context.res_evento_zona_boletos.FindAsync(id);

            if (res_evento_zona_boletos != null)
            {
                _context.res_evento_zona_boletos.Remove(res_evento_zona_boletos);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index", new { edificio = res_evento_zona_boletos.IdEdificio,
                                                   espacio = res_evento_zona_boletos.IdEspacio,
                                                   evento = res_evento_zona_boletos.IdEvento,
                                                   zona = res_evento_zona_boletos.IdZona,
                                                   horario = IdHorario_ }));
        }
Esempio n. 28
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            res_evento_cliente_prod_serv = await _context.res_evento_cliente_prod_serv.FindAsync(id);

            if (res_evento_cliente_prod_serv != null)
            {
                _context.res_evento_cliente_prod_serv.Remove(res_evento_cliente_prod_serv);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 29
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            cat_tipos_generales = await _context.cat_tipos_generales.FindAsync(id);

            if (cat_tipos_generales != null)
            {
                _context.cat_tipos_generales.Remove(cat_tipos_generales);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Esempio n. 30
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            rh_cat_personas = await _context.rh_cat_personas.FindAsync(id);

            if (rh_cat_personas != null)
            {
                _context.rh_cat_personas.Remove(rh_cat_personas);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }