private void bt_them_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tb_ma.Text) || string.IsNullOrEmpty(tb_mahd.Text)) { MessageBox.Show("Bạn phải điền đầy đủ thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { if (DataNhanSu.kiemtra("select dbo.kiemtramaNV('" + tb_ma.Text + "')") == false) { if (DataNhanSu.kiemtra("select dbo.kiemtraSDT('" + tb_sdt.Text + "')") == false) { if (DataNhanSu.kiemtra("select dbo.kiemtramaHD('" + tb_mahd.Text + "')") == false) { add(); MessageBox.Show("Them thanh cong nhân viên:" + cb_hoten.Text, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); dataGridView1.DataSource = DataNhanSu.Danhsach(query_allnhanvien).Tables[0]; } else { MessageBox.Show(tb_mahd.Text + " Đã tồn tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show(tb_sdt.Text + " Đã tồn tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show(tb_ma.Text + " Đã tồn tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
private void bt_timkiem_Click(object sender, EventArgs e) { if (DataNhanSu.kiemtra("select dbo._kiemtrahoten(N'" + tb_timkiem.Text + "')") == true) { TimKiem t = new TimKiem(tb_timkiem.Text); this.Visible = false; t.ShowDialog(); } else { MessageBox.Show("Không tìm thấy nhân viên có họ tên " + tb_timkiem.Text); } }
private void cb_tháng_SelectedIndexChanged(object sender, EventArgs e) { ComboBox combo = sender as ComboBox; if (DataNhanSu.kiemtra("select dbo._kiemtraTenpb(N'" + combo.SelectedItem.ToString() + "')") == true) { tb_tongthuong.Text = (DataNhanSu.tinhluong("select dbo._tongluong(N'" + combo.SelectedItem.ToString() + "')")).ToString(); } else { tb_tongthuong.Text = "0"; } }
private void cb_tháng_SelectedIndexChanged(object sender, EventArgs e) { try { ComboBox combo = sender as ComboBox; if (DataNhanSu.kiemtra("select dbo.testNameOffice(N'" + combo.SelectedItem.ToString() + "')") == true) { tb_tongthuong.Text = (DataNhanSu.tinhluong("select dbo.TotalsalaryOffice(N'" + combo.SelectedItem.ToString() + "')")).ToString(); } } catch (Exception ex) { tb_tongthuong.Text = "0"; } }
private void bt_them_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tb_ma.Text)) { MessageBox.Show("Bạn chưa điền thông tin", "Thông báo", MessageBoxButtons.OK); } else { if (DataNhanSu.kiemtra("select dbo.kiemtramaPB('" + tb_ma.Text + "')") == false) { add(); MessageBox.Show("Thêm thành công phòng ban " + tb_ten.Text, "Thông báo", MessageBoxButtons.OK); } else { MessageBox.Show("Mã " + tb_ma.Text + " Đã tồn tại", "Thông báo", MessageBoxButtons.OK); } } }
private void addluong_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(cb_ma.Text)) { if (DataNhanSu.kiemtra("select dbo.testcodeSalary('" + cb_ma.Text + "')") == false) { themluong(); MessageBox.Show("Thêm thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Mã " + cb_ma.Text + " đã tồn tại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } } else { MessageBox.Show("Bạn phải nhập đầy đủ thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }