Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (ValidateEntries())
            {
                int intResults = 0;
                using (clsEmployeeDependent ed = new clsEmployeeDependent())
                {
                    ed.DependentCode = _strDependentCode;
                    ed.Name          = txtName.Text;
                    ed.Birthdate     = dtpBirthDate.Value;
                    ed.Relation      = txtRelation.Text;
                    intResults       = ed.Edit();
                }

                if (intResults > 0)
                {
                    switch (_FormCaller)
                    {
                    case FormCallers.EmployeeDetails:
                        _frmEmployeeDetails.LoadDependentsList();
                        break;
                    }
                    Close();
                }
            }
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (ValidateEntries())
            {
                int intResults = 0;
                using (clsEmployeeDependent ed = new clsEmployeeDependent())
                {
                    ed.Username  = _strUsername;
                    ed.Name      = txtName.Text;
                    ed.Birthdate = dtpBirthDate.Value;
                    ed.Relation  = txtRelation.Text;
                    intResults   = ed.Add();
                }

                if (intResults > 0)
                {
                    _frmEmployeeDetails.LoadDependentsList();
                    if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ClearFields();
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
        }
Esempio n. 3
0
    protected void dgDependent_DeleteCommand(object source, DataGridCommandEventArgs e)
    {
        HiddenField          phdnListDependentCode = (HiddenField)e.Item.FindControl("hdnListDependentCode");
        clsEmployeeDependent ed = new clsEmployeeDependent(phdnListDependentCode.Value);

        ed.Delete();
        BindDependentList();
    }
Esempio n. 4
0
 private void BindRecord()
 {
     using (clsEmployeeDependent ed = new clsEmployeeDependent())
     {
         ed.DependentCode = _strDependentCode;
         ed.Fill();
         txtEmpName.Text    = _strEmployeeName;
         txtName.Text       = ed.Name;
         dtpBirthDate.Value = ed.Birthdate;
         txtRelation.Text   = ed.Relation;
     }
 }
Esempio n. 5
0
    protected void btnDependentAdd_Click(object sender, EventArgs e)
    {
        clsEmployeeDependent ed = new clsEmployeeDependent();

        ed.Username  = Request.Cookies["Speedo"]["UserName"].ToString();
        ed.Name      = txtDpndName.Text;
        ed.Birthdate = dtpDpndBirthdate.Date;
        ed.Relation  = txtDpndRelation.Text;
        ed.Add();

        txtDpndName.Text      = "";
        txtDpndRelation.Text  = "";
        dtpDpndBirthdate.Date = DateTime.Now;

        BindDependentList();
    }
Esempio n. 6
0
    protected void btnDependentSave_Click(object sender, EventArgs e)
    {
        foreach (DataGridItem itm in dgDependent.Items)
        {
            HiddenField  phdnListDependentCode      = (HiddenField)itm.FindControl("hdnListDependentCode");
            TextBox      ptxtListDependentName      = (TextBox)itm.FindControl("txtListDependentName");
            GMDatePicker pdtpListDependentBirthdate = (GMDatePicker)itm.FindControl("dtpListDependentBirthdate");
            TextBox      ptxtListDependentRelation  = (TextBox)itm.FindControl("txtListDependentRelation");

            clsEmployeeDependent ed = new clsEmployeeDependent();
            ed.DependentCode = phdnListDependentCode.Value;
            ed.Name          = ptxtListDependentName.Text;
            ed.Birthdate     = pdtpListDependentBirthdate.Date;
            ed.Relation      = ptxtListDependentRelation.Text;
            ed.Edit();
        }
        BindDependentList();
    }