public IActionResult Create(string returnUrl)
        {
            if (String.IsNullOrEmpty(returnUrl))
            {
                returnUrl = Request.Headers["Referer"].ToString();
            }

            return(View("Edit", EmployeeDepartmentViewModelFactory.Create(new EmployeeDepartmentDto(), returnUrl)));
        }
        public async Task <IActionResult> Create([FromForm] EmployeeDepartmentViewModel employeeDepartmentVM)
        {
            if (ModelState.IsValid)
            {
                var newEmployeeDepartment = await _employeeDeparment.AddEmployeeDepartment(employeeDepartmentVM.EmployeeDepartment);

                TempData["message"]     = "Your data has been submitted successfully.";
                TempData["toasterType"] = ToasterType.success;

                //return RedirectToAction(nameof(Index));

                return(RedirectToAction(nameof(Edit), new { id = newEmployeeDepartment.Id, returnUrl = employeeDepartmentVM.ReturnUrl }));
            }

            TempData["message"]     = "A problem has been ocurred while submitting your data.";
            TempData["toasterType"] = ToasterType.info;

            return(View("Edit", EmployeeDepartmentViewModelFactory.Create(employeeDepartmentVM.EmployeeDepartment, employeeDepartmentVM.ReturnUrl)));
        }