private void buttonGetEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                DataLayer.Employees es = new DataLayer.Employees();

                DataLayer.DB.EnableStatistics = true;

                DataLayer.Employee employee = es.GetEmployee(int.Parse(textBoxEID.Text));
                RefreshStatistics(DataLayer.DB.LastStatistics);

                DataLayer.DB.EnableStatistics = false;

                textBoxFName.Text = employee.FirstName;
                textBoxLName.Text = employee.LastName;
                textBoxDName.Text = employee.DepartmentName;
                labelDeptId.Text  = employee.DepartmentId.ToString();
                labelOldName.Text = employee.DepartmentName;    // for concurrency

                DataLayer.ApplicationLog.Add5("Searched for user id: " + textBoxEID.Text);

                DataTable tableLog = DataLayer.ApplicationLog.GetLog("WinDemo Application");
                dataGridViewAppLog.DataSource = tableLog;
            }
            catch (SqlException sqlex)
            {
                // Connection error...
                System.Windows.Forms.MessageBox.Show(this, sqlex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch { }
        }
Example #2
0
        protected void LinkButtonGetEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                DataLayer.Employees es       = new DataLayer.Employees();
                DataLayer.Employee  employee = es.GetEmployee(int.Parse(TextBoxEID.Text));

                TextBoxFName.Text      = employee.FirstName;
                TextBoxLName.Text      = employee.LastName;
                TextBoxDepartment.Text = employee.DepartmentName;
                LabelDeptId.Text       = employee.DepartmentId.ToString();
                hfOldDeptName.Value    = employee.DepartmentName;

                DataLayer.ApplicationLog.Add4("Searched for user id: " + TextBoxEID.Text);

                GridViewAppLog.DataSource = DataLayer.ApplicationLog.GetLog("ASPDemo Application");
                GridViewAppLog.DataBind();
            }
            catch (SqlException sqlex)
            {
                // Connection error...
                LabelError.Text = sqlex.Message;
            }
            catch { }
        }
Example #3
0
        protected void linkGO_Click(object sender, EventArgs e)
        {
            DataLayer.Employees es       = new DataLayer.Employees();
            DataLayer.Employee  employee = es.GetEmployee(int.Parse(txtEID.Text));

            TxtFName.Text = employee.FirstName;
            txtLName.Text = employee.LastName;
            txtDept.Text  = employee.DepartmentName;
        }
Example #4
0
        private void btnGetEmp_Click(object sender, EventArgs e)
        {
            DataLayer.Employees es       = new DataLayer.Employees();
            DataLayer.Employee  employee = es.GetEmployee(int.Parse(txtEID.Text));

            txtFName.Text    = employee.FirstName;
            txtLName.Text    = employee.LastName;
            txtDeptName.Text = employee.DepartmentName;
        }
        protected void LinkButtonGetEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                DataLayer.Employees es       = new DataLayer.Employees();
                DataLayer.Employee  employee = es.GetEmployee(int.Parse(TextBoxEID.Text));

                TextBoxFName.Text      = employee.FirstName;
                TextBoxLName.Text      = employee.LastName;
                TextBoxDepartment.Text = employee.DepartmentName;
            }
            catch { }
        }
Example #6
0
        private void buttonGetEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                DataLayer.Employees es       = new DataLayer.Employees();
                DataLayer.Employee  employee = es.GetEmployee(int.Parse(textBoxEID.Text));

                textBoxFName.Text = employee.FirstName;
                textBoxLName.Text = employee.LastName;
                textBoxDName.Text = employee.DepartmentName;
            }
            catch { }
        }
Example #7
0
        private void buttonGetEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                DataLayer.Employees es       = new DataLayer.Employees();
                DataLayer.Employee  employee = es.GetEmployee(int.Parse(textBoxEID.Text));

                textBoxFName.Text = employee.FirstName;
                textBoxLName.Text = employee.LastName;
                textBoxDName.Text = employee.DepartmentName;
                labelDeptId.Text  = employee.DepartmentId.ToString();

                DataLayer.ApplicationLog.Add4("Search for user id: " + textBoxEID.Text);
            }
            catch { }
        }
        protected void LinkButtonGetEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                DataLayer.Employees es       = new DataLayer.Employees();
                DataLayer.Employee  employee = es.GetEmployee(int.Parse(TextBoxEID.Text));

                TextBoxFName.Text      = employee.FirstName;
                TextBoxLName.Text      = employee.LastName;
                TextBoxDepartment.Text = employee.DepartmentName;
                LabelDeptId.Text       = employee.DepartmentId.ToString();

                DataLayer.ApplicationLog.Add4("Searched for user id: " + TextBoxEID.Text);
            }
            catch { }
        }
Example #9
0
        protected void LinkButtonGo_Click(object sender, EventArgs e)
        {
            try
            {
                DataLayer.Employees es       = new DataLayer.Employees();
                DataLayer.Employee  employee = es.GetEmployee(int.Parse(TextBox1.Text));

                TextBoxFName.Text      = employee.FirstName;
                TextBoxLName.Text      = employee.LastName;
                TextBoxDepartment.Text = employee.DepartmentName;

                DataLayer.ApplicationLog.Add("Searched for user id: " + TextBox1.Text);
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void buttonGetEmployee_Click(object sender, EventArgs e)
        {
            try
            {
                DataLayer.Employees es       = new DataLayer.Employees();
                DataLayer.Employee  employee = es.GetEmployee(int.Parse(textBoxEID.Text));

                textBoxFName.Text = employee.FirstName;
                textBoxLName.Text = employee.LastName;
                textBoxDName.Text = employee.DepartmentName;
                labelDeptId.Text  = employee.DepartmentId.ToString();

                DataLayer.ApplicationLog.Add4("Searched for user id: " + textBoxEID.Text);
            }
            catch (SqlException sqlex)
            {
                // Connection error...
                System.Windows.Forms.MessageBox.Show(this, sqlex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch { }
        }