public IActionResult Create([Bind("Id,Name,Email,Phone,Address")] Trainee trainee)
        {
            if (ModelState.IsValid)
            {
                _iTraineeManager.Add(trainee);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(trainee));
        }
Exemplo n.º 2
0
        public IActionResult Create(Trainee trainee)
        {
            if (ModelState.IsValid)
            {
                trainee.CreatedAt = DateTime.Now;
                trainee.UpdatedAt = DateTime.Now;
                _iTraineeManager.Add(trainee);
                return(RedirectToAction(nameof(Index)));
            }

            return(View(trainee));
        }
        public IActionResult Trainee(TraineeCreateVm model)
        {
            if (ModelState.IsValid)
            {
                var trainee = _mapper.Map <Trainee>(model);

                bool Issucces = _traineeManager.Add(trainee);
                if (Issucces)
                {
                }
                //model.TraineeList = _traineeManager.GetAll();
            }
            model.TraineeList          = _traineeManager.GetAll();
            model.DepartmentLookUpData = _utilityManager.GetDepartmentLookUpData();

            return(View(model));
        }