private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intResults = 0; clsEmployeeChildren ec = new clsEmployeeChildren(); ec.Username = _strUsername; ec.Name = txtName.Text; ec.Birthdate = dtpBirthDate.Value; intResults = ec.Add(); if (intResults > 0) { _frmEmployeeDetails.LoadChildrenList(); if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ClearFields(); } else { this.Close(); } } } }
protected void dgChildren_DeleteCommand(object source, DataGridCommandEventArgs e) { HiddenField phdnListChildCode = (HiddenField)e.Item.FindControl("hdnListChildCode"); clsEmployeeChildren ec = new clsEmployeeChildren(phdnListChildCode.Value); ec.Delete(); BindChildrenList(); }
////////////////////////////////// ///////// Helper Methods ///////// ////////////////////////////////// private void BindRecords() { txtEmpName.Text = _strEmployeeName; clsEmployeeChildren ec = new clsEmployeeChildren(); ec.ChildCode = _strChildCode; ec.Fill(); txtName.Text = ec.Name; dtpBirthDate.Value = ec.Birthdate; }
protected void btnChildAdd_Click(object sender, EventArgs e) { clsEmployeeChildren ec = new clsEmployeeChildren(); ec.Username = Request.Cookies["Speedo"]["UserName"].ToString(); ec.Name = txtChildName.Text; ec.Birthdate = dtpChildBirthdate.Date; ec.Add(); txtChildName.Text = ""; dtpChildBirthdate.Date = DateTime.Now; BindChildrenList(); }
protected void btnChildSave_Click(object sender, EventArgs e) { foreach (DataGridItem itm in dgChildren.Items) { HiddenField phdnListChildCode = (HiddenField)itm.FindControl("hdnListChildCode"); TextBox ptxtListChildName = (TextBox)itm.FindControl("txtListChildName"); GMDatePicker pdtpListChildBirthdate = (GMDatePicker)itm.FindControl("dtpListChildBirthdate"); clsEmployeeChildren ec = new clsEmployeeChildren(); ec.ChildCode = phdnListChildCode.Value; ec.Name = ptxtListChildName.Text.Substring(0, 100); ec.Birthdate = pdtpListChildBirthdate.Date; ec.Edit(); } BindChildrenList(); }
private void btnSave_Click(object sender, EventArgs e) { if (IsCorrectEntries()) { int intResults = 0; clsEmployeeChildren ec = new clsEmployeeChildren(); ec.ChildCode = _strChildCode; ec.Name = txtName.Text; ec.Birthdate = dtpBirthDate.Value; intResults = ec.Edit(); if (intResults > 0) { _frmEmployeeDetails.LoadChildrenList(); Close(); } } }