// GET: TimesheetScheduler public ActionResult Index() { var a = timesheetSchedulerRepository.GetStudents(); var b = a.Where(x => x.WorkItemNumber == 354123).FirstOrDefault(); b.Comments = "Edited comment"; timesheetSchedulerRepository.UpdateStudent(b); TimesheetWorkItem newObj = new TimesheetWorkItem(); newObj.Comments = "Comments..."; newObj.Description = "DEeeeeescription"; newObj.TimesheetDate = DateTime.Now; timesheetSchedulerRepository.InsertStudent(newObj); timesheetSchedulerRepository.Save(); return(View()); }
public void DeleteStudent(int studentID) { TimesheetWorkItem student = context.TimesheetWorkItem.Find(studentID); context.TimesheetWorkItem.Remove(student); }
public void UpdateStudent(TimesheetWorkItem student) { context.Entry(student).State = EntityState.Modified; }
public void InsertStudent(TimesheetWorkItem student) { context.TimesheetWorkItem.Add(student); }