//[Authorize(Roles = "Employee")] public ActionResult Certifications(string UserAction, Int64 CertificationId = 0, bool Data = false) { string UserId = User.Identity.GetUserId(); ViewData["UserProfile"] = generic.GetUserDetail(UserId); ViewData["EmpDetails"] = ems.GetEmployeeBasicDetails(UserId).FirstOrDefault(); var UserDetails = generic.GetUserDetail(UserId); ViewData["CompanyLogo"] = cms.GetCompanyLogo(UserDetails.SubscriberId).FirstOrDefault(); if (Data == true) { ViewBag.Data = "Succeed"; } if (UserAction == "Delete" && CertificationId > 0) { ems.DeleteCertificate(CertificationId); PopulateYear(); ViewBag.Result = "Deleted"; return(View()); } PopulateYear(); var Certificates = db.Certification.Where(c => c.UserId == UserId).ToList(); ViewData["Cretifications"] = Certificates; var SelectedCertificate = Certificates.Where(c => c.CertificationId == CertificationId).FirstOrDefault(); if (SelectedCertificate != null) { PopulateYear(SelectedCertificate.YearOfPassing); } return(View(SelectedCertificate)); }