public string UpdateAppointmentDate(List <UpdateApplicantInterestingsDTO> updatedata)
        {
            try
            {
                foreach (var data in updatedata)
                {
                    ApplicantProfile applicantProfile = new ApplicantProfile();
                    applicantProfile = Context.ApplicantProfile.Where(x => x.Empid == data.Empid).FirstOrDefault();
                    applicantProfile.StatusApplicant = data.StatusApplicant;
                    applicantProfile.UpdDate         = DateTime.Now;
                    Context.ApplicantProfile.Update(applicantProfile);
                    Context.SaveChanges();


                    ApplicantAppointmentDate applicantAppointmentDate = new ApplicantAppointmentDate();
                    applicantAppointmentDate = Context.ApplicantAppointmentDate.Where(x => x.Empid == data.Empid).FirstOrDefault();
                    if (data.StatusApplicant == "Contact_Nint" || data.StatusApplicant == "Contact_Cnot")
                    {
                        applicantAppointmentDate.AppointmentDate = null;
                    }
                    else if (data.StatusApplicant == "Contact_Inte")
                    {
                        applicantAppointmentDate.AppointmentDate = data.AppointmentDate;
                    }
                    Context.ApplicantAppointmentDate.Update(applicantAppointmentDate);
                    Context.SaveChanges();
                }
                return("Success");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public ActionResult AddProfile(ApplicantProfile profile)
 {
     profile.UserId = User.Identity.GetUserId();
     naaService.AddProfile(profile);
     //return RedirectToAction("Login", new { Controller = "Account" });
     return(RedirectToAction("ApplicantHome", new { Controller = "Home" }));
 }
        public ApplicantAssessmentDTO GetDataAssessmentByID(int empID)
        {
            ApplicantAssessmentDTO listData = new ApplicantAssessmentDTO();

            ApplicantProfile   applicantProfile   = new ApplicantProfile();
            ApplicantAssetment applicantAssetment = new ApplicantAssetment();

            applicantAssetment = Context.ApplicantAssetment.Where(x => x.Empid == empID).FirstOrDefault();
            applicantProfile   = Context.ApplicantProfile.Where(x => x.Empid == empID).FirstOrDefault();

            listData.FirstnameTh = applicantProfile.FirstnameTh != null ? applicantProfile.FirstnameTh : String.Empty;
            listData.LastnameTh  = applicantProfile.LastnameTh != null ? applicantProfile.LastnameTh : String.Empty;
            listData.Position    = applicantProfile.Position != null ? applicantProfile.Position : String.Empty;
            listData.Per_01      = applicantAssetment.Per01 != null ? applicantAssetment.Per01 : String.Empty;
            listData.Per_02      = applicantAssetment.Per02 != null ? applicantAssetment.Per02 : String.Empty;
            listData.Per_03      = applicantAssetment.Per03 != null ? applicantAssetment.Per03 : String.Empty;
            listData.Per_04      = applicantAssetment.Per04 != null ? applicantAssetment.Per04 : String.Empty;
            listData.Edu_01      = applicantAssetment.Edu01 != null ? applicantAssetment.Edu01 : String.Empty;
            listData.Edu_02      = applicantAssetment.Edu02 != null ? applicantAssetment.Edu02 : String.Empty;
            listData.Edu_03      = applicantAssetment.Edu03 != null ? applicantAssetment.Edu03 : String.Empty;
            listData.Edu_04      = applicantAssetment.Edu04 != null ? applicantAssetment.Edu04 : String.Empty;
            listData.Oth_01      = applicantAssetment.Oth01 != null ? applicantAssetment.Oth01 : String.Empty;
            listData.Oth_02      = applicantAssetment.Oth02 != null ? applicantAssetment.Oth02 : String.Empty;
            listData.Recomment   = applicantAssetment.Recomment != null ? applicantAssetment.Recomment : String.Empty;
            listData.Summ_Ass    = applicantAssetment.SummAss != null ? applicantAssetment.SummAss : String.Empty;
            listData.CrBy        = applicantAssetment.CrBy != null ? applicantAssetment.CrBy : String.Empty;
            listData.CrDate      = applicantAssetment.CrDate;

            return(listData);
        }
        public ActionResult AddProfile()
        {
            ApplicantProfile profile = new ApplicantProfile();

            profile.Email = User.Identity.Name;
            return(View(profile));
        }
예제 #5
0
        public string AddDatatoAgreement(ApplicantAgreement data)
        {
            try
            {
                ApplicantAgreement agreement = new ApplicantAgreement();

                agreement.Empid     = data.Empid;
                agreement.Company   = data.Company;
                agreement.StartDate = data.StartDate;
                agreement.Salary    = data.Salary;
                agreement.Other     = data.Other;
                agreement.CrBy      = data.UpdBy;
                agreement.CrDate    = DateTime.Now;
                agreement.UpdBy     = data.UpdBy;
                agreement.UpdDate   = DateTime.Now;

                Context.ApplicantAgreement.Add(agreement);
                Context.SaveChanges();

                ApplicantProfile profile = new ApplicantProfile();

                profile = Context.ApplicantProfile.Where(x => x.Empid == data.Empid).FirstOrDefault();
                profile.StatusApplicant = "Agreemented";
                profile.UpdBy           = data.UpdBy;
                profile.UpdDate         = DateTime.Now;

                Context.ApplicantProfile.Update(profile);
                Context.SaveChanges();

                return("success");
            }
            catch (Exception e) { throw e; }
        }
        public ActionResult DeleteProfile(ApplicantProfile profile)
        {
            ApplicantProfile anotherProfile = naaService.GetProfile(profile.Id);

            naaService.DeleteProfile(anotherProfile);
            return(RedirectToAction("Profiles", new { Controller = "NAA" }));
            //return RedirectToAction("DebugPage", new { message = "DETAILS: "+temp, Controller = "Music" });
        }
예제 #7
0
        public int GetApplicantIdByUserId(string userId)
        {
            ApplicantProfile applicantProfile =

                (from appProf in context.ApplicantProfile
                 where appProf.UserId == userId
                 select appProf).ToList <ApplicantProfile>().First();

            return(applicantProfile.Id);
        }
 public ActionResult EditProfile(ApplicantProfile profile)
 {
     try
     {
         naaService.EditProfile(profile);
         return(RedirectToAction("Profiles", new { Controller = "NAA" }));
     }
     catch
     {
         return(View());
     }
 }
        public async Task <string> SaveApplicant(ApplicantDTO data)
        {
            try
            {
                ApplicantProfile applicant = new ApplicantProfile();

                applicant.FirstnameTh = data.ApplicantProfile.FirstnameTh;
                applicant.LastnameTh  = data.ApplicantProfile.LastnameTh;
                applicant.FirstnameEn = data.ApplicantProfile.FirstnameEn;
                applicant.LastnameEn  = data.ApplicantProfile.LastnameEn;
                applicant.Birthday    = data.ApplicantProfile.Birthday;
                applicant.Age         = data.ApplicantProfile.Age;
                applicant.IdCard      = data.ApplicantProfile.IdCard;

                applicant.Gender      = data.ApplicantProfile.Gender;
                applicant.Status      = data.ApplicantProfile.Status;
                applicant.Height      = data.ApplicantProfile.Height;
                applicant.Weight      = data.ApplicantProfile.Weight;
                applicant.Nationality = data.ApplicantProfile.Nationality;

                applicant.Tel   = data.ApplicantProfile.Tel;
                applicant.Email = data.ApplicantProfile.Email;

                applicant.Address     = data.ApplicantProfile.Address;
                applicant.Province    = data.ApplicantProfile.Province;
                applicant.District    = data.ApplicantProfile.District;
                applicant.SubDistrict = data.ApplicantProfile.SubDistrict;
                applicant.PostalCode  = data.ApplicantProfile.PostalCode.ToString();
                applicant.ImgPath     = data.ApplicantProfile.ImgPath;

                applicant.Position = data.ApplicantProfile.Position;
                applicant.Salary   = data.ApplicantProfile.Salary;

                applicant.CrBy    = data.ApplicantProfile.CrBy;
                applicant.CrDate  = data.ApplicantProfile.CrDate;
                applicant.UpdBy   = data.ApplicantProfile.UpdBy;
                applicant.UpdDate = data.ApplicantProfile.UpdDate;

                applicant.StatusApplicant = "SSSS";


                Context.ApplicantProfile.Add(applicant);
                Context.SaveChanges();


                return("Success");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public ActionResult EditPersonalProfile(ApplicantProfile profile)
 {
     profile.UserId = User.Identity.GetUserId();
     try
     {
         naaService.EditProfile(profile);
         return(RedirectToAction("ApplicantHome", new { Controller = "Home" }));
     }
     catch
     {
         return(View());
     }
 }
예제 #11
0
파일: Form1.cs 프로젝트: zenitsuga/ZHRS
        private void sourcingAndApplicationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ApplicantProfile ap = new ApplicantProfile();

            ap.MdiParent   = this;
            ap.WindowState = FormWindowState.Maximized;
            ap.Top         = 0;
            ap.Left        = 0;
            ap.Sconn       = Sconn;
            if (cf.isChildFormLoaded(ap.Name))
            {
                ap.Show();
            }
        }
예제 #12
0
파일: Form1.cs 프로젝트: zenitsuga/ZHRS
        private void button2_Click(object sender, EventArgs e)
        {
            ApplicantProfile ap = new ApplicantProfile();

            ap.MdiParent   = this;
            ap.WindowState = FormWindowState.Maximized;
            ap.Top         = 0;
            ap.Left        = 0;
            ap.Sconn       = Sconn;
            if (cf.isChildFormLoaded(ap.Name))
            {
                ap.Show();
            }
        }
예제 #13
0
        public ApplicantAssessmentDTO GetDataAssessmentPmByID(int empID)
        {
            ApplicantAssessmentDTO listData = new ApplicantAssessmentDTO();

            ApplicantProfile applicantProfile = new ApplicantProfile();

            applicantProfile = Context.ApplicantProfile.Where(x => x.Empid == empID).FirstOrDefault();

            listData.Empid       = applicantProfile.Empid;
            listData.FirstnameTh = applicantProfile.FirstnameTh;
            listData.LastnameTh  = applicantProfile.LastnameTh;
            listData.Position    = applicantProfile.Position;


            return(listData);
        }
예제 #14
0
        public void EditProfile(ApplicantProfile profile)
        {
            //Obtain existing profile to Edit
            ApplicantProfile existingProfile = (from prof
                                                in context.ApplicantProfile
                                                where prof.Id == profile.Id
                                                select prof).ToList <ApplicantProfile>().First();

            //Assign new values

            existingProfile.ApplicantName    = profile.ApplicantName;
            existingProfile.ApplicantAddress = profile.ApplicantAddress;
            existingProfile.Phone            = profile.Phone;
            existingProfile.Email            = profile.Email;
            existingProfile.UserId           = profile.UserId;
            context.SaveChanges();
        }
예제 #15
0
        public async Task <IActionResult> Create(ApplicantProfile applicantProfile)
        {
            if (ModelState.IsValid)
            {
                var config = new MapperConfiguration(cfg => cfg.CreateMap <ApplicantProfile, ApplicantProfilePoco>());
                var mapper = config.CreateMapper();
                ApplicantProfilePoco poco = mapper.Map <ApplicantProfilePoco>(applicantProfile);
                poco.Id = Guid.NewGuid();
                var login = TempData["Login"];
                poco.Login = Guid.Parse(login.ToString());
                _context.Add(poco);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Details), new { id = poco.Id }));
            }
            ViewData["Login"]   = new SelectList(_context.SecurityLogins, "Id", "EmailAddress", applicantProfile.Login);
            ViewData["Country"] = new SelectList(_context.SystemCountryCodes, "Code", "Code", applicantProfile.Country);
            return(View(applicantProfile));
        }
