public ActionResult Edit([Bind(Include = "Account_Id,Login,Password,Account_Type")] Account account) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Account.Find(account.Account_Id).ToString(); } if (ModelState.IsValid) { LogManager.createlog("Edit", accountTemp); db.Entry(account).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(account)); }
public ActionResult Edit([Bind(Include = "Subject_Id,Subject_Name")] Subject subject) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Subject.Find(subject.Subject_Id).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(subject).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(subject)); }
public ActionResult Edit([Bind(Include = "Class_Room_Number,Employee_Id,Size,Subject_Id,Equipment_Description")] Class_Room class_Room) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Class_Room.Find(class_Room.Class_Room_Number).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(class_Room).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Employee_Id = new SelectList(db.Employee, "Employee_ID", "First_Name", class_Room.Employee_Id); return(View(class_Room)); }
public ActionResult Edit([Bind(Include = "Employee_ID,First_Name,Middle_Name,Surname,Pesel_Number,Telefon_Number,Account_Id,Hire_Date,Birth_Date,Adress")] Employee employee) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Employee.Find(employee.Employee_Id).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(employee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Account_Id = new SelectList(db.Account, "Account_Id", "Login", employee.Account_Id); return(View(employee)); }
public ActionResult Edit([Bind(Include = "Event_Id,Employee_Id,Start_Time,Duration_In_Days,Describe,Account_Group")] Event @event) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Event.Find(@event.Event_Id).ToString(); } LogManager.createlog("Edit", accountTemp.ToString()); if (ModelState.IsValid) { db.Entry(@event).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Employee_Id = new SelectList(db.Employee, "Employee_Id", "First_Name", @event.Employee_Id); return(View(@event)); }
public ActionResult Edit([Bind(Include = "Note_Id,Pupil_Id,Employee_Id,Note_Date,Positve,Describe")] Note note) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Note.Find(note.Note_Id).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(note).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.Employee_Id = new SelectList(db.Employee, "Employee_ID", "First_Name", note.Employee_Id); ViewBag.Pupil_Id = new SelectList(db.Pupil, "Pupil_Id", "First_Name", note.Pupil_Id); return View(note); }
public ActionResult Edit([Bind(Include = "Legal_Guardian_Id,First_Name,Middle_Name,Surname,Telefon_Number,Account_Id,Adress")] Legal_Guardian legal_Guardian) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Legal_Guardian.Find(legal_Guardian.Legal_Guardian_Id).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(legal_Guardian).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Account_Id = new SelectList(db.Account, "Account_Id", "Login", legal_Guardian.Account_Id); return(View(legal_Guardian)); }
public ActionResult Edit([Bind(Include = "Class_Number,Profile,Employee_Id")] School_Class school_Class) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.School_Class.Find(school_Class.Class_Number).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(school_Class).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Employee_Id = new SelectList(db.Employee, "Employee_ID", "First_Name", school_Class.Employee_Id); ViewBag.Class_Number = new SelectList(db.Lesson, "Class_Number", "Subject_Name", school_Class.Class_Number); return(View(school_Class)); }
public ActionResult Edit([Bind(Include = "Pupil_Id,First_Name,Middle_Name,Surname,Pesel_Number,Legal_Guardian_Id,Birth_Date,School_Id_Card_Number,Account_Id,Class_Number")] Pupil pupil) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Pupil.Find(pupil.Pupil_Id).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(pupil).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Account_Id = new SelectList(db.Account, "Account_Id", "Login", pupil.Account_Id); ViewBag.Legal_Guardian_Id = new SelectList(db.Legal_Guardian, "Legal_Guardian_Id", "First_Name", pupil.Legal_Guardian_Id); ViewBag.Class_Number = new SelectList(db.School_Class, "Class_Number", "Profile", pupil.Class_Number); return(View(pupil)); }
public ActionResult Edit([Bind(Include = "Mark_Id,Value,Weight,Pupil_Id,Employee_Id,Subject_Id,Describe,Mark_Date")] Mark mark) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Mark.Find(mark.Mark_Id).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(mark).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Employee_Id = new SelectList(db.Employee, "Employee_ID", "First_Name", mark.Employee_Id); ViewBag.Subject_Id = new SelectList(db.Subject, "Subject_Id", "Subject_Name", mark.Subject_Id); ViewBag.Pupil_Id = new SelectList(db.Pupil, "Pupil_Id", "First_Name", mark.Pupil_Id); return(View(mark)); }
public ActionResult Edit([Bind(Include = "Lesson_Id,Class_Number,Subject_Id,Employee_Id,Day_Of_Week,Start_Time,Class_Room_Number")] Lesson lesson) { String accountTemp = ""; using (MojDziennikEntities tempdb = new MojDziennikEntities()) { accountTemp = tempdb.Lesson.Find(lesson.Lesson_Id).ToString(); } LogManager.createlog("Edit", accountTemp); if (ModelState.IsValid) { db.Entry(lesson).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Class_Room_Number = new SelectList(db.Class_Room, "Class_Room_Number", "Class_Room_Number", lesson.Class_Room_Number); ViewBag.Employee_Id = new SelectList(db.Employee, "Employee_ID", "First_Name", lesson.Employee_Id); ViewBag.Class_Number = new SelectList(db.School_Class, "Class_Number", "Profile", lesson.Class_Number); ViewBag.Subject_Id = new SelectList(db.Subject, "Subject_Id", "Subject_Name", lesson.Subject_Id); return(View(lesson)); }