コード例 #1
0
        public ActionResult DeleteConfirmed(string id)
        {
            EmplyeeInfo emplyeeInfo = db.EmplyeeInfoes.Find(id);

            db.EmplyeeInfoes.Remove(emplyeeInfo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "EmployeeID,EmployeeName,EmployeeAddress,EmployeePhoneNumber,EmployeeEmailID,EmployeeDoB")] EmplyeeInfo emplyeeInfo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(emplyeeInfo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(emplyeeInfo));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "EmployeeID,EmployeeName,EmployeeAddress,EmployeePhoneNumber,EmployeeEmailID,EmployeeDoB")] EmplyeeInfo emplyeeInfo)
        {
            if (ModelState.IsValid)
            {
                db.EmplyeeInfoes.Add(emplyeeInfo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(emplyeeInfo));
        }
コード例 #4
0
        // GET: EmployeeInfo/Delete/5
        public ActionResult Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EmplyeeInfo emplyeeInfo = db.EmplyeeInfoes.Find(id);

            if (emplyeeInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(emplyeeInfo));
        }