// 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());
        }
示例#2
0
        public void DeleteStudent(int studentID)
        {
            TimesheetWorkItem student = context.TimesheetWorkItem.Find(studentID);

            context.TimesheetWorkItem.Remove(student);
        }
示例#3
0
 public void UpdateStudent(TimesheetWorkItem student)
 {
     context.Entry(student).State = EntityState.Modified;
 }
示例#4
0
 public void InsertStudent(TimesheetWorkItem student)
 {
     context.TimesheetWorkItem.Add(student);
 }