Example #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (IsCorrectEntries())
            {
                int intResults = 0;
                using (clsEmployeeEducation ed = new clsEmployeeEducation())
                {
                    ed.Username           = _strUsername;
                    ed.EducationLevelCode = cmbLevel.SelectedValue.ToString();
                    ed.Course             = txtCourse.Text;
                    ed.SchoolName         = txtSchoolName.Text;
                    ed.SchoolAddress      = txtSchoolAddress.Text;
                    ed.InclusiveDates     = txtInclusiveDates.Text;
                    ed.Recognition        = txtRecognition.Text;
                    ed.Complete           = (chkComplete.Checked ? "1" : "0");
                    intResults            = ed.Add();
                }

                if (intResults > 0)
                {
                    _frmEmployeeDetails.LoadEducationList();
                    if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ClearFields();
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
        }
Example #2
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        clsEmployeeEducation ed = new clsEmployeeEducation();

        ed.Username           = Request.Cookies["Speedo"]["UserName"].ToString();
        ed.EducationLevelCode = ddlLevel.SelectedValue.ToString();
        ed.Course             = txtCourse.Text;
        ed.SchoolName         = txtSchool.Text;
        ed.SchoolAddress      = txtSchoolAddress.Text;
        ed.InclusiveDates     = txtInclusiveDates.Text;
        ed.Recognition        = txtRecognition.Text;
        ed.Complete           = (chkComplete.Checked ? "1" : "0");
        ed.Add();

        ClearFields();
        BindEducationList();
    }