Example #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            t_objetivos t_objetivos = db.t_objetivos.Find(id);

            db.t_objetivos.Remove(t_objetivos);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "empleado,axo,planta,fecha,estatus,aprobado,f_aprobado,revision1,nota_r1,f_r1,revision2,nota_r2,f_r2,resultado_prom,calificacion,u_id,f_id,f_enviado,n_aprobado")] t_objetivos t_objetivos)
 {
     if (ModelState.IsValid)
     {
         db.Entry(t_objetivos).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.empleado = new SelectList(db.t_empleados, "empleado", "nombre", t_objetivos.empleado);
     ViewBag.planta   = new SelectList(db.t_plantas, "planta", "nombre", t_objetivos.planta);
     return(View(t_objetivos));
 }
Example #3
0
        // GET: t_objetivos/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            t_objetivos t_objetivos = db.t_objetivos.Find(id);

            if (t_objetivos == null)
            {
                return(HttpNotFound());
            }
            return(View(t_objetivos));
        }
Example #4
0
        // GET: t_objetivos/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            t_objetivos t_objetivos = db.t_objetivos.Find(id);

            if (t_objetivos == null)
            {
                return(HttpNotFound());
            }
            ViewBag.empleado = new SelectList(db.t_empleados, "empleado", "nombre", t_objetivos.empleado);
            ViewBag.planta   = new SelectList(db.t_plantas, "planta", "nombre", t_objetivos.planta);
            return(View(t_objetivos));
        }
Example #5
0
        public ActionResult SendToFirstApproval(string empleado, int axo)
        {
            if (empleado == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            t_objetivos t_objetivos = db.t_objetivos.Find(empleado, axo);

            if (t_objetivos == null)
            {
                return(HttpNotFound());
            }
            t_objetivos.estatus         = "EN";
            t_objetivos.f_enviado       = System.DateTime.Now;
            t_objetivos.u_id            = Convert.ToString(Session["userAccount"]);
            t_objetivos.f_id            = System.DateTime.Now;
            db.Entry(t_objetivos).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Approval", "t_objetidet", new { empleado = empleado, axo = axo }));
        }
Example #6
0
        public ActionResult Reject(string empleado, int axo, string n_aprobado)
        {
            if (empleado == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            t_objetivos t_objetivos = db.t_objetivos.Find(empleado, axo);

            if (t_objetivos == null)
            {
                return(HttpNotFound());
            }
            t_objetivos.estatus    = "PE";
            t_objetivos.n_aprobado = n_aprobado;
            t_objetivos.u_id       = Convert.ToString(Session["EmployeeNo"]);
            t_objetivos.f_id       = System.DateTime.Now;

            db.Entry(t_objetivos).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Approval", "t_objetidet", new { empleado = empleado, axo = axo, ismanager = true }));
        }
Example #7
0
        public ActionResult CreateHeader(string empleado, decimal axo)
        {
            t_objetivos t_objetivos = new t_objetivos();

            t_objetivos.empleado = empleado;
            t_objetivos.axo      = axo;
            t_objetivos.estatus  = "PE";
            t_objetivos.fecha    = System.DateTime.Now;
            t_objetivos.planta   = empleado.Substring(0, 3);
            t_objetivos.u_id     = Convert.ToString(Session["userAccount"]);
            t_objetivos.f_id     = System.DateTime.Now;

            if (ModelState.IsValid)
            {
                db.t_objetivos.Add(t_objetivos);
                db.SaveChanges();
                return(RedirectToAction("Create", "t_objetidet", new { empleado = t_objetivos.empleado, axo = t_objetivos.axo }));
            }

            return(View(t_objetivos));
        }