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

            db.vwWHheaders.Remove(vwWHheader);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio 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));
 }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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()));
            }
        }
Esempio 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));
        }