public ActionResult DeleteConfirmed(string id) { vwWHheader vwWHheader = db.vwWHheaders.Find(id); db.vwWHheaders.Remove(vwWHheader); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }
// 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())); } }
// 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)); }