Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (IsCorrectEntries())
            {
                int intResults = 0;
                using (clsEmployeeAffiliation ef = new clsEmployeeAffiliation())
                {
                    ef.Username       = _strUsername;
                    ef.Organization   = txtOrganization.Text;
                    ef.Position       = txtPosition.Text;
                    ef.InclusiveDates = txtInclusiveDates.Text;
                    ef.Remarks        = txtRemarks.Text;
                    intResults        = ef.Add();
                }

                if (intResults > 0)
                {
                    _frmEmployeeDetails.LoadAffiliationList();
                    if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ClearFields();
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectEntries())
     {
         int intResults            = 0;
         clsEmployeeAffiliation ea = new clsEmployeeAffiliation();
         ea.AffiliationCode = _strAffiliationCode;
         ea.Organization    = txtOrganization.Text;
         ea.Position        = txtPosition.Text;
         ea.InclusiveDates  = txtInclusiveDates.Text;
         ea.Remarks         = txtRemarks.Text;
         intResults         = ea.Edit();
         if (intResults > 0)
         {
             _frmEmployeeDetails.LoadAffiliationList();
             this.Close();
         }
     }
 }