Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (IsCorrectEntries())
            {
                int intResults = 0;
                using (clsEmployeeMovement em = new clsEmployeeMovement())
                {
                    em.Username        = _strUsername;
                    em.EffectivityFrom = dtpFrom.Value;
                    em.EffectivityTo   = dtpTo.Value;
                    em.DivisionCode    = cmbDivision.SelectedValue.ToString();
                    em.GroupCode       = cmbGroup.SelectedValue.ToString();
                    em.DepartmentCode  = cmbDepartment.SelectedValue.ToString();
                    em.JGCode          = cmbJGCode.SelectedValue.ToString();
                    em.Position        = txtPosition.Text;
                    em.Remarks         = txtRemarks.Text;
                    em.CreateBy        = HRMSCore.Username;
                    em.CreateOn        = DateTime.Now;
                    em.ModifyBy        = HRMSCore.Username;
                    em.ModifyOn        = DateTime.Now;
                    intResults         = em.Add();
                }

                if (intResults > 0)
                {
                    _frmEmployeeDetails.BindMovementList();
                    if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ClearFields();
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
        }