コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PayInfo payInfo = db.PayInfoes.Find(id);

            db.PayInfoes.Remove(payInfo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "PayStubId,EmployeeID,Month,Pay")] PayInfo payInfo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(payInfo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EmployeeID = new SelectList(db.EmplyeeInfoes, "EmployeeID", "EmployeeName", payInfo.EmployeeID);
     return(View(payInfo));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "PayStubId,EmployeeID,Pay,Month")] PayInfo payInfo)
        {
            if (ModelState.IsValid)
            {
                db.PayInfoes.Add(payInfo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EmployeeID = new SelectList(db.EmplyeeInfoes, "EmployeeID", "EmployeeName", payInfo.EmployeeID);
            return(View(payInfo));
        }
コード例 #4
0
        // GET: PayInfoes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PayInfo payInfo = db.PayInfoes.Find(id);

            if (payInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(payInfo));
        }
コード例 #5
0
        // GET: PayInfoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PayInfo payInfo = db.PayInfoes.Find(id);

            if (payInfo == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EmployeeID = new SelectList(db.EmplyeeInfoes, "EmployeeID", "EmployeeName", payInfo.EmployeeID);
            return(View(payInfo));
        }