예제 #16
0
        public string updateStatus([FromBody] UpdateStatusDTO status)
        {
            try
            {
                ApplicantProfile applicantProfile = new ApplicantProfile();
                applicantProfile = Context.ApplicantProfile.Where(x => x.Empid == status.ID).FirstOrDefault();

                applicantProfile.StatusApplicant = status.Status;
                applicantProfile.UpdBy           = status.UpdBy;
                applicantProfile.UpdDate         = DateTime.Now;
                Context.ApplicantProfile.Update(applicantProfile);
                Context.SaveChanges();

                return("Success");
            }
            catch (Exception ex)
            {
                return("Fail");
            }
        }
예제 #17
0
        public string UpdateStatus(int id, string status, string name)
        {
            try
            {
                ApplicantProfile applicantProfile = new ApplicantProfile();
                applicantProfile                 = Context.ApplicantProfile.Where(x => x.Empid == id).FirstOrDefault();
                applicantProfile.UpdBy           = name;
                applicantProfile.UpdDate         = DateTime.Now;
                applicantProfile.StatusApplicant = status;
                Context.ApplicantProfile.Update(applicantProfile);
                Context.SaveChanges();


                return("Success");
            }
            catch (Exception ex)
            {
                return("Fail");
            }
        }
        public string UpdateStatusInteresting(int[] id, string status)
        {
            try
            {
                foreach (int empID in id)
                {
                    ApplicantProfile applicantProfile = new ApplicantProfile();
                    applicantProfile = Context.ApplicantProfile.Where(x => x.Empid == empID).FirstOrDefault();

                    applicantProfile.StatusApplicant = status;
                    applicantProfile.UpdDate         = DateTime.Now;
                    Context.ApplicantProfile.Update(applicantProfile);
                    Context.SaveChanges();
                }

                return("Success");
            }
            catch (Exception ex)
            {
                return("Fail");
            }
        }
