public bool AgregarRechazo(long IndiceIndicador, long IndiceRechazo, int Cantidad)
        {
            bool Estado = false;

            if (Cantidad > 0)
            {
                Rechazo rechazo = db.Rechazo.Where(columna => columna.id_rechazo == IndiceRechazo).FirstOrDefault();

                if (rechazo != null)
                {
                    IndicadorRechazo_V2 IndicadorRechazo = new IndicadorRechazo_V2
                    {
                        IndiceIndicador = IndiceIndicador,
                        IndiceRechazo   = IndiceRechazo,
                        Cantidad        = Cantidad
                    };

                    try
                    {
                        db.IndicadorRechazo_V2.Add(IndicadorRechazo);
                        Estado = true;
                    }
                    catch (Exception)
                    {
                    }
                }
            }

            return(Estado);
        }
Esempio n. 2
0
        public IHttpActionResult PutRechazo(int id, Rechazo Rechazo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Esempio n. 3
0
        public ActionResult Create(BitacoraVentana bitacoraVentana)
        {
            ViewBag.IdRechazo = new SelectList(db.Rechazo.Select(x => new { Id = x.Id, Nombre = x.Nombre }).OrderBy(x => x.Nombre), "Id", "Nombre", bitacoraVentana.IdRechazo);

            if (ModelState.IsValid)
            {
                PersonaServicio personaServicio      = new PersonaServicio();
                IRespuestaServicio <Persona> persona = personaServicio.GetPersona(User.Identity.GetUserId());

                if (persona.EjecucionCorrecta)
                {
                    bitacoraVentana.IdResponsable = persona.Respuesta.Id;
                }

                Ventana ventana = db.Ventana
                                  .Include(v => v.StatusVentana)
                                  .Where(v => (v.Id == bitacoraVentana.IdVentana))
                                  .FirstOrDefault();

                Rechazo rechazo = db.Rechazo.Find(bitacoraVentana.IdRechazo);
                bitacoraVentana.IdStatus = rechazo.IdStatus;
                bitacoraVentana.Fecha    = DateTime.Now;

                db.BitacoraVentana.Add(bitacoraVentana);
                db.SaveChanges();

                saveStatusVentana(bitacoraVentana);

                return(RedirectToAction("Index", "Evento", new { Area = "Operaciones" }));
            }
            else
            {
                return(View(bitacoraVentana));
            }
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "")
                MessageBox.Show("Especifique un motivo de rechazo");
            else
            {
                Rechazo r = new Rechazo();
                r.PartidoID = idPartido;
                r.PersonaNombre = personaNombre;
                r.Fecha = System.DateTime.Now;
                r.Motivo = textBox1.Text;

                db.Rechazos.InsertOnSubmit(r);
                db.SubmitChanges();

                InscripcionPendiente ip = (from x in db.InscripcionPendientes
                                           where x.PersonaNombre == personaNombre && x.PartidoID == idPartido
                                           select x).First();

                db.InscripcionPendientes.DeleteOnSubmit(ip);
                db.SubmitChanges();
                MessageBox.Show("Rechazo realizado con éxito.");
                this.Close();
            }
        }
Esempio n. 5
0
        public ActionResult DeleteConfirmed(int id)
        {
            Rechazo Rechazo = db.Rechazo.Find(id);

            db.Rechazo.Remove(Rechazo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 6
0
 public ActionResult Edit(Rechazo Rechazo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(Rechazo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(Rechazo));
 }
Esempio n. 7
0
        public IHttpActionResult GetRechazo(int id)
        {
            Rechazo Rechazo = db.Rechazo.Find(id);

            if (Rechazo == null)
            {
                return(NotFound());
            }

            return(Ok(Rechazo));
        }
Esempio n. 8
0
        public ActionResult Create(Rechazo Rechazo)
        {
            if (ModelState.IsValid)
            {
                db.Rechazo.Add(Rechazo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(Rechazo));
        }
Esempio n. 9
0
        public IHttpActionResult PostRechazo(Rechazo Rechazo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Rechazo.Add(Rechazo);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = Rechazo.Id }, Rechazo));
        }
Esempio n. 10
0
        public IHttpActionResult DeleteRechazo(int id)
        {
            Rechazo Rechazo = db.Rechazo.Find(id);

            if (Rechazo == null)
            {
                return(NotFound());
            }

            db.Rechazo.Remove(Rechazo);
            db.SaveChanges();

            return(Ok(Rechazo));
        }
Esempio n. 11
0
        // GET: Warehouse/Rechazo/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Rechazo Rechazo = db.Rechazo.Find(id);

            if (Rechazo == null)
            {
                return(HttpNotFound());
            }
            return(View(Rechazo));
        }