예제 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (IsCorrectEntries())
            {
                int intResults = 0;
                using (clsEmployeeEmploymentHistory eeh = new clsEmployeeEmploymentHistory())
                {
                    eeh.Username             = _strUsername;
                    eeh.InclusiveDates       = txtInclusiveDates.Text;
                    eeh.Position             = txtPosition.Text;
                    eeh.Responsibility       = txtResponsibility.Text;
                    eeh.EmploymentStatusCode = cmbEmploymentStatus.SelectedValue.ToString();
                    eeh.CompanyName          = txtCompanyName.Text;
                    eeh.CompanyAddress       = txtCompanyAddress.Text;
                    eeh.CompanyContactNumber = txtContactNumber.Text;
                    intResults = eeh.Add();
                }

                if (intResults > 0)
                {
                    _frmEmployeeDetails.BindEmploymentHistoryList();
                    if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ClearFields();
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
        }
예제 #2
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectEntries())
     {
         clsEmployeeEmploymentHistory eeh = new clsEmployeeEmploymentHistory(_strEmploymentHistoryCode);
         eeh.InclusiveDates       = txtInclusiveDates.Text;
         eeh.Position             = txtPosition.Text;
         eeh.Responsibility       = txtResponsibility.Text;
         eeh.EmploymentStatusCode = cmbEmploymentStatus.SelectedValue.ToString();
         eeh.CompanyName          = txtCompanyName.Text;
         eeh.CompanyAddress       = txtCompanyAddress.Text;
         eeh.CompanyContactNumber = txtContactNumber.Text;
         if (eeh.Edit() > 0)
         {
             _frmEmployeeDetails.BindEmploymentHistoryList();
             this.Close();
         }
     }
 }