private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intResults = 0; using (clsEmployeeQualification eq = new clsEmployeeQualification()) { eq.Username = _strUsername; eq.Qualification = txtQualification.Text; eq.InclusiveDates = txtInclusiveDates.Text; eq.Remarks = txtRemarks.Text; intResults = eq.Add(); } if (intResults > 0) { _frmEmployeeDetails.LoadQualificationList(); if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ClearFields(); } else { this.Close(); } } } }
protected void dgQualifications_DeleteCommand(object source, DataGridCommandEventArgs e) { HiddenField phdnQualCode = (HiddenField)e.Item.FindControl("hdnQualCode"); clsEmployeeQualification eq = new clsEmployeeQualification(phdnQualCode.Value); eq.Delete(); BindQualificationList(); }
/////////////////////////// ///////// Methods ///////// /////////////////////////// private void LoadDetails() { using (clsEmployeeQualification eq = new clsEmployeeQualification(_strQualificationCode)) { eq.Fill(); txtQualification.Text = eq.Qualification; txtInclusiveDates.Text = eq.InclusiveDates; txtRemarks.Text = eq.Remarks; } txtQualification.Focus(); }
protected void btnAdd_Click(object sender, EventArgs e) { clsEmployeeQualification eq = new clsEmployeeQualification(); eq.Username = Request.Cookies["Speedo"]["UserName"].ToString(); eq.Qualification = txtQualification.Text; eq.InclusiveDates = txtDates.Text; eq.Remarks = (txtRemarks.Text.Length > 255 ? txtRemarks.Text.Substring(0, 255) : txtRemarks.Text); eq.Add(); ClearFields(); BindQualificationList(); }
private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intResults = 0; clsEmployeeQualification eq = new clsEmployeeQualification(); eq.QualificationCode = _strQualificationCode; eq.Qualification = txtQualification.Text; eq.InclusiveDates = txtInclusiveDates.Text; eq.Remarks = txtRemarks.Text; intResults = eq.Edit(); if (intResults > 0) { _frmEmployeeDetails.LoadQualificationList(); this.Close(); } } }
protected void btnQualSave_Click(object sender, EventArgs e) { foreach (DataGridItem itm in dgQualifications.Items) { HiddenField phdnQualCode = (HiddenField)itm.FindControl("hdnQualCode"); TextBox ptxtQualification = (TextBox)itm.FindControl("txtQualification"); TextBox ptxtInclusiveDates = (TextBox)itm.FindControl("txtInclusiveDates"); TextBox ptxtRemarks = (TextBox)itm.FindControl("txtRemarks"); clsEmployeeQualification eq = new clsEmployeeQualification(); eq.QualificationCode = phdnQualCode.Value; eq.Qualification = ptxtQualification.Text; eq.InclusiveDates = ptxtInclusiveDates.Text; eq.Remarks = (ptxtRemarks.Text.Length > 255 ? ptxtRemarks.Text.Substring(0, 255) : ptxtRemarks.Text); eq.Edit(); } BindQualificationList(); }