Exemplo n.º 1
0
 public ActionResult GetAchivements()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<Achievement> achievements = referenceRepo.GetAchievements();
     if (achievements != null && achievements.Any<Achievement>())
     {
         var value = from a in achievements
                     orderby a.AchievementDescription
                     select new
                     {
                         Code = a.AchievementCd,
                         Name = a.AchievementDescription
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 2
0
 public ActionResult GetSubjects()
 {
     var referenceRepo = new ReferenceRepo();
     var subjects = referenceRepo.GetSubjects();
     if (subjects != null && subjects.Any())
     {
         var value = subjects.Skip(10).OrderBy(a => a.SubjectDescription).Select(a => new { Code = a.SubjectCd, Name = a.SubjectDescription });
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 3
0
 public ActionResult GetStates(string countrycode)
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<State> states = referenceRepo.GetStates(countrycode);
     if (states != null && states.Any<State>())
     {
         var value = from a in states
                     orderby a.StateDesc
                     select new
                     {
                         Code = a.StateCd.Trim(),
                         Name = a.StateDesc
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada rekod"
     });
 }
Exemplo n.º 4
0
 public ActionResult GetSkills(string category)
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<Skill> skills = referenceRepo.GetSkills(category);
     if (skills == null || !skills.Any<Skill>())
     {
         return Json(new
         {
             OK = false,
             message = "Tiada Rekod"
         });
     }
     if (category == "L")
     {
         var value = from a in skills
                     where !a.SkillDescription.Contains("Melayu") && !a.SkillDescription.Contains("Inggeris")
                     orderby a.SkillDescription
                     select new
                     {
                         Code = a.SkillCd,
                         Name = a.SkillDescription
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     var value2 = from a in skills
                  orderby a.SkillDescription
                  select new
                  {
                      Code = a.SkillCd,
                      Name = a.SkillDescription
                  };
     return Json(new
     {
         OK = true,
         message = "Rekod wujud",
         list = JsonConvert.SerializeObject(value2)
     });
 }
Exemplo n.º 5
0
 public ActionResult GetSkillCategories()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<SkillCat> skillCats = referenceRepo.GetSkillCats();
     if (skillCats != null && skillCats.Any<SkillCat>())
     {
         var value = from a in skillCats
                     orderby a.SkillCatDesc
                     select new
                     {
                         Code = a.SkillCatCd,
                         Name = a.SkillCatDesc
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 6
0
 public ActionResult GetReligions()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<Religion> religions = referenceRepo.GetReligions();
     if (religions != null && religions.Any<Religion>())
     {
         var value = from a in religions
                     orderby a.ReligionDescription
                     select new
                     {
                         Code = a.ReligionCd.Trim(),
                         Name = a.ReligionDescription
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 7
0
 public ActionResult GetEthnics(string racecode)
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<Ethnic> ethnics = referenceRepo.GetEthnics(racecode);
     if (ethnics != null && ethnics.Any<Ethnic>())
     {
         var value = from a in ethnics
                     orderby a.EthnicDescription
                     select new
                     {
                         Code = a.EthnicCd.Trim(),
                         Name = a.EthnicDescription
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 8
0
        public ActionResult Resume()
        {
            var vm = new ResumeViewModel() { ApplicantModel = new ApplicantModel() { ApplicantId = 0, NationalityCd = "MYS" } };
            var login = ObjectBuilder.GetObject<ILoginUserPersistance>("LoginUserPersistance").GetByUserName(User.Identity.Name);
            if (null != login)
            {
                vm.ApplicantModel.FullName = login.FullName;
                vm.ApplicantModel.Email = login.Email;
                vm.ApplicantModel.NewIcNo = login.LoginId;
                if (login.ApplicantId.HasValue && login.ApplicantId.Value != 0)
                {
                    var applicant = ObjectBuilder.GetObject<IApplicantPersistence>("ApplicantPersistence").GetApplicant(login.ApplicantId.Value);
                    if (null != applicant)
                    {
                        vm.ApplicantModel = new ApplicantModel(applicant, 0);
                    }
                }

                // get all high education level
                var refrepos = new ReferenceRepo();
                var he = refrepos.GetHighEduLevels();
                if (he.Any())
                {
                    he = he.OrderBy(a => a.IndexNo);
                    foreach (var h in he)
                    {
                        var edu = new ApplicantEducation() { HighEduLevelCd = h.HighEduLevelCd, HighEduLevel = h.HighestEduLevel };
                        if (h.HighEduLevelCd == "14")
                        {
                            var subjects = refrepos.GetSubjects(h.HighEduLevelCd);
                            if (subjects.Any())
                                foreach (var s in subjects)
                                    edu.ApplicantEduSubjectCollection.Add(new ApplicantEduSubject() { SubjectCd = s.SubjectCd, Subject = s.SubjectDescription });
                        }
                        vm.ApplicantModel.ApplicantEducations.Add(edu);
                    }
                }
            }
            var repos = new ReferenceRepo();
            vm.MaritalStatuses.AddRange(repos.GetMaritalStatus());
            return View(vm);
        }
Exemplo n.º 9
0
 public ActionResult GetMaritalStatus(string servicecodes)
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<MaritalStatus> maritalStatus = referenceRepo.GetMaritalStatus();
     if (maritalStatus != null && maritalStatus.Any<MaritalStatus>())
     {
         List<MaritalStatus> source = maritalStatus.ToList<MaritalStatus>();
         List<MaritalStatus> arg_84_0;
         if (!(servicecodes == "10"))
         {
             arg_84_0 = (from a in source
                         where a.MrtlStatusCd != "4" && a.MrtlStatusCd != "5"
                         select a).ToList<MaritalStatus>();
         }
         else
         {
             arg_84_0 = (from a in source
                         where a.MrtlStatusCd != "5"
                         select a).ToList<MaritalStatus>();
         }
         source = arg_84_0;
         var value = from a in source
                     orderby a.MrtlStatusCd
                     select new
                     {
                         Code = a.MrtlStatusCd,
                         Name = a.MrtlStatus
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 10
0
 public ActionResult GetMajorMinor()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<MajorMinor> majorMinors = referenceRepo.GetMajorMinors();
     if (majorMinors != null && majorMinors.Any<MajorMinor>())
     {
         var value = from a in majorMinors
                     orderby a.MajorMinorDesc
                     select new
                     {
                         Code = (!string.IsNullOrWhiteSpace(a.MajorMinorCd)) ? a.MajorMinorCd.Trim() : a.MajorMinorCd,
                         Name = a.MajorMinorDesc
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 11
0
 public ActionResult GetLocations(string zone)
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<AcquisitionLocation> acquisitionLocations = referenceRepo.GetAcquisitionLocations(zone);
     if (acquisitionLocations != null && acquisitionLocations.Any<AcquisitionLocation>())
     {
         var value = from a in acquisitionLocations
                     orderby a.Location.LocationNm
                     select new
                     {
                         Code = a.AcqLocationId,
                         Name = a.Location.LocationNm
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 12
0
 public ActionResult GetInstitutions(string category)
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<Institution> institutions = referenceRepo.GetInstitutions();
     if (institutions != null && institutions.Any<Institution>())
     {
         var value = from a in institutions
                     orderby a.InstNm
                     select new
                     {
                         Code = a.InstCd.Trim(),
                         Name = a.InstNm
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 13
0
 public ActionResult GetHighEducationLevel()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<HighEduLevel> highEduLevels = referenceRepo.GetHighEduLevels();
     if (highEduLevels != null && highEduLevels.Any<HighEduLevel>())
     {
         var value = from a in highEduLevels
                     orderby a.HighestEduLevel
                     select new
                     {
                         Code = a.HighEduLevelCd.Trim(),
                         Name = a.HighestEduLevel
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 14
0
 public ActionResult GetGrades()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<SubjectGrade> subjectGrades = referenceRepo.GetSubjectGrades();
     if (subjectGrades != null && subjectGrades.Any<SubjectGrade>())
     {
         var value = from a in subjectGrades
                     orderby a.Ranking
                     select new
                     {
                         Code = (!string.IsNullOrWhiteSpace(a.GradeCd)) ? a.GradeCd.Trim() : a.GradeCd,
                         Name = a.GradeDescription
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 15
0
 public ActionResult GetZones()
 {
     var referenceRepo = new ReferenceRepo();
     var zones = referenceRepo.GetZones();
     if (zones != null && zones.Any<Zone>())
     {
         var value = zones.OrderBy(a => a.ZoneNm).Select(a => new { Code = a.ZoneCd, Name = a.ZoneNm });
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 16
0
 public ActionResult GetAssociations()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<SportAndAssociation> sportAndAssociations = referenceRepo.GetSportAndAssociations("A");
     if (sportAndAssociations != null && sportAndAssociations.Any<SportAndAssociation>())
     {
         var value = from a in sportAndAssociations
                     orderby a.SportAssociatName
                     select new
                     {
                         Id = a.SportAssocId,
                         Name = a.SportAssociatName
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 17
0
 public ActionResult GetOccupations()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<Occupation> occupations = referenceRepo.GetOccupations();
     if (occupations != null && occupations.Any<Occupation>())
     {
         var value = from a in occupations
                     select new
                     {
                         Code = a.OccupationCd.Trim(),
                         Name = a.OccupationName
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada Rekod"
     });
 }
Exemplo n.º 18
0
        public ActionResult TUDMForm(int id)
        {
            var vm = new ResumeViewModel() { ApplicantModel = new ApplicantModel() { ApplicantId = 0, NationalityCd = "MYS", GenderCd = "L" }, AcquisitionId = id };
            var zones = ObjectBuilder.GetObject<IReferencePersistence>("ReferencePersistence").GetZones();
            if (null != zones && zones.Any())
                vm.Zones.AddRange(zones);
            var login = ObjectBuilder.GetObject<ILoginUserPersistance>("LoginUserPersistance").GetByUserName(User.Identity.Name);
            if (null != login && id != 0)
            {
                if (login.ApplicantId.HasValue && login.ApplicantId.Value != 0)
                {
                    var applicant = ObjectBuilder.GetObject<IApplicantPersistence>("ApplicantPersistence").GetApplicant(login.ApplicantId.Value);
                    if (null != applicant)
                    {
                        vm.ApplicantModel = new ApplicantModel(applicant, id);
                    }
                }
                else
                {
                    vm.ApplicantModel = new ApplicantModel(new Applicant() { NewICNo = login.LoginId, Email = login.Email, FullName = login.FullName, ColorBlindInd = true }, id);
                }
                vm.ApplicantModel.FullName = login.FullName;
                vm.ApplicantModel.Email = login.Email;
                vm.ApplicantModel.NewIcNo = login.LoginId;

                var acq = ObjectBuilder.GetObject<IAcquisitionPersistence>("AcquisitionPersistence").GetAcquisition(id);
                if (null != acq)
                {

                    if (null != acq.AcquisitionType)
                    {
                        vm.ServiceCode = acq.AcquisitionType.ServiceCd;
                        vm.AcquisitionName = acq.AcquisitionType.AcquisitionTypeNm;
                    }
                    vm.AcquisitionSiri = acq.Siri.Value;
                    vm.AcquisitionYear = acq.Year.Value;
                    vm.Acquisition = acq;
                }
            }
            var repos = new ReferenceRepo();
            vm.MaritalStatuses.AddRange(repos.GetMaritalStatus());
            return View(vm);
        }
Exemplo n.º 19
0
 public ActionResult GetCountries()
 {
     ReferenceRepo referenceRepo = new ReferenceRepo();
     IEnumerable<Country> countries = referenceRepo.GetCountries();
     if (countries != null && countries.Any<Country>())
     {
         var value = from a in countries
                     orderby a.CountryName
                     select new
                     {
                         Code = a.CountryCd.Trim(),
                         Name = a.CountryName
                     };
         return Json(new
         {
             OK = true,
             message = "Rekod wujud",
             list = JsonConvert.SerializeObject(value)
         });
     }
     return Json(new
     {
         OK = false,
         message = "Tiada rekod"
     });
 }