Esempio n. 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();
                    }
                }
            }
        }
Esempio n. 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        foreach (DataGridItem itm in dgEducation.Items)
        {
            HiddenField  phdnEducCode        = (HiddenField)itm.FindControl("hdnEducCode");
            DropDownList pddlLevel           = (DropDownList)itm.FindControl("ddlLevel");
            TextBox      ptxtEducCourse      = (TextBox)itm.FindControl("txtEducCourse");
            TextBox      ptxtEducDates       = (TextBox)itm.FindControl("txtEducDates");
            TextBox      ptxtEducRecognition = (TextBox)itm.FindControl("txtEducRecognition");
            TextBox      ptxtSchool          = (TextBox)itm.FindControl("txtSchool");
            TextBox      ptxtSchoolAddress   = (TextBox)itm.FindControl("txtSchoolAddress");
            CheckBox     pchkEducComplete    = (CheckBox)itm.FindControl("chkEducComplete");

            clsEmployeeEducation ed = new clsEmployeeEducation();
            ed.EducationCode      = phdnEducCode.Value;
            ed.EducationLevelCode = pddlLevel.SelectedValue;
            ed.Course             = ptxtEducCourse.Text;
            ed.InclusiveDates     = ptxtEducDates.Text;
            ed.SchoolName         = ptxtSchool.Text;
            ed.SchoolAddress      = ptxtSchoolAddress.Text;
            ed.Recognition        = ptxtEducRecognition.Text;
            ed.Complete           = (pchkEducComplete.Checked ? "1" : "0");
            ed.Edit();
        }
        BindEducationList();
    }
Esempio n. 3
0
    protected void dgEducation_DeleteCommand(object source, DataGridCommandEventArgs e)
    {
        HiddenField          phdnEducCode = (HiddenField)e.Item.FindControl("hdnEducCode");
        clsEmployeeEducation ed           = new clsEmployeeEducation(phdnEducCode.Value);

        ed.Delete();
        BindEducationList();
    }
Esempio n. 4
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();
    }
Esempio n. 5
0
        ///////////////////////////
        ///////// Methods /////////
        ///////////////////////////

        private void LoadDetails()
        {
            cmbLevel.DataSource    = EducationLevel.GetDSL();
            cmbLevel.DisplayMember = "pText";
            cmbLevel.ValueMember   = "pValue";

            using (clsEmployeeEducation ed = new clsEmployeeEducation(_strEducationCode))
            {
                ed.Fill();
                cmbLevel.SelectedValue = ed.EducationLevelCode;
                txtCourse.Text         = ed.Course;
                txtInclusiveDates.Text = ed.InclusiveDates;
                txtRecognition.Text    = ed.Recognition;
                txtSchoolName.Text     = ed.SchoolName;
                txtSchoolAddress.Text  = ed.SchoolAddress;
                chkComplete.Checked    = (ed.Complete == "1" ? true : false);
            }

            cmbLevel.Focus();
        }
Esempio n. 6
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (IsCorrectEntries())
            {
                int intResults = 0;

                clsEmployeeEducation ed = new clsEmployeeEducation();
                ed.EducationCode      = _strEducationCode;
                ed.EducationLevelCode = cmbLevel.SelectedValue.ToString();
                ed.Course             = txtCourse.Text;
                ed.InclusiveDates     = txtInclusiveDates.Text;
                ed.Recognition        = txtRecognition.Text;
                ed.SchoolName         = txtSchoolName.Text;
                ed.SchoolAddress      = txtSchoolAddress.Text;
                ed.Complete           = (chkComplete.Checked ? "1" : "0");
                intResults            = ed.Edit();

                if (intResults > 0)
                {
                    _frmEmployeeDetails.LoadEducationList();
                    Close();
                }
            }
        }