Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DgNV.DataSource = dsNhanVien();
        DgNV.DataBind();

        DgNV.DataBind();
        if (DgNV.Rows.Count > 0)
        {
            DgNV.HeaderRow.Cells[0].Text = "Mã Nhân Viên ";
            DgNV.HeaderRow.Cells[1].Text = "Họ Tên Nhân Viên ";
            DgNV.HeaderRow.Cells[2].Text = "Địa Chỉ ";
            DgNV.HeaderRow.Cells[3].Text = "SDT";
            DgNV.HeaderRow.Cells[4].Text = "Ngày Vào Làm";
            DgNV.HeaderRow.Cells[5].Text = "Lương Cơ Bản ";
            DgNV.HeaderRow.Cells[6].Text = "Giới Tính";
            DgNV.HeaderRow.Cells[7].Text = "Ngày Sinh ";
            DgNV.HeaderRow.Cells[8].Text = "CMND";
        }
    }
Пример #2
0
 protected void bntTim_Click(object sender, EventArgs e)
 {
     DgNV.DataSource = NhanVien_Tim(txtTimKiem.Text);
     DgNV.DataBind();
     if (DgNV.Rows.Count > 0)
     {
         DgNV.HeaderRow.Cells[0].Text = "Mã Nhân Viên ";
         DgNV.HeaderRow.Cells[1].Text = "Họ Tên Nhân Viên ";
         DgNV.HeaderRow.Cells[2].Text = "Địa Chỉ ";
         DgNV.HeaderRow.Cells[3].Text = "SDT";
         DgNV.HeaderRow.Cells[4].Text = "Ngày Vào Làm";
         DgNV.HeaderRow.Cells[5].Text = "Lương Cơ Bản ";
         DgNV.HeaderRow.Cells[6].Text = "Giới Tính";
         DgNV.HeaderRow.Cells[7].Text = "Ngày Sinh ";
         DgNV.HeaderRow.Cells[8].Text = "CMND";
     }
     else
     {
         lblTB.Text = "Không có tên  trong hồ sơ ";
     }
 }
Пример #3
0
    protected void bntXoa_Click(object sender, EventArgs e)
    {
        if (txtMaNV.Text != "")
        {
            Xoa_NV(txtMaNV.Text);
            DgNV.DataSource = dsNhanVien();
            DgNV.DataBind();
            if (DgNV.Rows.Count > 0)
            {
                DgNV.HeaderRow.Cells[0].Text = "Mã Nhân Viên ";
                DgNV.HeaderRow.Cells[1].Text = "Họ Tên Nhân Viên ";
                DgNV.HeaderRow.Cells[2].Text = "Địa Chỉ ";
                DgNV.HeaderRow.Cells[3].Text = "SDT";
                DgNV.HeaderRow.Cells[4].Text = "Ngày Vào Làm";
                DgNV.HeaderRow.Cells[5].Text = "Lương Cơ Bản ";
                DgNV.HeaderRow.Cells[6].Text = "Giới Tính";
                DgNV.HeaderRow.Cells[7].Text = "Ngày Sinh ";
                DgNV.HeaderRow.Cells[8].Text = "CMND";
            }


            txtMaNV.Text       = "";
            txtHoNV.Text       = "";
            txtTenNV.Text      = "";
            txtDiaChi.Text     = "";
            txtSDT.Text        = "";
            txtNgayVaoLam.Text = "";
            txtLuongCoBan.Text = "";
            txtCMND.Text       = "";
            txtTenDN.Text      = "";
            txtMatKhau.Text    = "";

            lblTB.Text = "Đã Xóa vào thành công!";
        }
        else
        {
            lblTB.Text = "Không thể xóa !";
        }
    }
Пример #4
0
    protected void bntThem_Click(object sender, EventArgs e)
    {
        if ((txtMaNV.Text != "") && (txtTenNV.Text != "") && (txtHoNV.Text != "") && (txtDiaChi.Text != "") && (txtLuongCoBan.Text != "") && (txtNgaySinh.Text != "") && (txtSDT.Text != "") && (txtTenDN.Text != "") && (txtMatKhau.Text != "") && (txtNgayVaoLam.Text != ""))
        {
            try
            {
                int Quyen = 1;
                if (raAdmin.Checked)
                {
                    Quyen = 1;
                }
                else
                {
                    Quyen = 0;
                }

                int gt = 1;
                if (raNam.Checked)
                {
                    gt = 1;
                }
                else
                {
                    gt = 0;
                }
                ThemNV(txtMaNV.Text, txtHoNV.Text, txtTenNV.Text, txtDiaChi.Text, txtSDT.Text, txtNgayVaoLam.Text, txtLuongCoBan.Text, gt, txtNgaySinh.Text, txtCMND.Text, txtTenDN.Text, txtMatKhau.Text, Quyen);

                DgNV.DataSource = dsNhanVien();
                DgNV.DataBind();
                if (DgNV.Rows.Count > 0)
                {
                    DgNV.HeaderRow.Cells[0].Text = "Mã Nhân Viên ";
                    DgNV.HeaderRow.Cells[1].Text = "Họ Tên Nhân Viên ";
                    DgNV.HeaderRow.Cells[2].Text = "Địa Chỉ ";
                    DgNV.HeaderRow.Cells[3].Text = "SDT";
                    DgNV.HeaderRow.Cells[4].Text = "Ngày Vào Làm";
                    DgNV.HeaderRow.Cells[5].Text = "Lương Cơ Bản ";
                    DgNV.HeaderRow.Cells[6].Text = "Giới Tính";
                    DgNV.HeaderRow.Cells[7].Text = "Ngày Sinh ";
                    DgNV.HeaderRow.Cells[8].Text = "CMND";
                }


                txtMaNV.Text       = "";
                txtHoNV.Text       = "";
                txtTenNV.Text      = "";
                txtDiaChi.Text     = "";
                txtSDT.Text        = "";
                txtNgayVaoLam.Text = "";
                txtLuongCoBan.Text = "";
                txtCMND.Text       = "";
                txtTenDN.Text      = "";
                txtMatKhau.Text    = "";

                lblTB.Text = "Đã thêm vào thành công.";
            }
            catch
            {
                lblTB.Text = "Không thể thêm thông tin này. Vui lòng kiểm tra lại.";
            }
        }
        else
        {
            lblTB.Text = "Không thể thêm thông tin này. Vui lòng kiểm tra lại.";
        }
    }