Exemplo n.º 1
0
        //public ActionResult Edit(int id)
        //{
        //    var result = _tutorTraineeService.Get(id);
        //    if (!result.Success)
        //    {
        //        return Error(new StatusModel(false, result.Message));
        //    }
        //    return View(result.Data);

        //    return new HttpNotFoundResult();
        //}

        //[HttpPost]
        //public ActionResult Edit(int id, TutorTraineeModel model)
        //{
        //    var result = _tutorTraineeService.Update(id, model);
        //    if (result.Success)
        //    {
        //        return RedirectToAction("Index");
        //    }
        //    return Error(new StatusModel(false, result.Message));
        //}

        public ActionResult ManualMatch()
        {
            var model = new TutorTraineeViewModel();

            if (CurrentUser.UserRole.ToString() == "Rackaz")
            {
                ViewBag.IsRackaz = true;
                model.Area       = CurrentUser.Area;
            }
            else
            {
                ViewBag.IsRackaz = false;
            }
            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult ManualMatchAreaSelected(Area area)
        {
            var model = new TutorTraineeViewModel();

            if (CurrentUser.UserRole.ToString() == "Rackaz")
            {
                model.IsRackaz = true;
                model.Area     = area;
            }
            else
            {
                model.IsRackaz = false;
                model.Area     = null;
            }
            //Add trainee list
            var traineeStatus = _traineeService.GetUnMatchedTrainees(area, false);

            if (traineeStatus.Success)
            {
                model.Trainees = traineeStatus.Data;
            }
            else
            {
                //traineeStatus.Message = traineeStatus.Message;
                Response.StatusCode = 404;
                return(Error(traineeStatus, true));
            }
            // add tutor list
            var tutorStatus = _tutorService.GetUnMatchedTutors(area, false);

            if (tutorStatus.Success)
            {
                model.Tutors = tutorStatus.Data;
            }
            else
            {
                //tutorStatus.Message = tutorStatus.Message;
                Response.StatusCode = 404;
                return(Error(tutorStatus, true));
            }
            return(View(model));
        }