示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Factore factore = db.Factores.Find(id);

            db.Factores.Remove(factore);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult Edit([Bind(Include = "id,anosTrabajados,diasVacaciones,primaVacacional,porcentaje,diasAno,factorVacaciones,aguinaldo,diasAnoAguinaldo,factor,factorIntegracion,fechaRegistro,usuarioId")] Factore factore)
        {
            if (ModelState.IsValid)
            {
                Usuario usuario = Session["UsuarioData"] as Usuario;

                factore.usuarioId       = usuario.Id;
                db.Entry(factore).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.usuarioId = new SelectList(db.Usuarios, "Id", "nombreUsuario", factore.usuarioId);
            return(View(factore));
        }
示例#3
0
        // GET: Factores/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Factore factore = db.Factores.Find(id);

            if (factore == null)
            {
                return(HttpNotFound());
            }
            return(View(factore));
        }
示例#4
0
        // GET: Factores/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Factore factore = db.Factores.Find(id);

            if (factore == null)
            {
                return(HttpNotFound());
            }
            ViewBag.usuarioId = new SelectList(db.Usuarios, "Id", "nombreUsuario", factore.usuarioId);
            return(View(factore));
        }