public ActionResult ProfessionalDetails() { if (Session["UserId"] != null) { int UserId = Convert.ToInt32(Session["UserId"].ToString()); ProfessionalDetail Profdetails = Professionaldetailsservice.Get(UserId); List <Graduation> _GraduationYears = new List <Graduation>(); DateTime CurrentDate = DateTime.Now; int Year = CurrentDate.Year; for (int i = 1970; i <= Year; i++) { _GraduationYears.Add(new Graduation { GraduationYear = "" + i, GraduationYearId = i }); } ProfessionalDetails details = new ProfessionalDetails() { Company = Profdetails.Company, Designation = Profdetails.Designation, WorkedFrom = Profdetails.WorkedFrom, WorkedTill = Profdetails.WorkedTill, GraduationYears = _GraduationYears }; return(View(details)); } return(RedirectToAction("Login", "Account")); }
public IActionResult Details([Bind(Prefix = "id")] int Id) { var professional = _repo.ReadProfessional(Id); if (professional != null) { var model = new ProfessionalDetails { Id = professional.Id, Name = professional.Name, Category = professional.Category }; return(View(model)); } return(RedirectToAction("Details", "Professional")); }
public ActionResult ProfessionalDetails(ProfessionalDetails Profdetails) { if (ModelState.IsValid) { if (Session["UserId"] != null) { UserDetail userdetails = new UserDetail() { Id = Convert.ToInt32(Session["UserId"].ToString()), ProfileInfoPercentage = (int)CustomStatus.ProfileInfoPercentage.Complete }; ProfessionalDetail Profdetail = new ProfessionalDetail() { UserId = Convert.ToInt32(Session["UserId"].ToString()), Status = true, Company = Profdetails.Company, Designation = Profdetails.Designation, WorkedFrom = Profdetails.WorkedFrom, WorkedTill = Profdetails.WorkedTill }; UserService.UpdateUser(userdetails); Professionaldetailsservice.Create(Profdetail); Session.Clear(); TempData["Success"] = "your registration process is sucessfully completed.."; return(RedirectToAction("Login")); } else { return(RedirectToAction("Login")); } } var Date = DateTime.Now.Year; List <Graduation> _GraduationYears = new List <Graduation>(); for (int i = 1970; i <= Date; i++) { _GraduationYears.Add(new Graduation { GraduationYear = "" + i, GraduationYearId = i }); } ProfessionalDetails details = new ProfessionalDetails() { GraduationYears = _GraduationYears }; return(View(details)); }
public ActionResult ProfessionalDetails() { DateTime CurrentDate = DateTime.Now; int Year = CurrentDate.Year; List <Graduation> _GraduationYears = new List <Graduation>(); for (int i = 1970; i <= Year; i++) { _GraduationYears.Add(new Graduation { GraduationYear = "" + i, GraduationYearId = i }); } ProfessionalDetails details = new ProfessionalDetails() { GraduationYears = _GraduationYears }; return(View(details)); }
public ActionResult ProfessionalDetails(ProfessionalDetails Profdetails) { if (Session["UserId"] != null) { int UserId = Convert.ToInt32(Session["UserId"].ToString()); if (ModelState.IsValid) { ProfessionalDetail Profdetail = new ProfessionalDetail() { Company = Profdetails.Company, Designation = Profdetails.Designation, WorkedFrom = Profdetails.WorkedFrom, WorkedTill = Profdetails.WorkedTill }; ProfessionalDetailsservice.UpdateUserProfDetails(UserId, Profdetail); TempData["Success"] = UtilitiesClass.SuccessMessage; return(RedirectToAction("Profile", "Profile", new { area = "Alumini" })); } ProfessionalDetail ProfDet = ProfessionalDetailsservice.Get(UserId); List <Graduation> _GraduationYears = new List <Graduation>(); for (int i = 1970; i <= 2015; i++) { _GraduationYears.Add(new Graduation { GraduationYear = "" + i, GraduationYearId = i }); } ProfessionalDetails details = new ProfessionalDetails() { Company = Profdetails.Company, Designation = ProfDet.Designation, WorkedFrom = ProfDet.WorkedFrom, WorkedTill = ProfDet.WorkedTill, GraduationYears = _GraduationYears }; return(View(details)); } else { return(RedirectToAction("Login", "Account", new { area = "" })); } }
public void DisplayEmployees() { List <PersonalDetail> employeeList = new List <PersonalDetail>(); AuditDetails firstEmpAuditDetails = new AuditDetails("pVerma", DateTime.Today.Date.TimeOfDay); AuditDetails secondEmpAuditDetails = new AuditDetails("mSingh", DateTime.Today.Date.TimeOfDay); AuditDetails thirdEmpAuditDetails = new AuditDetails("wLou", DateTime.Today.Date.TimeOfDay); ProfessionalDetails firstEmpProfessionalDetails = new ProfessionalDetails(true, "IT"); ProfessionalDetails secondEmpProfessionalDetails = new ProfessionalDetails(true, "Sales"); ProfessionalDetails thirdEmpProfessionalDetails = new ProfessionalDetails(true, "Operations"); ProfessionalDetails fourthEmpProfessionalDetails = new ProfessionalDetails(true, "Sales"); PersonalDetail firstEmployee = new PersonalDetail(1, "Pallavi", "Verma", "BR6 7AE", "London", EmploymentType.FullTime, firstEmpAuditDetails, firstEmpProfessionalDetails); PersonalDetail secondEmployee = new PersonalDetail(2, "Mridul", "Singh", "BR6 7AE", "Bromley", EmploymentType.FullTime, secondEmpAuditDetails, secondEmpProfessionalDetails); PersonalDetail thirdEmployee = new PersonalDetail(3, "Lou", "Wiseman", "BR6 7DE", "Orpington", EmploymentType.FullTime, thirdEmpAuditDetails, thirdEmpProfessionalDetails); PersonalDetail fourthEmployee = new PersonalDetail(2, "Vedant", "Raj", "BR6 7AE", "Bromley", EmploymentType.FullTime, secondEmpAuditDetails, secondEmpProfessionalDetails); employeeList.Add(firstEmployee); employeeList.Add(secondEmployee); employeeList.Add(thirdEmployee); employeeList.Add(fourthEmployee); /* 1.Display all employee attributes provided in requirement section * Employee Name, Address, Employment Type, Manager, Department, UserID and LoginTime */ foreach (PersonalDetail p in employeeList) { string isManager = String.Empty; if (p.ProfessionalDetails.Manager) { isManager = "Yes"; } else { isManager = "No"; } Console.WriteLine($@"Employee Name :{p.FirstName} {p.LastName}"); Console.WriteLine($@"Address :{p.ZipCode} {p.City}"); Console.WriteLine($@"Employment Type :{p.EmploymentType}"); Console.WriteLine($@"Manager :{isManager}"); Console.WriteLine($@"Department :{p.ProfessionalDetails.Department}"); Console.WriteLine($@"UserID :{p.AuditDetails.UserID}"); Console.WriteLine($@"LoginTime :{p.AuditDetails.LoginTime.ToString()}"); Console.ReadLine(); } //2. Display all departments and their employees foreach (var d in employeeList) { Console.WriteLine($@"Department Name: {d.ProfessionalDetails.Department}, Employee Name :{d.FirstName} {d.LastName}"); Console.ReadLine(); } //3.Display department with maximum number of employees var dept = (from department in employeeList group department by new { department.ProfessionalDetails.Department } into deptGroup select new { DepartmentName = deptGroup.Key.Department, Count = deptGroup.Count(), }).ToList(); foreach (var d in dept) { Console.WriteLine($@"Department Name : {d.DepartmentName}, Employee Count : {d.Count.ToString()}"); Console.ReadLine(); } }
public ActionResult ProfessionalDetails(ProfessionalDetails Profdetails) { if (Session["UserId"] != null) { int UserId = Convert.ToInt32(Session["UserId"].ToString()); if (ModelState.IsValid) { ProfessionalDetail Profdetail = new ProfessionalDetail() { Company = Profdetails.Company, Designation = Profdetails.Designation, WorkedFrom = Profdetails.WorkedFrom, WorkedTill = Profdetails.WorkedTill }; ProfessionalDetailsservice.UpdateUserProfDetails(UserId, Profdetail); TempData["Success"] = UtilitiesClass.SuccessMessage; return RedirectToAction("Profile", "Profile", new { area = "Alumini" }); } ProfessionalDetail ProfDet = ProfessionalDetailsservice.Get(UserId); List<Graduation> _GraduationYears = new List<Graduation>(); for (int i = 1970; i <= 2015; i++) _GraduationYears.Add(new Graduation { GraduationYear = "" + i, GraduationYearId = i }); ProfessionalDetails details = new ProfessionalDetails() { Company = Profdetails.Company, Designation = ProfDet.Designation, WorkedFrom = ProfDet.WorkedFrom, WorkedTill = ProfDet.WorkedTill, GraduationYears = _GraduationYears }; return View(details); } else { return RedirectToAction("Login", "Account", new { area = "" }); } }
public ActionResult ProfessionalDetails() { try { if (Session["UserId"] != null) { int UserId = Convert.ToInt32(Session["UserId"].ToString()); ProfessionalDetail Profdetails = ProfessionalDetailsservice.Get(UserId); List<Graduation> _GraduationYears = new List<Graduation>(); DateTime CurrentDate = DateTime.Now; int Year = CurrentDate.Year; for (int i = 1970; i <= Year; i++) _GraduationYears.Add(new Graduation { GraduationYear = "" + i, GraduationYearId = i }); if (Profdetails != null) { ProfessionalDetails details = new ProfessionalDetails() { Company = Profdetails.Company, Designation = Profdetails.Designation, WorkedFrom = Profdetails.WorkedFrom, WorkedTill = Profdetails.WorkedTill, GraduationYears = _GraduationYears }; return View(details); } else { ProfessionalDetails details = new ProfessionalDetails() { Company = null, Designation = null, WorkedFrom = null, WorkedTill = null, GraduationYears = _GraduationYears }; return View(details); } } else { return RedirectToAction("Login", "Account", new { area = "" }); } } catch (SystemException ex) { } return View(); }