示例#1
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            this.Cursor = Cursors.AppStarting;
            AddNewEmployee x = new AddNewEmployee();

            x.Owner = this;
            x.ShowDialog();
            this.Cursor = Cursors.Arrow;
        }
        public void TransferApplicant(int appid)
        {
            try
            {
                using (var db = new LetranIntegratedSystemEntities())
                {
                    var appfind = db.HRISOnlineJobApplications.Find(appid);
                    if (appfind != null)
                    {
                        AddNewEmployee ae = new AddNewEmployee();
                        ae.Owner = this;

                        //Personal Information
                        ae.txtFirstName.Text  = appfind.FirstName;
                        ae.txtMiddleName.Text = appfind.MiddleName;
                        ae.txtLastName.Text   = appfind.LastName;
                        ae.txtCity.Text       = appfind.CityAddress;
                        ae.txtTelno.Text      = appfind.TelephoneNo;
                        ae.txtMobileno.Text   = appfind.MobileNo;
                        if (appfind.Gender == "Male")
                        {
                            ae.rbMale.IsChecked = true;
                        }
                        else
                        {
                            ae.rbFemale.IsChecked = true;
                        }
                        ae.dpBirthday.SelectedDate = appfind.Birthday.Value;
                        ae.cbCivilStatus.Text      = appfind.CivilStatus;
                        ae.txtCitizenship.Text     = appfind.Citizenship;
                        ae.txtReligion.Text        = appfind.Religion;
                        ae.txtTIN.Text             = appfind.TIN;
                        ae.txtSSS.Text             = appfind.SSS;
                        ae.txtPagibig.Text         = appfind.PAGIBIG;
                        ae.txtPhilhealth.Text      = appfind.PHILHEALTH;

                        //Educational Information
                        EAEList = new List <HRiSClass.EmployeeAddEducationList>();

                        var appeduc = db.HRISOnlineJobApplicationEducations.Where(m => m.ApplicationID == appfind.ApplicationID).ToList();

                        foreach (var x in appeduc)
                        {
                            HRiSClass.EmployeeAddEducationList edu = new HRiSClass.EmployeeAddEducationList();
                            edu.Award         = x.Honors;
                            edu.Degree        = x.Course;
                            edu.EducationType = db.EducationalLevels.Find(x.EducationType).EducLevelName;
                            edu.Graduation    = x.InclusiveDates;
                            edu.Institution   = x.SchoolAddress;
                            EAEList.Add(edu);
                        }

                        ae.dgEmpEduc.ItemsSource = EAEList;

                        //Work Experience
                        EAWList = new List <HRiSClass.EmployeeAddWorkList>();
                        var appwork = db.HRISOnlineJobApplicationWorkExperiences.Where(m => m.ApplicationID == appfind.ApplicationID).ToList();

                        foreach (var x in appwork)
                        {
                            HRiSClass.EmployeeAddWorkList eaw = new HRiSClass.EmployeeAddWorkList();
                            eaw.Company       = x.CompanyName;
                            eaw.InclusiveDate = x.InclusiveDate;
                            eaw.LastSalary    = x.LastSalary;
                            eaw.Position      = x.Position;
                            eaw.Reason        = x.Position;
                            EAWList.Add(eaw);
                        }
                        ae.dgWorkExp.ItemsSource = EAWList;

                        //Seminars
                        EASList = new List <HRiSClass.EmployeeAddSeminarList>();

                        var appsem = db.HRISOnlineJobApplicationSeminars.Where(m => m.ApplicationID == appfind.ApplicationID).ToList();

                        foreach (var x in appsem)
                        {
                            HRiSClass.EmployeeAddSeminarList eas = new HRiSClass.EmployeeAddSeminarList();
                            eas.InclusiveDate = x.InclusiveDate;
                            eas.Seminar       = x.Title;
                            eas.Venue         = x.Venue;
                            EASList.Add(eas);
                        }
                        ae.dgSeminars.ItemsSource = EASList;

                        //to be continued.. plus CSS plus INfo Ticketing


                        ae.ShowDialog();
                    }
                    else
                    {
                        MessageBox.Show("Applicant not found.", "System Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Something went wrong.", "System Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }