private void btnThem_Click(object sender, EventArgs e) { if (txtHoTen.Text != "" && txtSDT.Text != "" && txtGioiTinh.Text != "" && txtDate.Text != "" && txtDepartment.Text != "" && txtSDT.Text != "") { DialogResult dialog = MessageBox.Show("Bạn có muốn thêm nhân viên " + txtHoTen.Text + " ở phòng ban " + txtDepartment.Text + " không?", "Xác nhận thêm", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { if (!DNV.check_Nv(txtMaNv.Text)) { if (DNV.Add_NV(txtHoTen.Text, txtGioiTinh.Text, txtDate.Value, txtDiaChi.Text, txtSDT.Text, txtDepartment.Text)) { MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); openButton(true); } else { MessageBox.Show("Thêm thất bại, vui lòng kiểm tra lại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); } } } } else { MessageBox.Show("Vui lòng điền đầy đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void Btn_ReFresh_Click(object sender, EventArgs e) { Data_NV DNV = new Data_NV(); Load_Salary(DNV.Salary_Staff()); Clear(); }
private void Btn_ReFresh_Click(object sender, EventArgs e) { Data_NV DNV = new Data_NV(); Load_Account(DNV.Account_Staff()); Clear(); }
private void btnUpdate_Click(object sender, EventArgs e) { if (txtHoTen.Text != "" && txtSDT.Text != "" && txtGioiTinh.Text != "" && txtDate.Text != "" && txtDepartment.Text != "" && txtSDT.Text != "") { DialogResult dialog = MessageBox.Show("Bạn có chắc chắn muốn cập nhật mục này không?", "Xác nhận cập nhật", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { if (DNV.Update_NV(txtHoTen.Text, txtGioiTinh.Text, txtDate.Value, txtDiaChi.Text, txtSDT.Text, txtDepartment.Text, txtMaNv.Text)) { MessageBox.Show("Cập nhật thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); openButton(true); } else { MessageBox.Show("Cập nhật thất bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); } } } else { MessageBox.Show("Vui lòng không để trống", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void DangNhap_Load(object sender, EventArgs e) { DNV = new Data_NV(); pbCheck.Hide(); lbCheck.Hide(); txtSoLanDN.Hide(); txtQuaSoLan.Hide(); }
private void Btn_ReFresh_Click(object sender, EventArgs e) { Data_NV DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); Clear(); loi = false; }
private void Load_Inf() { DNV = new Data_NV(); foreach (var item in DNV.Infomation(Staff_Id)) { if (item.Staff_Sex.ToString() == "1") { Sex = "Nam"; } else if (item.Staff_Sex.ToString() == "2") { Sex = "Nữ"; } else if (item.Staff_Sex.ToString() == "3") { Sex = "Khác"; } if (item.Staff_Deparment.ToString() == "1") { PhongBan = "Quản Lý"; } else if (item.Staff_Deparment.ToString() == "2") { PhongBan = "Kỹ Thuật"; } else if (item.Staff_Deparment.ToString() == "3") { PhongBan = "Kế Toán"; } if (item.Account_Staff.Staff_Role.ToString() == "1") { ChucVu = "Quản Lý"; } else { ChucVu = "Nhân Viên"; } var date1 = DateTime.Parse(item.Staff_Birth.ToString()); txtAccount.Text = item.Account_Staff.Staff_Account; txtPassword.Text = item.Account_Staff.Staff_Password; txtHoTen.Text = item.Staff_Name; txtGioiTinh.Text = Sex; txtDiaChi.Text = item.Staff_Address; txtDate.Text = date1.ToString("dd/MM/yyyy"); txtSDT.Text = item.Staff_Phone; txtPhongBan.Text = PhongBan; txtChucVu.Text = ChucVu; } }
private void MainForm_Activated(object sender, EventArgs e) { Data_NV DNV = new Data_NV(); var name = DNV.getName(Id); this.name = name; if (MdiChildren.Count() == 0) { txtXinChao.Caption = "Xin chào: ".ToUpper() + name; txtChucVu.Caption = "Chức vụ: ".ToUpper() + ChucVu; WelcomeBack.Text = "Chào mừng quay trở lại: " + name; } this.Opacity = 1.00d; this.BackColor = Color.White; this.accordionControl1.Appearance.AccordionControl.BackColor = Color.Empty; if (MdiChildren.Count() == 0) { pb1.Show(); WelcomeBack.Show(); } accordionControl1.Show(); }
private void btnDelete_Click(object sender, EventArgs e) { if (txtHoTen.Text != "" && txtSDT.Text != "" && txtGioiTinh.Text != "" && txtDate.Text != "" && txtDepartment.Text != "" && txtSDT.Text != "") { DialogResult dialog = MessageBox.Show("Bạn có chắc chắn muốn xóa nhân viên " + txtHoTen.Text + " ở phòng ban " + txtDepartment.Text + " không?", "Xác nhận xóa", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { if (DNV.Delete_NV(txtMaNv.Text)) { MessageBox.Show("Xóa thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); openButton(true); } else { MessageBox.Show("Xóa thất bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); } } } }
private void ThongTinTaiKhoan_Load(object sender, EventArgs e) { DNV = new Data_NV(); Load_Inf(); }
private void ThongTinLuongNhanVien_Load(object sender, EventArgs e) { DNV = new Data_NV(); Load_Salary(DNV.Salary_Staff()); }
private void PhanQuyenVaTaiKhoan_Load(object sender, EventArgs e) { DNV = new Data_NV(); Load_Account(DNV.Account_Staff()); }
private void DanhSachNhanVien_Load(object sender, EventArgs e) { DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); }
private void ThongTinNhanVien_Enter(object sender, EventArgs e) { DNV = new Data_NV(); Load_NV(DNV.Inf_Staff()); }