Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(string id)
        {
            vwWHheader vwWHheader = db.vwWHheaders.Find(id);

            db.vwWHheaders.Remove(vwWHheader);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,FullName,EmailAddress,RecYear,RecMonth,AWH,TotalWorkingTime,TimeDiff,TotalOvertime")] vwWHheader vwWHheader)
 {
     if (ModelState.IsValid)
     {
         db.Entry(vwWHheader).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(vwWHheader));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,FullName,EmailAddress,RecYear,RecMonth,AWH,TotalWorkingTime,TimeDiff,TotalOvertime,UserId")] vwWHheader vwWHheader)
        {
            if (ModelState.IsValid)
            {
                db.vwWHheaders.Add(vwWHheader);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(vwWHheader));
        }
Exemplo n.º 4
0
        // GET: WH/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            vwWHheader vwWHheader = db.vwWHheaders.Find(id);

            if (vwWHheader == null)
            {
                return(HttpNotFound());
            }
            return(View(vwWHheader));
        }
Exemplo n.º 5
0
        // GET: WHMonthlies
        public ActionResult Index(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            vwWHheader vwWHheader = db.vwWHheaders.Find(id.ToString());

            if (vwWHheader == null)
            {
                return(HttpNotFound());
            }
            else
            {
                ViewBag.wh = vwWHheader;
                return(View(db.vwWHMonthlies.Where(x => x.EmailAddress.Equals(User.Identity.Name) && x.RecYear == vwWHheader.RecYear && x.RecMonth == vwWHheader.RecMonth).ToList()));
            }
        }
Exemplo n.º 6
0
        // GET: WH/Details/5
        public ActionResult Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            vwWHheader vwWHheader = db.vwWHheaders.Find(id);

            if (vwWHheader == null)
            {
                return(HttpNotFound());
            }
            if (vwWHheader.EmailAddress != User.Identity.Name)
            {
                return(HttpNotFound());
            }

            var whmontly = db.vwWHMonthlies.Where(x => x.EmailAddress.Equals(User.Identity.Name) && x.RecYear == vwWHheader.RecYear && x.RecMonth == vwWHheader.RecMonth).ToList();

            ViewBag.vhmontly = whmontly;

            return(View(vwWHheader));
        }