ویومدل درج ارزیابی از متقاضی
Ejemplo n.º 1
0
 public virtual async Task<ActionResult> Create(AddEntireEvaluationViewModel viewModel)
 {
    
     if (!ModelState.IsValid)
     {
          return new JsonNetResult
         {
             Data = new
             {
                 success = false,
                 View = this.RenderPartialViewToString(MVC.EntireEvaluation.Views._Create, viewModel)
             }
         };
     }
     viewModel.Content = viewModel.Content.ToSafeHtml();
     viewModel.Brief = viewModel.Brief.ToSafeHtml();
     viewModel.StrongPoint = viewModel.StrongPoint.ToSafeHtml();
     viewModel.Foible = viewModel.Foible.ToSafeHtml();
     var newEntireEvaluation = await _entireEvaluationService.Create(viewModel);
     return new JsonNetResult
     {
         Data = new
         {
             success = true,
             View = this.RenderPartialViewToString(MVC.EntireEvaluation.Views._EntireEvaluationItem, newEntireEvaluation)
         }
     };
 }
Ejemplo n.º 2
0
 public async  Task<EntireEvaluationViewModel> Create(AddEntireEvaluationViewModel viewModel)
 {
     var entireEvaluation = _mappingEngine.Map<EntireEvaluation>(viewModel);
     _entireEvaluations.Add(entireEvaluation);
     await _unitOfWork.SaveChangesAsync();
     return await _entireEvaluations
         .Include(a => a.CreatedBy).Include(a => a.ModifiedBy).AsNoTracking()
         .ProjectTo<EntireEvaluationViewModel>(_mappingEngine)
         .FirstOrDefaultAsync(a => a.Id == entireEvaluation.Id);
 }
Ejemplo n.º 3
0
 public async  Task<EntireEvaluationViewModel> Create(AddEntireEvaluationViewModel viewModel)
 {
     var EntireEvaluation = _mappingEngine.Map<EntireEvaluation>(viewModel);
     EntireEvaluation.CreatorId = _userManager.GetCurrentUserId();
     _entireEvaluations.Add(EntireEvaluation);
     await _unitOfWork.SaveChangesAsync();
     return await _entireEvaluations.Include(a => a.Evaluator)
         .Include(a => a.Creator).Include(a => a.LasModifier).AsNoTracking()
         .ProjectTo<EntireEvaluationViewModel>(_mappingEngine)
         .FirstOrDefaultAsync(a => a.Id == EntireEvaluation.Id);
 }
Ejemplo n.º 4
0
 public async  Task FillAddViewModel(AddEntireEvaluationViewModel viewModel)
 {
     viewModel.Evaluators = await _appraiserService.GetAsSelectedListItem(viewModel.EvaluatorId);
 }