public IHttpActionResult PutPreguntaTurno(int id, PreguntaTurno PreguntaTurno)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != PreguntaTurno.Id)
            {
                return(BadRequest());
            }

            db.Entry(PreguntaTurno).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PreguntaTurnoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #2
0
        public IHttpActionResult PutGembaWalk(int id, GembaWalk GembaWalk)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != GembaWalk.Id)
            {
                return(BadRequest());
            }

            db.Entry(GembaWalk).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GembaWalkExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #3
0
        public ActionResult Edit(Ventana ventana)
        {
            if (ModelState.IsValid)
            {
                db.Entry(ventana).State = EntityState.Modified;
                db.SaveChanges();

                var estatus = db.StatusVentana
                              .Where(s => (s.IdVentana == ventana.Id))
                              .OrderByDescending(s => s.Fecha)
                              .Select(s => s.Status)
                              .FirstOrDefault();

                if (estatus.Nombre == "Rechazo")
                {
                    changeEstatus(ventana);
                }

                return(RedirectToAction("Index", "Evento", new { Area = "Operaciones" }));
            }

            ViewBag.IdProveedor    = new SelectList(db.Proveedores.Select(x => new { Id = x.Id, NombreCorto = x.NombreCorto }).OrderBy(x => x.NombreCorto), "Id", "NombreCorto", ventana.IdProveedor);
            ViewBag.IdProcedencia  = new SelectList(db.Locacion.Select(x => new { Id = x.Id, Nombre = (x.NombreCorto + " " + x.Nombre) }).OrderBy(x => x.Nombre), "Id", "Nombre", ventana.IdProcedencia);
            ViewBag.IdDestino      = new SelectList(db.Locacion.Select(x => new { Id = x.Id, Nombre = (x.NombreCorto + " " + x.Nombre) }).OrderBy(x => x.Nombre), "Id", "Nombre", ventana.IdDestino);
            ViewBag.IdSubCategoria = new SelectList(db.SubCategoria.Where(x => (x.IdCategoria == 10)).Select(x => new { Id = x.Id, Nombre = x.Nombre }).OrderBy(x => x.Nombre), "Id", "Nombre", ventana.IdSubCategoria);
            ViewBag.IdOperacion    = new SelectList(db.TipoOperacion.Select(x => new { Id = x.Id, Nombre = x.Nombre }).OrderBy(x => x.Nombre), "Id", "Nombre", ventana.IdOperacion);

            return(View(ventana));
        }
Example #4
0
        public ActionResult Edit(Evento evento, int IdListaDistribucion)
        {
            if (ModelState.IsValid)
            {
                evento.Activo          = true;
                db.Entry(evento).State = EntityState.Modified;
                changeStatus(evento);
                db.SaveChanges();

                //Modify IdSubcategoria inside Ventana object
                var ventana = db.Ventana.Where(v => v.IdEvento == evento.Id).FirstOrDefault();

                if (ventana != null)
                {
                    ventana.IdSubCategoria  = evento.IdSubCategoria;
                    db.Entry(ventana).State = EntityState.Modified;
                    db.SaveChanges();
                }

                if (IdListaDistribucion != 0)
                {
                    // Remove the old asignation
                    var responsables = db.EventoResponsable
                                       .Where(d => d.IdEvento == evento.Id)
                                       .ToList();

                    foreach (var responsable in responsables)
                    {
                        db.EventoResponsable.Remove(responsable);
                    }

                    //Add new asignation
                    var lista = db.ListaDistribucion
                                .Where(x => x.Id == IdListaDistribucion)
                                .Select(x => x.IdPersona)
                                .ToList();

                    foreach (var item in lista)
                    {
                        EventoResponsable eResponsable = new EventoResponsable();
                        eResponsable.IdEvento      = evento.Id;
                        eResponsable.IdResponsable = item;
                        db.EventoResponsable.Add(eResponsable);
                        db.SaveChanges();
                    }
                }

                return(RedirectToAction("Index"));
            }

            ViewBag.IdAsignador    = new SelectList(db.Personas.Select(x => new { Id = x.Id, Nombre = x.Nombre + " " + x.Apellido1 + " " + x.Apellido2 }).OrderBy(x => x.Nombre), "Id", "Nombre");
            ViewBag.IdCategoria    = new SelectList(db.Categoria.Select(x => new { Id = x.Id, Nombre = x.Nombre }).OrderBy(x => x.Nombre), "Id", "Nombre", evento.IdCategoria);
            ViewBag.IdSubCategoria = new SelectList(db.SubCategoria.Select(x => new { Id = x.Id, Nombre = x.Nombre }).OrderBy(x => x.Nombre), "Id", "Nombre", evento.IdSubCategoria);
            return(View(evento));
        }
