public JsonResult ReadyRegistration(HRSupervisory sup)
        {
            Employee emp = new Employee();

            sup.DepartmentId = Lists4CV.Department.Where(x => x.Name == "Administration").Select(x => x.Id).First();
            string msg = emp.RegisterStudent(sup, sup.From);

            return(Json(msg, JsonRequestBehavior.AllowGet));
        }
        public JsonResult ConfirmAStudentTransfer(HRSupervisory sup)
        {
            var s = WhoIsWhereLists.HRSupervisor.Where(x => x.Id == sup.Id && x.To.Year == 1905).First();

            sup.StatusId     = s.StatusId;
            sup.DepartmentId = s.DepartmentId;
            sup.From         = DateTime.Now.Date;
            sup.To           = Convert.ToDateTime("1/1/1905");
            Employee e   = new Employee();
            string   msg = e.TransferAStudent(sup);

            return(Json(msg, JsonRequestBehavior.AllowGet));
        }
        public JsonResult ReadyRegistrationNo(RegistrationNo registtration)
        {
            var           latestposition = Employee.SupervisingHistory(registtration.Id).Where(x => x.To.Year == 1905).First();
            HRSupervisory sup            = new HRSupervisory();

            sup.Id           = registtration.Id;
            sup.PartnerId    = latestposition.PartnerId;
            sup.ManagerId    = latestposition.ManagerId;
            sup.From         = latestposition.From;
            sup.DepartmentId = Lists4CV.Department.Where(x => x.Name == "Administration").Select(x => x.Id).First();

            Employee emp = new Employee();
            string   msg = emp.UpdateRegistrationNo(sup, registtration.RegNo, registtration.PeriodOfCourse);

            return(Json(msg, JsonRequestBehavior.AllowGet));
        }
        public JsonResult Promote(HRSupervisory sup)
        {
            string msg = Employee.Promote(sup);

            return(Json(msg, JsonRequestBehavior.AllowGet));
        }