private void frmPunish_Load(object sender, EventArgs e) { Refresh(); departmentDO = new DepartmentDO(); employeeDO = new EmployeeDO(); departmentTreeView.DepartmentDataSet = departmentDO.GetAllDepartments(); departmentTreeView.BuildTree(); departmentTreeView.SelectedNode = departmentTreeView.TopNode; departmentTreeView.ExpandNodes(true); LoadPunishCardCombo(); punishD0 = new PunishDO(); dtPunish = dsPunish.Tables[0]; if (selectedPunish >= 0) //Sửa thông tin thẻ phạt { //this.Text = "Sửa thông tin thiết lập thẻ phạt"; this.Text = WorkingContext.LangManager.GetString("frmPunish_Text1"); LoadPunishData(); cboEmployeeName.Enabled = false; departmentTreeView.Enabled = false; } else // thêm mới { //This.Text = "Thiết lập thẻ phạt"; this.Text = WorkingContext.LangManager.GetString("frmPunish_Text2"); } }
private void frmRegLeaveSchedule_Load(object sender, EventArgs e) { Refresh(); employeeDO = new EmployeeDO(); departnemtDO = new DepartmentDO(); departmentTreeView.DepartmentDataSet = departnemtDO.GetAllDepartments(); departmentTreeView.BuildTree(); departmentTreeView.SelectedNode = departmentTreeView.TopNode; departmentTreeView.ExpandNodes(true); leaveScheduleDO = new LeaveScheduleDO(); if (selectedLeaveSchedule >= 0) { // disable các thuộc tính liên quan đến nhân viên string str = WorkingContext.LangManager.GetString("frmRegLeaveSchedule_Text2"); this.Text = str; //this.Text = "Sửa đăng ký công tác"; LoadLeaveSchedule(); cboEmployeeName.Enabled = false; departmentTreeView.Enabled = false; } else { string str = WorkingContext.LangManager.GetString("frmRegLeaveSchedule_Text"); this.Text = str; dsLeaveSchedule = leaveScheduleDO.getLeaveSchedule(); } }
private void btnDeletedEmployee_Click(object sender, System.EventArgs e) { if (delete == 0) { // btnAdd.Visible = false; // btnDelete.Visible = false; btnRestore.Visible = true; checkEmployeeDeleted = true; btnPermanentDelete.Visible = false; delete = 1;// chon tim kiem theo danh sach nhan vien nghi //btnPermanentDelete.Visible = true; EmployeeDO employeeDO = new EmployeeDO(); dsEmployee = employeeDO.GetDeletedEmployeeInsurance((int)departmentTreeView.SelectedNode.Tag); PopulateEmployeeListView(); } else if (delete == 1) { checkEmployeeDeleted = false; delete = 0; departmentTreeView.DepartmentDataSet = departmentDO.GetAllDepartments(); departmentTreeView.BuildTree(); departmentTreeView.SelectedNode = departmentTreeView.TopNode; EmployeeDO employeeDO = new EmployeeDO(); dsEmployee = employeeDO.GetEmployeeByDepartmentInsurance((int)departmentTreeView.SelectedNode.Tag); Refresh(); btnRestore.Visible = false; btnPermanentDelete.Visible = true; } }
/// <summary> /// Xây dựng cây phòng ban /// </summary> private void PopulateDepartmentTreeView() { dsDepartment = departmentDO.GetAllDepartments(); departmentTreeView.DepartmentDataSet = dsDepartment; departmentTreeView.BuildTree1(true); departmentTreeView.SelectedNode = departmentTreeView.TopNode; }
/// <summary> /// /// </summary> private void BindingDepartmentCombo() { DepartmentDO departmentDO = new DepartmentDO(); DataSet departmentDS = departmentDO.GetAllDepartments(); cboDepartment.DataSource = departmentDS.Tables[0]; cboDepartment.ValueMember = "DepartmentID"; cboDepartment.DisplayMember = "DepartmentName"; }
/// <summary> /// Lấy Danh sách các phòng ban /// </summary> private void PopulateDepartmentCombo() { DepartmentDO departmentDO = new DepartmentDO(); DataSet dsDepartment = departmentDO.GetAllDepartments(); cboDepartment.DataSource = dsDepartment.Tables[0]; cboDepartment.ValueMember = "DepartmentID"; cboDepartment.DisplayMember = "DepartmentName"; }
private void frmListEmployees_Load(object sender, EventArgs e) { departmentDO = new DepartmentDO(); employeeDO = new EmployeeDO(); departmentTreeView.DepartmentDataSet = departmentDO.GetAllDepartments(); departmentTreeView.BuildTree(); departmentTreeView.SelectedNode = departmentTreeView.TopNode; Refresh(); }
private void frmChangeTimeInOut_Load(object sender, System.EventArgs e) { Refresh(); timeInOutDO = new TimeInOutDO(); employeeDO = new EmployeeDO(); DepartmentDO departmentDO = new DepartmentDO(); departmentTreeView.DepartmentDataSet = departmentDO.GetAllDepartments(); departmentTreeView.BuildTree(); departmentTreeView.SelectedNode = departmentTreeView.TopNode; }
private void frmRegWorkingTime_Load(object sender, EventArgs e) { Refresh(); cboDinnnerAmount.Enabled = false; employeeDO = new EmployeeDO(); DepartmentDO departnemtDO = new DepartmentDO(); departmentTreeView.DepartmentDataSet = departnemtDO.GetAllDepartments(); departmentTreeView.BuildTree(); departmentTreeView.ExpandNodes(true); departmentTreeView.SelectedNode = departmentTreeView.TopNode; regOverTimeDO = new RegOverTimeDO(); dtRegOverTime = dsRegOverTime.Tables[0]; monthCalendar1.SelectDate(DateTime.Today); //CurrentYear = DateTime.Today.Year; CurrentYear = DateTime.Now.Year; monthCalendar1.ActiveMonth.Year = CurrentYear; CurrentMonth = DateTime.Today.Month; monthCalendar1.ActiveMonth.Month = CurrentMonth; monthCalendar1.SelectDate(DateTime.Today); if (selectedRegOverTime >= 0) { // disable các thuộc tính liên quan đến nhân viên string str = WorkingContext.LangManager.GetString("frmRegOverTime1_Text2"); //this.Text = "Sửa đăng ký làm thêm giờ"; this.Text = str; LoadRegOverTime(); // optEmployee.Checked = true; departmentTreeView.Enabled = false; // optAll.Enabled = false; //dtpDayWorking.Enabled = false; //cboEmployeeName.Enabled = false; lvwListEmployee.Enabled = false; } else { string str = WorkingContext.LangManager.GetString("frmRegOverTime1_Text1"); //this.Text = "Thêm đăng ký làm thêm giờ"; this.Text = str; //txtEmployeeName.Enabled = false; //cboEmployeeName.Enabled = false; } PopulateShiftCombo(); }