Example #5
0
        public IHttpActionResult PutActividadEnDefecto(int id, ActividadEnDefecto actividadEnDefecto)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != actividadEnDefecto.Id)
            {
                return(BadRequest());
            }

            db.Entry(actividadEnDefecto).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ActividadEnDefectoExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #6
0
        public IHttpActionResult PutEventoResponsable(int id, EventoResponsable eventoResponsable)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != eventoResponsable.Id)
            {
                return(BadRequest());
            }

            db.Entry(eventoResponsable).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EventoResponsableExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #7
0
        public IHttpActionResult PutIndicador(int id, Indicador indicador)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != indicador.Id)
            {
                return(BadRequest());
            }

            db.Entry(indicador).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!IndicadorExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #8
0
        public IHttpActionResult PutNoConformidad(int id, NoConformidad noConformidad)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != noConformidad.Id)
            {
                return(BadRequest());
            }

            db.Entry(noConformidad).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NoConformidadExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #9
0
        public IHttpActionResult PutRespuesta(int id, Respuesta Respuesta)
        {
            Respuesta.Fecha = DateTime.Now;

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

            if (id != Respuesta.Id)
            {
                return(BadRequest());
            }

            db.Entry(Respuesta).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RespuestaExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #10
0
        public IHttpActionResult PutMarca(string code_FA, Marca marca)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (code_FA != marca.Code_FA)
            {
                return(BadRequest());
            }

            db.Entry(marca).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!MarcaExists(code_FA))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutShiftLeaders(int id, ShiftLeaders shiftLeaders)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != shiftLeaders.Id)
            {
                return(BadRequest());
            }

            db.Entry(shiftLeaders).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ShiftLeadersExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutBussinesUnit(int id, BussinesUnit bussinesUnit)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != bussinesUnit.Id)
            {
                return(BadRequest());
            }

            db.Entry(bussinesUnit).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BussinesUnitExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutListaDistribucion(int id, ListaDistribucion listaDistribucion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != listaDistribucion.Id)
            {
                return(BadRequest());
            }

            db.Entry(listaDistribucion).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ListaDistribucionExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public RespuestaServicio <MantenimientoView> PutMantenimiento(int id, string NotificacionSAP)
        {
            RespuestaServicio <MantenimientoView> respuesta = new RespuestaServicio <MantenimientoView>();

            Mantenimiento Mantenimiento = db.Mantenimiento.Find(id);

            if (Mantenimiento == null)
            {
                return(respuesta);
            }

            db.Entry(Mantenimiento).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                respuesta.Mensaje = ex.ToString();
                return(respuesta);
            }

            respuesta = GetMantenimiento(Mantenimiento.Id);

            return(respuesta);
        }
Example #15
0
        public IHttpActionResult PutWorkFlow(int id, WorkFlow workFlow)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != workFlow.Id)
            {
                return(BadRequest());
            }

            db.Entry(workFlow).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!WorkFlowExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #16
