public ActionResult CreateEditSkills(EmployeeSkillViewBO employeeSkillViewBO) { string error; SetSkillsViewBag(); //if (ModelState.IsValid) //When the ModelState is true //{ if (bl.SaveSkills(employeeSkillViewBO, out error)) { return(Json(new { success = true, errorMsg = error })); //Successfully saves the skill } else { return(Json(new { success = false, errorMsg = error })); //Failed to save the skill //ModelState.AddModelError(string.Empty, error); } //} //return RedirectToAction("SkillsIndex", employeeSkillViewBO); //Returns "SkillsIndex" view }
public ActionResult SkillsIndex(int id) { string error; ViewBag.CurrentTab = "Skill"; //Sets the "Skills" tab as active SetSkillsViewBag(); EmployeeViewBO employeeBO = bl.EditEmployee(id, out error); //Gets the EmployeeID for update the Skills var employeeSkillViewBO = new EmployeeSkillViewBO(); employeeSkillViewBO.EmployeeID = employeeBO.EmployeeID; //Gets EmployeeID employeeSkillViewBO.ResourceSubMenuBO = new ResourceSubMenuBO(); //Sets the values for "ResourceSubMenuBO" models employeeSkillViewBO.ResourceSubMenuBO.FName = employeeBO.FirstName; employeeSkillViewBO.ResourceSubMenuBO.LName = employeeBO.LastName; employeeSkillViewBO.ResourceSubMenuBO.EmployeeID = employeeBO.EmployeeID; employeeSkillViewBO.SkillCategoryList = bl.GetSkillCategoryList(id); //Gets the list of Skills for a particular Employee return(View(employeeSkillViewBO)); }