Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (IsCorrectEntries())
            {
                int intResults = 0;
                using (clsEmployeeResearch er = new clsEmployeeResearch())
                {
                    er.Username      = _strUsername;
                    er.Title         = txtTitle.Text;
                    er.DateCompleted = txtDateCompleted.Text;
                    er.Remarks       = txtRemarks.Text;
                    intResults       = er.Add();
                }

                if (intResults > 0)
                {
                    _frmEmployeeDetails.LoadResearchList();
                    if (MessageBox.Show(clsMessageBox.MessageBoxSuccessAddAskNew, clsMessageBox.MessageBoxText, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ClearFields();
                    }
                    else
                    {
                        this.Close();
                    }
                }
            }
        }
Beispiel #2
0
    protected void dgResearch_DeleteCommand(object source, DataGridCommandEventArgs e)
    {
        HiddenField         phdnReseCode = (HiddenField)e.Item.FindControl("hdnReseCode");
        clsEmployeeResearch er           = new clsEmployeeResearch(phdnReseCode.Value);

        er.Delete();
        BindResearchList();
    }
Beispiel #3
0
        ///////////////////////////
        ///////// Methods /////////
        ///////////////////////////

        private void LoadDetails()
        {
            using (clsEmployeeResearch er = new clsEmployeeResearch(_strResearchCode))
            {
                er.Fill();
                txtTitle.Text         = er.Title;
                txtDateCompleted.Text = er.DateCompleted;
                txtRemarks.Text       = er.Remarks;
            }

            txtTitle.Focus();
        }
Beispiel #4
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        clsEmployeeResearch er = new clsEmployeeResearch();

        er.Username      = Request.Cookies["Speedo"]["UserName"].ToString();
        er.Title         = (txtTitle.Text.Length > 100 ? txtTitle.Text.Substring(0, 100) : txtTitle.Text);
        er.DateCompleted = (txtDateCompleted.Text.Length > 50 ? txtDateCompleted.Text.Substring(0, 50) : txtDateCompleted.Text);
        er.Remarks       = (txtDetails.Text.Length > 255 ? txtDetails.Text.Substring(0, 255) : txtDetails.Text);
        er.Add();

        ClearFields();
        BindResearchList();
    }
Beispiel #5
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (IsCorrectEntries())
     {
         int intResults         = 0;
         clsEmployeeResearch er = new clsEmployeeResearch();
         er.ResearchCode  = _strResearchCode;
         er.Title         = txtTitle.Text;
         er.DateCompleted = txtDateCompleted.Text;
         er.Remarks       = txtRemarks.Text;
         intResults       = er.Edit();
         if (intResults > 0)
         {
             _frmEmployeeDetails.LoadResearchList();
             this.Close();
         }
     }
 }
Beispiel #6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        foreach (DataGridItem itm in dgResearch.Items)
        {
            HiddenField phdnReseCode      = (HiddenField)itm.FindControl("hdnReseCode");
            TextBox     ptxtTitle         = (TextBox)itm.FindControl("txtTitle");
            TextBox     ptxtDateCompleted = (TextBox)itm.FindControl("txtDateCompleted");
            TextBox     ptxtDetails       = (TextBox)itm.FindControl("txtRemarks");

            clsEmployeeResearch er = new clsEmployeeResearch();
            er.ResearchCode  = phdnReseCode.Value;
            er.Title         = (ptxtTitle.Text.Length > 100 ? ptxtTitle.Text.Substring(0, 100) : ptxtTitle.Text);
            er.DateCompleted = (ptxtDateCompleted.Text.Length > 50 ? ptxtDateCompleted.Text.Substring(0, 50) : ptxtDateCompleted.Text);
            er.Remarks       = (ptxtDetails.Text.Length > 255 ? ptxtDetails.Text.Substring(0, 255) : ptxtDetails.Text);
            er.Edit();
        }
        BindResearchList();
    }