コード例 #1
0
 public void LoadBasicInfo(string employeeID)
 {
     _basicInfo = _basicInfo.RetrieveBasicInfo(employeeID);
 }
コード例 #2
0
        private void editB_Click(object sender, EventArgs e)
        {
            switch (editB.Text)
            {
            case "Edit":
                editB.Text = "Save";
                EmployeeEnable();
                break;

            case "Save":
                if (_firstName != firstNameTB.Text ||
                    _middleName != middleNameTB.Text ||
                    _lastName != lastNameTB.Text ||
                    _dob != dobDTP.Value ||
                    _gender != genderTB.Text ||
                    _maritalStatus != maritalStatusTB.Text ||
                    _nationality != nationalityTB.Text ||
                    _currentAddress != currentAddressTB.Text ||
                    _permanentAddress != permanentAddressTB.Text ||

                    //        _globe != int.Parse(globeTB.Text.Trim()) ||
                    //       _smart != int.Parse(smartTB.Text.Trim()) ||
                    _email != emailTB.Text ||

                    _tin != tinTB.Text ||
                    _sss != sssTB.Text ||
                    _pagibig != pagibigTB.Text ||
                    _philHealth != philhealthTB.Text ||

                    _position != positionTB.Text ||
                    _position != detailsPositionTB.Text ||
                    _department != departmentTB.Text ||
                    _department != detailsDepartmentTB.Text ||
                    _branch != detailsBranchTB.Text ||
                    _head != headTB.Text ||
                    _startDate != startDateDTP.Value ||

                    _graduate != graduateTB.Text ||
                    _college != collegeTB.Text ||
                    _seniorHigh != seniorHighTB.Text ||
                    _juniorHigh != juniorHighTB.Text ||
                    _elementary != elementaryTB.Text)
                {
                    _basicInfo = new BasicInfo(_basicInfo.EmployeeID,
                                               firstNameTB.Text,
                                               middleNameTB.Text,
                                               lastNameTB.Text,
                                               dobDTP.Value,
                                               genderTB.Text,
                                               maritalStatusTB.Text,
                                               nationalityTB.Text,
                                               currentAddressTB.Text,
                                               permanentAddressTB.Text,
                                               byte.Parse(picturePB.Image.ToString()));

                    /*  _contactInfo = new ContactInfo(_contactInfo.EmployeeID,
                     *                         //      int.Parse(globeTB.Text.Trim()),
                     *                        //      int.Parse(smartTB.Text.Trim()),
                     *                               emailTB.Text);*/

                    _governmentID = new GovernmentID(_governmentID.EmployeeID,
                                                     tinTB.Text,
                                                     sssTB.Text,
                                                     pagibigTB.Text,
                                                     philhealthTB.Text);

                    _cPosition = new CPosition(_cPosition.EmployeeID,
                                               positionTB.Text,
                                               departmentTB.Text,
                                               branchCB.Text,
                                               headTB.Text,
                                               startDateDTP.Value);

                    _education = new Education(_education.EmployeeID,
                                               graduateTB.Text,
                                               collegeTB.Text,
                                               seniorHighTB.Text,
                                               juniorHighTB.Text,
                                               elementaryTB.Text);

                    _basicInfo.UpdateBasicInfo(_basicInfo);
                    _contactInfo.UpdateContactInfo(_contactInfo);
                    _governmentID.UpdateGovernmentID(_governmentID);
                    _cPosition.UpdateCPosition(_cPosition);
                    _education.UpdateEducation(_education);
                }
                editB.Text = "Edit";
                EmployeeDisable();
                break;
            }

            LoadBasicInfo(_employeeID);
            LoadContactInfo(_employeeID);
            LoadGovernmentID(_employeeID);
            LoadCPosition(_employeeID);
            LoadEducation(_employeeID);
        }
コード例 #3
0
        private void saveB_Click(object sender, EventArgs e)
        {
            if (Validate() == true)
            {
                FileStream   fs;
                BinaryReader br;
                try
                {
                    employeeID       = employeeIDTB.Text.Trim();
                    firstName        = firstNameTB.Text.Trim();
                    middleName       = middleNameTB.Text.Trim();
                    lastName         = lastNameTB.Text.Trim();
                    dob              = dobDTP.Value;
                    gender           = genderCB.Text.Trim();
                    maritalStatus    = maritalStatusCB.Text.Trim();
                    nationality      = nationalityTB.Text.Trim();
                    currentAddress   = currentAddressTB.Text.Trim();
                    permanentAddress = permanentAddressTB.Text.Trim();
                    //picture = byte.Parse(picturePB.Image.SaveAdd());

                    /*  string FileName = pictureTB.Text;
                     * byte[] Picture;
                     * fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
                     * br = new BinaryReader(fs);
                     * Picture = br.ReadBytes((int)fs.Length);
                     * br.Close();
                     * fs.Close();*/

                    globe = globeTB.Text.Trim();
                    smart = smartTB.Text.Trim();
                    email = emailTB.Text.Trim();

                    tin        = tinTB.Text.Trim();
                    sss        = sssTB.Text.Trim();
                    pagibig    = pagibigTB.Text.Trim();
                    philhealth = philhealthTB.Text.Trim();

                    position   = positionCB.Text.Trim();
                    department = departmentCB.Text.Trim();
                    branch     = branchCB.Text.Trim();
                    head       = headCB.Text.Trim();
                    startDate  = startDateDTP.Value;

                    graduate   = graduateTB.Text.Trim();
                    college    = collegeTB.Text.Trim();
                    seniorHigh = seniorHighTB.Text.Trim();
                    juniorHigh = juniorHighTB.Text.Trim();
                    elementary = elementaryTB.Text.TrimStart();

                    basicInfo = new BasicInfo(employeeID,
                                              firstName,
                                              middleName,
                                              lastName,
                                              dob,
                                              gender,
                                              maritalStatus,
                                              nationality,
                                              currentAddress,
                                              permanentAddress,
                                              picture);

                    contactInfo = new ContactInfo(employeeID,
                                                  globe,
                                                  smart,
                                                  email);

                    governmentID = new GovernmentID(employeeID,
                                                    tin,
                                                    sss,
                                                    pagibig,
                                                    philhealth);

                    cPosition = new CPosition(employeeID,
                                              position,
                                              department,
                                              branch,
                                              head,
                                              startDate);

                    education = new Education(employeeID,
                                              graduate,
                                              college,
                                              seniorHigh,
                                              juniorHigh,
                                              elementary);

                    basicInfo.InsertBasicInfo(basicInfo);
                    contactInfo.InsertContactInfo(contactInfo);
                    governmentID.InsertGovernmentID(governmentID);
                    cPosition.InsertCPosition(cPosition);
                    education.InsertEducation(education);

                    Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }