コード例 #1
0
 public OutputBase CreateOrEditDependant(DependantDto dependant)
 {
     _dependantRepository.InsertOrUpdate(Mapper.Map <Dependant>(dependant));
     return(new OutputBase {
         Message = "Dependant added", Success = true
     });
 }
コード例 #2
0
        public async Task <PartialViewResult> CreateOrEditDependantModal(int?id, int employeeId)
        {
            var output = new DependantDto {
                DateOfBirth = Clock.Now
            };

            if (id != null)
            {
                output =
                    _employeeService.GetDependant(new GetDependantInput {
                    DependantId = id.Value
                });
            }
            var viewModel = new CreateOrEditDependantModel(output, id == null || id == 0);

            ViewBag.EmployeeId = employeeId;

            return(PartialView("EmployeeDetail/Dependants/_CreateOrEditDependantModal", viewModel));
        }
コード例 #3
0
 public CreateOrEditDependantModel(DependantDto input, bool isNew)
 {
     IsEditMode = !isNew;
     Dependant  = input;
 }