예제 #19
0
        public void Save(ApplicantProfile applicantProfile)
        {
            if (validator.IsActiveWorkflow(applicantProfile.WorkFlowId))
            {
                var obj = context.applicantProfiles.Where(a => a.ApplicantNo.Equals(applicantProfile.ApplicantNo) &&
                                                          a.WorkFlowId == applicantProfile.WorkFlowId)
                          .FirstOrDefault();

                if (obj == null)
                {
                    context.applicantProfiles.Add(applicantProfile);
                }
                else
                {
                    obj.IsSuccess = applicantProfile.IsSuccess;
                }
                context.SaveChanges();
            }
            else
            {
                throw new InactiveWorkflowException("Inactive Workflow");
            }
        }
        public async Task <string> SaveinterviewDate(ApplicantAppointmentDateDTO data, string team)
        {
            try
            {
                DateTime dateTime = DateTime.Now;
                ApplicantAppointmentDate saveinterviewdate = new ApplicantAppointmentDate();

                saveinterviewdate.Username  = data.Username;
                saveinterviewdate.Empid     = data.Empid;
                saveinterviewdate.Datetime1 = data.Datetime1;
                saveinterviewdate.Datetime2 = data.Datetime2;
                //saveinterviewdate.AppointmentDate = data.AppointmentDate;
                //saveinterviewdate.AppointmentStatus = data.AppointmentStatus;
                saveinterviewdate.CrBy   = data.Username;
                saveinterviewdate.CrDate = DateTime.Now;

                Context.ApplicantAppointmentDate.Add(saveinterviewdate);
                Context.SaveChanges();


                ApplicantProfile applicantProfile = new ApplicantProfile();
                applicantProfile = Context.ApplicantProfile.Where(x => x.Empid == data.Empid).FirstOrDefault();

                applicantProfile.StatusApplicant = "Pass_PM";
                applicantProfile.Team            = team;
                applicantProfile.UpdDate         = dateTime;
                Context.ApplicantProfile.Update(applicantProfile);
                Context.SaveChanges();

                return("Success");
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #21
0
        public ApplicantDTO GetDataProfileByID(int empID)
        {
            ApplicantDTO listData = new ApplicantDTO();


            ApplicantProfile                applicantProfile           = new ApplicantProfile();
            ApplicantSkill                  applicantSkill             = new ApplicantSkill();
            List <ApplicantEduHistory>      applicantEduHis            = new List <ApplicantEduHistory>();
            List <ApplicantWorkingHistory>  applicantWorkingHistories  = new List <ApplicantWorkingHistory>();
            List <ApplicantTrainingHistory> applicantTrainingHistories = new List <ApplicantTrainingHistory>();
            List <ApplicantSkillLanguage>   applicantSkillLanguages    = new List <ApplicantSkillLanguage>();
            List <ApplicantRef>             applicantRefs = new List <ApplicantRef>();


            applicantProfile           = Context.ApplicantProfile.Where(x => x.Empid == empID).FirstOrDefault();
            applicantSkill             = Context.ApplicantSkill.Where(x => x.Empid == empID).FirstOrDefault();
            applicantEduHis            = Context.ApplicantEduHistory.Where(x => x.Empid == empID).ToList();
            applicantWorkingHistories  = Context.ApplicantWorkingHistory.Where(x => x.Empid == empID).ToList();
            applicantTrainingHistories = Context.ApplicantTrainingHistory.Where(x => x.Empid == empID).ToList();
            applicantSkillLanguages    = Context.ApplicantSkillLanguage.Where(x => x.Empid == empID).ToList();
            applicantRefs = Context.ApplicantRef.Where(x => x.Empid == empID).ToList();


            listData.ApplicantProfile.TitelnameTh = applicantProfile.TitlenameTh;
            listData.ApplicantProfile.FirstnameTh = string.IsNullOrEmpty(applicantProfile.FirstnameTh) ? "" : applicantProfile.FirstnameTh;
            listData.ApplicantProfile.LastnameTh  = string.IsNullOrEmpty(applicantProfile.LastnameTh) ? "" : applicantProfile.LastnameTh;
            listData.ApplicantProfile.TitelnameEn = applicantProfile.TitlenameEn;
            listData.ApplicantProfile.FirstnameEn = string.IsNullOrEmpty(applicantProfile.FirstnameEn) ? "" : applicantProfile.FirstnameEn;
            listData.ApplicantProfile.LastnameEn  = string.IsNullOrEmpty(applicantProfile.LastnameEn) ? "" : applicantProfile.LastnameEn;
            listData.ApplicantProfile.Birthday    = applicantProfile.Birthday;
            listData.ApplicantProfile.Age         = applicantProfile.Age != null ? applicantProfile.Age : 0;
            listData.ApplicantProfile.IdCard      = string.IsNullOrEmpty(applicantProfile.IdCard) ? "" : applicantProfile.IdCard;
            listData.ApplicantProfile.Status      = string.IsNullOrEmpty(applicantProfile.Status) ? "" : applicantProfile.Status;
            listData.ApplicantProfile.Height      = applicantProfile.Height != null ? applicantProfile.Height : 0;
            listData.ApplicantProfile.Weight      = applicantProfile.Weight != null ? applicantProfile.Weight : 0;
            listData.ApplicantProfile.Nationality = string.IsNullOrEmpty(applicantProfile.Nationality) ? "" : applicantProfile.Nationality;
            listData.ApplicantProfile.Religion    = string.IsNullOrEmpty(applicantProfile.Religion) ? "" : applicantProfile.Religion;

            listData.ApplicantProfile.Tel    = string.IsNullOrEmpty(applicantProfile.Tel) ? "" : applicantProfile.Tel;
            listData.ApplicantProfile.Email  = string.IsNullOrEmpty(applicantProfile.Email) ? "" : applicantProfile.Email;
            listData.ApplicantProfile.LineID = applicantProfile.Lineid;

            listData.ApplicantProfile.Address     = string.IsNullOrEmpty(applicantProfile.Address) ? "" : applicantProfile.Address;
            listData.ApplicantProfile.Province    = string.IsNullOrEmpty(applicantProfile.Province) ? "" : applicantProfile.Province;
            listData.ApplicantProfile.District    = string.IsNullOrEmpty(applicantProfile.District) ? "" : applicantProfile.District;
            listData.ApplicantProfile.SubDistrict = string.IsNullOrEmpty(applicantProfile.SubDistrict) ? "" : applicantProfile.SubDistrict;
            listData.ApplicantProfile.PostalCode  = int.Parse(applicantProfile.PostalCode);
            listData.ApplicantProfile.Stay        = applicantProfile.Stay;

            listData.ApplicantProfile.ImgPath      = string.IsNullOrEmpty(applicantProfile.ImgPath) ? "" : applicantProfile.ImgPath;
            listData.ApplicantProfile.Position     = string.IsNullOrEmpty(applicantProfile.Position) ? "" : applicantProfile.Position;
            listData.ApplicantProfile.Salary       = string.IsNullOrEmpty(applicantProfile.Salary) ? "" : applicantProfile.Salary;
            listData.ApplicantProfile.TypeEmployee = string.IsNullOrEmpty(applicantProfile.TypeEmployee) ? "" : applicantProfile.TypeEmployee;
            listData.ApplicantSkill.TypingTh       = applicantSkill.TypingTh != null ? applicantSkill.TypingTh : 0;
            listData.ApplicantSkill.TypingEn       = applicantSkill.TypingEn != null ? applicantSkill.TypingEn : 0;
            listData.ApplicantSkill.Special1       = string.IsNullOrEmpty(applicantSkill.Special1) ? "" : applicantSkill.Special1;
            listData.ApplicantSkill.Special2       = string.IsNullOrEmpty(applicantSkill.Special2) ? "" : applicantSkill.Special2;
            listData.ApplicantSkill.Special3       = string.IsNullOrEmpty(applicantSkill.Special3) ? "" : applicantSkill.Special3;
            listData.ApplicantSkill.Special4       = string.IsNullOrEmpty(applicantSkill.Special4) ? "" : applicantSkill.Special4;

            listData.ApplicantProfile.CrBy            = string.IsNullOrEmpty(applicantProfile.CrBy) ? "" : applicantProfile.CrBy;
            listData.ApplicantProfile.CrDate          = applicantProfile.CrDate;
            listData.ApplicantProfile.Gender          = string.IsNullOrEmpty(applicantProfile.Gender) ? "" : applicantProfile.Gender;
            listData.ApplicantProfile.StatusApplicant = string.IsNullOrEmpty(applicantProfile.StatusApplicant) ? "" : applicantProfile.StatusApplicant;
            listData.ApplicantProfile.FirstnameTh     = string.IsNullOrEmpty(applicantProfile.FirstnameTh) ? "" : applicantProfile.FirstnameTh;
            listData.ApplicantProfile.UpdBy           = string.IsNullOrEmpty(applicantProfile.UpdBy) ? "" : applicantProfile.UpdBy;
            listData.ApplicantProfile.UpdDate         = applicantProfile.UpdDate;

            foreach (ApplicantEduHistory eduHistory in applicantEduHis)
            {
                if (eduHistory != null)
                {
                    ApplicantEduHistoryDTO eduHistoryDTO = new ApplicantEduHistoryDTO();
                    eduHistoryDTO.Education  = eduHistory.Education;
                    eduHistoryDTO.SchoolName = eduHistory.SchoolName;
                    eduHistoryDTO.Faculty    = eduHistory.Faculty;
                    eduHistoryDTO.Major      = eduHistory.Major;
                    eduHistoryDTO.GradYear   = DateTime.Parse("01/01/" + eduHistory.GradYear);
                    eduHistoryDTO.Gpa        = eduHistory.Gpa;
                    listData.ApplicantEduHistories.Add(eduHistoryDTO);
                }
                else
                {
                    listData.ApplicantEduHistories = null;
                }
            }

            foreach (ApplicantWorkingHistory workingHistory in applicantWorkingHistories)
            {
                if (workingHistory != null)
                {
                    ApplicantWorkingHistoryDTO workingHistoryDTO = new ApplicantWorkingHistoryDTO();
                    workingHistoryDTO.StartDate      = workingHistory.StartDate;
                    workingHistoryDTO.EndDate        = workingHistory.EndDate;
                    workingHistoryDTO.CompanyName    = workingHistory.CompanyName;
                    workingHistoryDTO.CompanyAddress = workingHistory.CompanyAddress;
                    workingHistoryDTO.Position       = workingHistory.Position;
                    workingHistoryDTO.Salary         = workingHistory.Salary;
                    listData.ApplicantWorkingHistories.Add(workingHistoryDTO);
                }
                else
                {
                    listData.ApplicantWorkingHistories = null;
                }
            }

            foreach (ApplicantTrainingHistory trainingHistory in applicantTrainingHistories)
            {
                if (trainingHistory != null)
                {
                    ApplicantTrainingHistoryDTO trainingHistoryDTO = new ApplicantTrainingHistoryDTO();
                    trainingHistoryDTO.StartDate    = trainingHistory.StartDate;
                    trainingHistoryDTO.EndDate      = trainingHistory.EndDate;
                    trainingHistoryDTO.TrainingName = trainingHistory.TrainingName;
                    trainingHistoryDTO.CourseName   = trainingHistory.CourseName;
                    trainingHistoryDTO.Certificate  = trainingHistory.Certificate;
                    listData.ApplicantTrainingHistories.Add(trainingHistoryDTO);
                }
                else
                {
                    listData.ApplicantTrainingHistories = null;
                }
            }

            foreach (ApplicantSkillLanguage skillLanguage in applicantSkillLanguages)
            {
                if (skillLanguage != null)
                {
                    ApplicantSkillLanguageDTO skillLanguageDTO = new ApplicantSkillLanguageDTO();
                    skillLanguageDTO.Language      = skillLanguage.Language;
                    skillLanguageDTO.LanguageSpeak = skillLanguage.LanguageSpeak;
                    skillLanguageDTO.LanguageRead  = skillLanguage.LanguageRead;
                    skillLanguageDTO.LanguageWrite = skillLanguage.LanguageWrite;
                    listData.ApplicantSkillLanguages.Add(skillLanguageDTO);
                }
                else
                {
                    listData.ApplicantTrainingHistories = null;
                }
            }

            foreach (ApplicantRef Ref in applicantRefs)
            {
                if (Ref != null)
                {
                    ApplicantRefDTO RefDTO = new ApplicantRefDTO();
                    RefDTO.RefName     = Ref.RefName;
                    RefDTO.RefPosition = Ref.RefPosition;
                    RefDTO.RefTel      = Ref.RefTel;

                    listData.ApplicantRef.Add(RefDTO);
                }
                else
                {
                    listData.ApplicantRef = null;
                }
            }

            return(listData);
        }
예제 #22
0
        public async Task <string> SaveApplicant(ApplicantDTO data)
        {
            using (var dbContextTransaction = Context.Database.BeginTransaction())
            {
                try
                {
                    int      empID    = Context.ApplicantProfile.Max(i => i.Empid) + 1; // EMDID
                    DateTime dateTime = DateTime.Now;

                    #region // ########## Table APPLICANT_PROFILE ########## //
                    ApplicantProfile applicant = new ApplicantProfile();

                    // EMDID
                    applicant.Empid = empID;

                    // รูปโปรไฟล์
                    applicant.ImgPath = data.ApplicantProfile.ImgPath;

                    // ลักษณะงานที่ต้องการ
                    applicant.Position     = data.ApplicantProfile.Position;
                    applicant.Salary       = data.ApplicantProfile.Salary;
                    applicant.TypeEmployee = data.ApplicantProfile.TypeEmployee;

                    // ข้อมูลส่วนตัว
                    applicant.TitlenameTh = data.ApplicantProfile.TitelnameTh;
                    applicant.FirstnameTh = data.ApplicantProfile.FirstnameTh;
                    applicant.LastnameTh  = data.ApplicantProfile.LastnameTh;
                    applicant.TitlenameEn = data.ApplicantProfile.TitelnameEn;
                    applicant.FirstnameEn = data.ApplicantProfile.FirstnameEn;
                    applicant.LastnameEn  = data.ApplicantProfile.LastnameEn;
                    applicant.Birthday    = data.ApplicantProfile.Birthday;
                    applicant.Age         = data.ApplicantProfile.Age;
                    applicant.Gender      = data.ApplicantProfile.Gender;
                    applicant.Status      = data.ApplicantProfile.Status;
                    applicant.IdCard      = data.ApplicantProfile.IdCard;
                    applicant.Religion    = data.ApplicantProfile.Religion;
                    applicant.Nationality = data.ApplicantProfile.Nationality;
                    applicant.Height      = data.ApplicantProfile.Height;
                    applicant.Weight      = data.ApplicantProfile.Weight;

                    // ข้อมูลการติดต่อ
                    applicant.Tel    = data.ApplicantProfile.Tel;
                    applicant.Email  = data.ApplicantProfile.Email;
                    applicant.Lineid = data.ApplicantProfile.LineID;

                    // ข้อมูลที่อยู่ปัจจุบัน
                    applicant.Address     = data.ApplicantProfile.Address;
                    applicant.Province    = data.ApplicantProfile.Province;
                    applicant.District    = data.ApplicantProfile.District;
                    applicant.SubDistrict = data.ApplicantProfile.SubDistrict;
                    applicant.PostalCode  = data.ApplicantProfile.PostalCode.ToString();

                    // Status
                    applicant.StatusApplicant = "New";

                    applicant.CrBy    = "Coop";;
                    applicant.CrDate  = dateTime;
                    applicant.UpdBy   = "Coop";
                    applicant.UpdDate = dateTime;

                    Context.ApplicantProfile.Add(applicant);
                    #endregion

                    #region // ########## Table APPLICANT_EDU_HISTORY ########## //
                    int eduNo = 0;
                    foreach (ApplicantEduHistoryDTO edu in data.ApplicantEduHistories)
                    {
                        ApplicantEduHistory applicantEdu = new ApplicantEduHistory();
                        eduNo++;

                        // EMPID
                        applicantEdu.Empid = empID;

                        // ประวัติการศึกษา
                        applicantEdu.No         = eduNo;
                        applicantEdu.Education  = edu.Education;
                        applicantEdu.SchoolName = edu.SchoolName;
                        applicantEdu.Faculty    = edu.Faculty;
                        applicantEdu.Major      = edu.Major;
                        applicantEdu.GradYear   = edu.GradYear.Year.ToString();
                        applicantEdu.Gpa        = edu.Gpa;

                        applicantEdu.CrBy    = "Coop";
                        applicantEdu.CrDate  = dateTime;
                        applicantEdu.UpdBy   = "Coop";
                        applicantEdu.UpdDate = dateTime;

                        Context.ApplicantEduHistory.Add(applicantEdu);
                    }
                    #endregion

                    #region // ########## Table APPLICANT_WORKING_HISTORY ########## //
                    int workNo = 0;
                    foreach (ApplicantWorkingHistoryDTO work in data.ApplicantWorkingHistories)
                    {
                        ApplicantWorkingHistory applicantWork = new ApplicantWorkingHistory();
                        workNo++;

                        // EMPID
                        applicantWork.Empid = empID;

                        // ประวัติการทำงาน/ฝึกงาน
                        applicantWork.No             = workNo;
                        applicantWork.StartDate      = work.StartDate;
                        applicantWork.EndDate        = work.EndDate;
                        applicantWork.CompanyName    = work.CompanyName;
                        applicantWork.CompanyAddress = work.CompanyAddress;
                        applicantWork.Position       = work.Position;
                        applicantWork.Salary         = work.Salary;

                        applicantWork.CrBy    = "Coop";
                        applicantWork.CrDate  = dateTime;
                        applicantWork.UpdBy   = "Coop";
                        applicantWork.UpdDate = dateTime;

                        Context.ApplicantWorkingHistory.Add(applicantWork);
                    }
                    #endregion

                    #region // ########## Table APPLICANT_TRAINING_HISTORY ########## //
                    int trainingNo = 0;
                    foreach (ApplicantTrainingHistoryDTO training in data.ApplicantTrainingHistories)
                    {
                        ApplicantTrainingHistory applicantTraining = new ApplicantTrainingHistory();
                        trainingNo++;

                        // EMPID
                        applicantTraining.Empid = empID;

                        // ประวัติการฝึกอบรม/ประกาศนียบัตร
                        applicantTraining.No           = trainingNo;
                        applicantTraining.StartDate    = training.StartDate;
                        applicantTraining.EndDate      = training.EndDate;
                        applicantTraining.TrainingName = training.TrainingName;
                        applicantTraining.CourseName   = training.CourseName;
                        applicantTraining.Certificate  = training.Certificate;

                        applicantTraining.CrBy    = "Coop";
                        applicantTraining.CrDate  = dateTime;
                        applicantTraining.UpdBy   = "Coop";
                        applicantTraining.UpdDate = dateTime;

                        Context.ApplicantTrainingHistory.Add(applicantTraining);
                    }
                    #endregion

                    #region // ########## Table APPLICANT_SKILL_LANGUAGE ########## //
                    int languageNo = 0;
                    foreach (ApplicantSkillLanguageDTO language in data.ApplicantSkillLanguages)
                    {
                        ApplicantSkillLanguage applicantLanguage = new ApplicantSkillLanguage();
                        languageNo++;

                        // EMPID
                        applicantLanguage.Empid = empID;

                        // ความสามารถทางภาษา
                        applicantLanguage.No            = languageNo;
                        applicantLanguage.Language      = language.Language;
                        applicantLanguage.LanguageSpeak = language.LanguageSpeak;
                        applicantLanguage.LanguageRead  = language.LanguageRead;
                        applicantLanguage.LanguageWrite = language.LanguageWrite;

                        applicantLanguage.CrBy    = "Coop";
                        applicantLanguage.CrDate  = dateTime;
                        applicantLanguage.UpdBy   = "Coop";
                        applicantLanguage.UpdDate = dateTime;

                        Context.ApplicantSkillLanguage.Add(applicantLanguage);
                    }
                    #endregion

                    #region // ########## Table APPLICANT_SKILL ########## //
                    ApplicantSkill applicantSkill = new ApplicantSkill();

                    // EMPID
                    applicantSkill.Empid = empID;

                    // พิมพ์ดีด
                    applicantSkill.TypingTh = data.ApplicantSkill.TypingTh;
                    applicantSkill.TypingEn = data.ApplicantSkill.TypingEn;

                    // กรุณาเรียงลำดับความสามารถด้านคอมพิวเตอร์ (เช่นภาษา/โปรแกรม/ระบบปฏิบัติการอื่นๆ)
                    applicantSkill.Special1 = data.ApplicantSkill.Special1;
                    applicantSkill.Special2 = data.ApplicantSkill.Special2;
                    applicantSkill.Special3 = data.ApplicantSkill.Special3;
                    applicantSkill.Special4 = data.ApplicantSkill.Special4;

                    applicantSkill.CrBy    = "Coop";
                    applicantSkill.CrDate  = dateTime;
                    applicantSkill.UpdBy   = "Coop";
                    applicantSkill.UpdDate = dateTime;

                    Context.ApplicantSkill.Add(applicantSkill);
                    #endregion

                    #region // ########## Table APPLICANT_REF ########## //
                    int refNo = 0;
                    foreach (ApplicantRefDTO refs in data.ApplicantRef)
                    {
                        ApplicantRef applicantRef = new ApplicantRef();
                        refNo++;

                        // EMPID
                        applicantRef.Empid = empID;

                        // รายชื่อบุคคลอ้างอิง ซึ่งมิใช่ญาติหรือผู้ว่าจ้าง ซึ่งบริษัทฯ สามารถสอบประวัติท่านได้
                        applicantRef.No          = refNo;
                        applicantRef.RefName     = refs.RefName;
                        applicantRef.RefPosition = refs.RefPosition;
                        applicantRef.RefTel      = refs.RefTel;

                        applicantRef.CrBy    = "Coop";
                        applicantRef.CrDate  = dateTime;
                        applicantRef.UpdBy   = "Coop";
                        applicantRef.UpdDate = dateTime;

                        Context.ApplicantRef.Add(applicantRef);
                    }
                    #endregion

                    Context.SaveChanges();
                    dbContextTransaction.Commit();

                    return(empID.ToString());
                }
                catch (Exception ex)
                {
                    dbContextTransaction.Rollback();
                    return("error");
                }
            }
        }
 public void EditProfile(ApplicantProfile profile)
 {
     naaDAO.EditProfile(profile);
 }
 public void AddProfile(ApplicantProfile profile)
 {
     naaDAO.AddProfile(profile);
 }
        public ActionResult EditPersonalProfile()
        {
            ApplicantProfile profile = naaService.GetProfile(naaService.GetApplicantIdByUserId(User.Identity.GetUserId()));

            return(View(profile));
        }
예제 #26
0
 public void AddProfile(ApplicantProfile profile)
 {
     context.ApplicantProfile.Add(profile);
     context.SaveChanges();
 }
 public void DeleteProfile(ApplicantProfile profile)
 {
     naaDAO.DeleteProfile(profile);
 }
예제 #28
0
 public void DeleteProfile(ApplicantProfile profile)
 {
     context.ApplicantProfile.Remove(profile);
     context.SaveChanges();
 }
        public ActionResult DeleteProfile(int id)
        {
            ApplicantProfile profile = naaService.GetProfile(id);

            return(View(profile));
        }