ویومدل مربوط به درج سابقه کاری
Ejemplo n.º 1
0
        public virtual async Task<ActionResult> Create(AddWorkExperienceViewModel viewModel)
        {
            if (!_referentialTeacherService.CanManageTeacher(viewModel.TeacherId)) return HttpNotFound();
            if (!ModelState.IsValid)
            {
               await _workExperienceService.FillAddViewModel(viewModel, IranCitiesPath);
                return new JsonNetResult
                {
                    Data = new
                    {
                        success = false,
                        View = this.RenderPartialViewToString(MVC.WorkExperience.Views._Create, viewModel)
                    }
                };

            }
          var newWork=await  _workExperienceService.Create(viewModel);
            
            return new JsonNetResult
            {
                Data = new
                {
                    success = true,
                    View = this.RenderPartialViewToString(MVC.WorkExperience.Views._WorkExperienceItem, newWork)
                }
            };
        }
Ejemplo n.º 2
0
 public async Task<WorkExperienceViewModel> Create(AddWorkExperienceViewModel viewModel)
 {
     var workExperience = _mappingEngine.Map<WorkExperience>(viewModel);
     _workExperiences.Add(workExperience);
     await _unitOfWork.SaveChangesAsync();
     return await GetWorkExperienceViewModel(workExperience.Id);
 }
Ejemplo n.º 3
0
 public async Task FillAddViewModel(AddWorkExperienceViewModel viewModel,string path)
 {
     viewModel.States = _stateService.GetAsSelectListItemAsync(viewModel.State, path);
     viewModel.Cities = _cityService.GetAsSelectListByStateNameAsync(viewModel.State, viewModel.City, path);
     viewModel.Titles = await _titleService.GetAsSelectListItemAsync(TitleType.OrganizationPostTitle, viewModel.TitleId);
 }
Ejemplo n.º 4
0
 public async Task FillAddViewModel(AddWorkExperienceViewModel viewModel, string path)
 {
     viewModel.States = _stateService.GetAsSelectListItemAsync(viewModel.State, path);
     viewModel.Cities = _cityService.GetAsSelectListByStateNameAsync(viewModel.State, viewModel.City, path);
 }