public OutputBase CreateOrEditImmigration(ImmigrationDto immigration)
 {
     _immigrationRepository.InsertOrUpdate(Mapper.Map <Immigration>(immigration));
     return(new OutputBase {
         Message = "Record Saved", Success = true
     });
 }
        public async Task <PartialViewResult> CreateOrEditImmigrationModal(int?id, int employeeId)
        {
            var output = new ImmigrationDto();

            if (id != null)
            {
                output =
                    _employeeService.GetImmigration(new GetImmigrationInput {
                    ImmigrationId = id.Value
                });
            }
            var viewModel = new CreateOrEditImmigrationModel(output, id == null || id == 0);

            ViewBag.EmployeeId = employeeId;

            return(PartialView("EmployeeDetail/Immigration/_CreateOrEditImmigrationModal", viewModel));
        }
 public CreateOrEditImmigrationModel(ImmigrationDto input, bool isNew)
 {
     IsEditMode  = !isNew;
     Immigration = input;
 }