0
        public RespuestaServicio <GembaWalkView> PutGembaWalk(int id, string NotificacionSAP)
        {
            RespuestaServicio <GembaWalkView> respuesta = new RespuestaServicio <GembaWalkView>();

            GembaWalk GembaWalk = db.GembaWalk.Find(id);

            if (GembaWalk == null)
            {
                return(respuesta);
            }

            db.Entry(GembaWalk).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                respuesta.Mensaje = ex.ToString();
                return(respuesta);
            }

            respuesta = GetGembaWalk(GembaWalk.Id);

            return(respuesta);
        }
Example #17
0
        public RespuestaServicio <WorkFlowView> PutWorkFlow(int id, string NotificacionSAP)
        {
            RespuestaServicio <WorkFlowView> respuesta = new RespuestaServicio <WorkFlowView>();

            WorkFlow workFlow = db.WorkFlows.Find(id);

            if (workFlow == null)
            {
                return(respuesta);
            }

            db.Entry(workFlow).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                respuesta.Mensaje = ex.ToString();
                return(respuesta);
            }

            respuesta = GetWorkFlow(workFlow.Id);

            return(respuesta);
        }
Example #18
0
 public ActionResult Edit([Bind(Include = "Id,Nombre,Activo")] Puesto puesto)
 {
     if (ModelState.IsValid)
     {
         db.Entry(puesto).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(puesto));
 }
 public ActionResult Edit([Bind(Include = "Id,Nombre,Activo")] ModuloSeccion moduloSeccion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(moduloSeccion).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(moduloSeccion);
 }
Example #20
0
 public ActionResult Edit([Bind(Include = "Id,Nombre,DDS,IdCategoria,Activo")] Respuesta GrupoPreguntas)
 {
     if (ModelState.IsValid)
     {
         db.Entry(GrupoPreguntas).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(GrupoPreguntas));
 }
Example #21
0
 public ActionResult Edit([Bind(Include = "Id,Desccripcion,Hora_Inicial,Hora_Final,Activo")] Horario horario)
 {
     if (ModelState.IsValid)
     {
         db.Entry(horario).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(horario));
 }
Example #22
0
 public ActionResult Edit(Pregunta Preguntas)
 {
     if (ModelState.IsValid)
     {
         db.Entry(Preguntas).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(Preguntas));
 }
Example #23
0
 public ActionResult Edit([Bind(Include = "Id,NumeroProveedor,Nombre,NombreCorto,IdCategoria,Activo")] Proveedores proveedores)
 {
     if (ModelState.IsValid)
     {
         db.Entry(proveedores).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(proveedores));
 }
Example #24
0
 public ActionResult Edit([Bind(Include = "Id,Nombre,NombreCorto,Activo")] Carrier carrier)
 {
     if (ModelState.IsValid)
     {
         db.Entry(carrier).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(carrier));
 }
Example #25
0
 public ActionResult Edit([Bind(Include = "Id,Email,EmailConfirmed,PasswordHash,SecurityStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockOutEndDateUTC,LockOutEnabled,AccessFailedCount,UserName")] AspNetUser aspNetUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aspNetUser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aspNetUser));
 }
 public ActionResult Edit([Bind(Include = "Id,Nombre,Comentario,Email,Solicitud,Aprobacion")] RequisicionDeDescarga requisicionDeDescarga)
 {
     if (ModelState.IsValid)
     {
         db.Entry(requisicionDeDescarga).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(requisicionDeDescarga));
 }
Example #27
0
 public ActionResult Edit(BitacoraVentana bitacoraVentana)
 {
     if (ModelState.IsValid)
     {
         db.Entry(bitacoraVentana).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(bitacoraVentana));
 }
Example #28
0
 public ActionResult Edit([Bind(Include = "Id,Description,YTD,Mes_Efectivo,Anio_Efectivo")] KPI kPI)
 {
     if (ModelState.IsValid)
     {
         db.Entry(kPI).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(kPI));
 }
Example #29
0
 public ActionResult Edit(Formato formato)
 {
     if (ModelState.IsValid)
     {
         db.Entry(formato).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(formato));
 }
Example #30
0
 public ActionResult Edit(Marca marca)
 {
     if (ModelState.IsValid)
     {
         db.Entry(marca).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(marca));
 }