public int Update(TutorScheduleDTO dto)
        {
            var entity = ModelMapper.Mapper.Map <TutorSchedule>(dto);

            entity.EntityState = EntityState.Modified;
            return(_tutorScheduleRepository.Save(entity));
        }
 public ActionResult Edit(TutorScheduleDTO model)
 {
     model.EkleyenId = Convert.ToInt32(User.Claims.Where(c => c.Type == ClaimTypes.Name).Select(c => c.Value)
                                       .SingleOrDefault());
     _tutorScheduleService.Update(model);
     return(RedirectToAction("Index"));
 }
        public ActionResult Create(TutorScheduleDTO model)
        {
            model.EkleyenId = Convert.ToInt32(User.Claims.Where(c => c.Type == ClaimTypes.Name).Select(c => c.Value)
                                              .SingleOrDefault());
            model.Guid          = Guid.NewGuid();
            model.EklenmeZamani = DateTime.Now;
            model.Aktif         = true;
            model.Silindi       = false;
            model.KullaniciId   = Convert.ToInt32(User.Claims.Where(c => c.Type == ClaimTypes.Name).Select(c => c.Value)
                                                  .SingleOrDefault());

            _tutorScheduleService.Create(model);
            return(RedirectToAction("Index"));
        }
        public ActionResult AddLessonHours(TutorScheduleDTO model)
        {
            var tutorSchedule = _tutorScheduleService.GetById(Convert.ToInt32(TempData["TutorScheduleId"]));

            model.Guid          = tutorSchedule.Guid;
            model.EkleyenId     = tutorSchedule.EkleyenId;
            model.EklenmeZamani = tutorSchedule.EklenmeZamani;
            model.Aktif         = tutorSchedule.Aktif;
            model.Silindi       = tutorSchedule.Silindi;
            model.KullaniciId   = tutorSchedule.KullaniciId;
            model.LessonId      = tutorSchedule.LessonId;
            model.Id            = tutorSchedule.Id;

            _tutorScheduleService.Update(model);
            var lesson = _lessonService.GetById(tutorSchedule.LessonId);

            return(RedirectToAction("GetLesson2", new RouteValueDictionary(new { controller = "Lesson", action = "GetLesson2", guid = lesson.Guid })));
        }
        public ActionResult LessonHours(Guid guid)
        {
            var tutorLesson        = _tutorLessonService.GetByGuid(guid);
            TutorScheduleDTO model = new TutorScheduleDTO();

            model.Guid      = Guid.NewGuid();
            model.EkleyenId = Convert.ToInt32(User.Claims.Where(c => c.Type == ClaimTypes.Name).Select(c => c.Value)
                                              .SingleOrDefault());
            model.Guid          = Guid.NewGuid();
            model.EklenmeZamani = DateTime.Now;
            model.Aktif         = true;
            model.Silindi       = false;
            model.KullaniciId   = Convert.ToInt32(User.Claims.Where(c => c.Type == ClaimTypes.Name).Select(c => c.Value)
                                                  .SingleOrDefault());
            model.LessonId = _lessonService.GetById(tutorLesson.LessonId).Id;

            var id            = _tutorScheduleService.Create(model);
            var tutorSchedule = _tutorScheduleService.GetById(id);

            return(RedirectToAction("AddLessonHours", new RouteValueDictionary(new { controller = "TutorSchedule", action = "AddLessonHours", guid = tutorSchedule.Guid })));
        }
Esempio n. 6
0
 public int Update(TutorScheduleDTO lesson)
 {
     return(_tutorScheduleRepository.Update(lesson));
 }