示例#1
0
 public void Update(Employee employee)
 {
     db.Entry(employee).State = EntityState.Modified;
     db.Configuration.ValidateOnSaveEnabled = false;
     Save();
     db.Configuration.ValidateOnSaveEnabled = true;
 }
 public ActionResult Edit([Bind(Include = "Id,Description,Date,Time,NoteType,Employee_Id")] Note note)
 {
     if (ModelState.IsValid)
     {
         db.Entry(note).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Employee_Id = new SelectList(db.Employees, "Id", "F_Name", note.Employee_Id);
     return(View(note));
 }
 public ActionResult Edit([Bind(Include = "Id,F_Name,L_Name,Email,Password,Role_Id,EmployeeStatus,Manager_Id")] Employee employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Role_Id = new SelectList(db.Roles, "id", "Role1", employee.Role_Id);
     return(View(employee));
 }
 public ActionResult Edit([Bind(Include = "Id,Start_Time,End_Time,Meeting_Date,Date_Scheduled,Topic,MeetingStatus_id,MeetingType_id,Pause_Start_Time,Pause_End_Time")] Meeting meeting)
 {
     if (ModelState.IsValid)
     {
         db.Entry(meeting).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MeetingStatus_id = new SelectList(db.MeetingStatus, "id", "status", meeting.MeetingStatus_id);
     ViewBag.MeetingType_id   = new SelectList(db.MeetingTypes, "id", "meeting_type", meeting.MeetingType_id);
     return(View(meeting));
 }
 public ActionResult Edit([Bind(Include = "Id,Employee_Id,Meeting_Id,IsRequired")] MeetingEmployee meeting_Employee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(meeting_Employee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Employee_Id = new SelectList(db.Employees, "Id", "F_Name", meeting_Employee.Employee_Id);
     ViewBag.Meeting_Id  = new SelectList(db.Meetings, "Id", "Topic", meeting_Employee.Meeting_Id);
     return(View(meeting_Employee));
 }
示例#6
0
 public ActionResult Edit([Bind(Include = "Id,Employee_Id,Guest_Id")] EmployeeGuest employee_Guest)
 {
     if (ModelState.IsValid)
     {
         db.Entry(employee_Guest).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Employee_Id = new SelectList(db.Employees, "Id", "F_Name", employee_Guest.Employee_Id);
     ViewBag.Guest_Id    = new SelectList(db.Guests, "Id", "F_Name", employee_Guest.Guest_Id);
     return(View(employee_Guest));
 }