//[Authorize(Roles = "Employee")] public ActionResult SkillDetails(string ProfileName, string SkillName, string result, bool status = false, string useraction = "Add", long ProfileId = 0, short YearofExperience = 0) { ViewBag.SkillName = SkillName; ViewBag.Action = useraction; ViewBag.Result = "Failed"; if (status == true) { ViewBag.Result = "Succeeded"; } if (result == "Deleted") { ViewBag.Data = "Deleted"; } string UserId = User.Identity.GetUserId(); var userdetails = generic.GetUserDetail(UserId); ViewData["UserProfile"] = userdetails; ViewData["EmpDetails"] = ems.GetEmployeeBasicDetails(UserId).FirstOrDefault(); ViewData["CompanyLogo"] = cms.GetCompanyLogo(userdetails.SubscriberId).FirstOrDefault(); if (ProfileId == 0 && !string.IsNullOrEmpty(ProfileName)) { ProfileId = (from p in udb.UserProfileTypeDetails.Where(p => p.UserId == UserId && p.ProfileName == ProfileName) select p).FirstOrDefault().ProfileId; } PopulateProfileType(UserId, ProfileId); ViewBag.ProfileTypeId = ProfileId; ViewData["Profile"] = ems.GetProfileTypeDetails(UserId); ViewBag.UserName = ems.GetUserName(UserId); var EmpSkilldetails = ems.GetEmployeeSkillDetails(UserId); ViewData["EmpSkills"] = EmpSkilldetails; var employeeSkill = EmpSkilldetails.Where(s => s.ProfileId == ProfileId && s.SkillName == SkillName).FirstOrDefault(); if (employeeSkill != null) { PopulateYearOfExp(employeeSkill.YearofExperience); } else { PopulateYearOfExp(); } return(View(employeeSkill)); }
public string GetUserName(string UserId, string Role) { CMSManager cms = new CMSManager(); EMSManager ems = new EMSManager(); Student candidate = new Student(); if (Role.Equals("Admin") || Role.Equals("Client") || Role.Equals("Administrator")) { return(cms.GetUserName(UserId)); } else if (Role.Equals("Employee")) { return(ems.GetUserName(UserId)); } else if (Role.Equals("Candidate")) { return(candidate.GetUserName(UserId)); } return(string.Empty); }