Пример #1
0
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            frmEmployee frm = new frmEmployee();
            frm.EmployeeDataSet = dsEmployee;
            frm.ShowDialog(this);

            if (!checkEmployeeDeleted)
                dsEmployee = employeeDO.GetEmployeeByDepartment((int)departmentTreeView.SelectedNode.Tag);
            else
                dsEmployee = employeeDO.GetDeletedEmployee((int)departmentTreeView.SelectedNode.Tag);
            PopulateEmployeeListView();
        }
Пример #2
0
        private void btnEdit_Click(object sender, System.EventArgs e)
        {
            if (lvwEmployee.SelectedItems.Length == 0)
            {
                string str = WorkingContext.LangManager.GetString("frmListEm_UpdateE_Messa");
                string str1 = WorkingContext.LangManager.GetString("frmListEm_UpdateE_Title");
                //MessageBox.Show("Bạn chưa chọn nhân viên nào!", "Sửa nhân viên", MessageBoxButtons.OK,  MessageBoxIcon.Error);
                MessageBox.Show(str, str1, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                frmEmployee frm = new frmEmployee();
                frm.EmployeeDataSet = dsEmployee;
                frm.SelectedEmployee = selectedRowIndex;

                try
                {
                    frm.ShowDialog();
                }
                catch
                {
                    frm.ShowDialog();
                }

                if (!checkEmployeeDeleted)
                    dsEmployee = employeeDO.GetEmployeeByDepartment((int)departmentTreeView.SelectedNode.Tag);
                else
                    dsEmployee = employeeDO.GetDeletedEmployee((int)departmentTreeView.SelectedNode.Tag);
                PopulateEmployeeListView();
            }
        }
Пример #3
0
        private void lvwEmployee_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left && e.Clicks == 2)
            {
                if (lvwEmployee.SelectedItems.Length > 0)
                {
                    frmEmployee frm = new frmEmployee();
                    frm.EmployeeDataSet = dsEmployee;
                    frm.SelectedEmployee = selectedRowIndex;
                    frm.ShowDialog(this);

                    PopulateEmployeeListView();
                }
            }
        }
Пример #4
0
        private void lvwEmployee_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
            {
                if (lvwEmployee.SelectedItems.Length > 0)
                {
                    frmEmployee frm = new frmEmployee();
                    frm.EmployeeDataSet = dsEmployee;
                    frm.SelectedEmployee = selectedRowIndex;
                    frm.ShowDialog(this);

                    PopulateEmployeeListView();
                }
            }
        }
Пример #5
0
 private void lvwEmployee_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && e.Clicks == 2)
     {
         if (lvwEmployee.SelectedItems.Length > 0)
         {
             frmEmployee frm = new frmEmployee();
             frm.EmployeeDataSet = dsEmployee;
             frm.SelectedEmployee = selectedRowIndex;
             frm.ShowDialog(this);
             checkEmployeeDeleted = frm.checkkq;
             dsEmployee = employeeDO.GetEmployeeByDepartmentInsurance((int)departmentTreeView.SelectedNode.Tag);
             PopulateEmployeeListView();
         }
     }
 }
Пример #6
0
 private void lvwEmployee_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
 {
     if (e.KeyChar == (char)13)
     {
         if (lvwEmployee.SelectedItems.Length > 0)
         {
             frmEmployee frm = new frmEmployee();
             frm.EmployeeDataSet = dsEmployee;
             frm.SelectedEmployee = selectedRowIndex;
             frm.ShowDialog(this);
             checkEmployeeDeleted = frm.checkkq;
             dsEmployee = employeeDO.GetEmployeeByDepartmentInsurance((int)departmentTreeView.SelectedNode.Tag);
             PopulateEmployeeListView();
         }
     }
 }
Пример #7
0
 /// <summary>
 /// Hiển thị thông tin chi tiết nhân viên trong ảnh
 /// </summary>
 private void ShowEmployeeDetail()
 {
     UI.Employee.frmEmployee frmemployee = new frmEmployee();
     employeeDO = new EmployeeDO();
     dsEmployee = employeeDO.GetEmployeeProfile(EmployeeID);
     frmemployee.EmployeeDataSet= dsEmployee;
     frmemployee.SelectedEmployee = selectedEmployee;
     frmemployee.ShowDialog();
 }