示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            is_staffDetails is_staffDetails = db.is_staffDetails.Find(id);

            db.is_staffDetails.Remove(is_staffDetails);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "detailsID,badgeID,fName,lName,dept,phone,birthdate")] is_staffDetails is_staffDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(is_staffDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(is_staffDetails));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "detailsID,badgeID,fName,lName,dept,phone,birthdate")] is_staffDetails is_staffDetails)
        {
            if (ModelState.IsValid)
            {
                db.is_staffDetails.Add(is_staffDetails);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(is_staffDetails));
        }
示例#4
0
        // GET: StaffDetails/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            is_staffDetails is_staffDetails = db.is_staffDetails.Find(id);

            if (is_staffDetails == null)
            {
                return(HttpNotFound());
            }
            return(View(is_staffDetails));
        }
        public ActionResult StaffRegister([Bind(Include = "detailsID,badgeID,fName,lName,dept,phone,birthdate")] is_staffDetails is_staffDetails, int choice)
        {
            if (ModelState.IsValid)
            {
                db.is_staffDetails.Add(is_staffDetails);
                is_StaffClass staffClass = new is_StaffClass
                {
                    badgeID  = is_staffDetails.badgeID,
                    classID  = choice,
                    approved = false,
                    endDate  = DateTime.Parse("01/01/2001 01:00:00 AM"),
                    status   = false
                };
                db.StaffClasses.Add(staffClass);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(is_staffDetails));
        }