Beispiel #1
0
        private void loadctrldong()
        {
            listQLNS.Clear();


            foreach (DataRow dataRow in dataSetQLNS.HOSOTUYENDUNG)
            {
                if (kiemtratrungMaUngVien(dataRow["MAUNGVIEN"].ToString()) == true)
                {
                    string pMaUV     = dataRow["MAUNGVIEN"].ToString();
                    string pTenUV    = dataRow["HOTEN"].ToString();
                    string pNgayUV   = dataRow["NGAYSINH"].ToString().Split(' ')[0].ToString();
                    string pSDTUV    = dataRow["DIENTHOAI"].ToString();
                    string pEMailUV  = dataRow["EMAIL"].ToString();
                    string pChucVuUV = dataRow["VITRITUYENDUNG"].ToString();

                    UserControl_Dong_UngVien usercotrol = new UserControl_Dong_UngVien(pMaUV, pTenUV, pNgayUV, pSDTUV, pEMailUV, pChucVuUV, loadhinh(pMaUV));

                    listQLNS.Add(usercotrol);
                }
            }
        }
Beispiel #2
0
        private void txt_MaUV_TextChanged(object sender, EventArgs e)
        {
            if (txt_MaUV.Text.Trim().Length > 0 && txt_HoTenUV.Text.Trim().Length > 0 && txt_ChucVu.Text.Length > 0)
            {
                listQLNSSearch.Clear();

                foreach (DataRow dataRow in dataSetQLNS.HOSOTUYENDUNG)
                {
                    if (kiemtratrungMaUngVien(dataRow["MAUNGVIEN"].ToString()) == true)
                    {
                        string pMaUV     = dataRow["MAUNGVIEN"].ToString();
                        string pTenUV    = dataRow["HOTEN"].ToString();
                        string pNgayUV   = dataRow["NGAYSINH"].ToString().Split(' ')[0].ToString();
                        string pSDTUV    = dataRow["DIENTHOAI"].ToString();
                        string pEMailUV  = dataRow["EMAIL"].ToString();
                        string pChucVuUV = dataRow["VITRITUYENDUNG"].ToString();
                        UserControl_Dong_UngVien usercotrol = new UserControl_Dong_UngVien(pMaUV, pTenUV, pNgayUV, pSDTUV, pEMailUV, pChucVuUV, loadhinh(pMaUV));
                        if (pMaUV.ToLower().ToString().Contains(txt_MaUV.Text.ToLower().ToString()) == true && pTenUV.ToLower().ToString().Contains(txt_HoTenUV.Text.ToLower().ToString()) == true && pChucVuUV.ToLower().ToString().Contains(txt_ChucVu.Text.ToLower().ToString()) == true)
                        {
                            listQLNSSearch.Add(usercotrol);
                        }
                    }
                }

                sapxep(listQLNSSearch);
            }
            else
            {
                if (txt_ChucVu.Text.Trim().Length > 0 && txt_HoTenUV.Text.Trim().Length > 0)
                {
                    listQLNSSearch.Clear();

                    foreach (DataRow dataRow in dataSetQLNS.HOSOTUYENDUNG)
                    {
                        if (kiemtratrungMaUngVien(dataRow["MAUNGVIEN"].ToString()) == true)
                        {
                            string pMaUV     = dataRow["MAUNGVIEN"].ToString();
                            string pTenUV    = dataRow["HOTEN"].ToString();
                            string pNgayUV   = dataRow["NGAYSINH"].ToString().Split(' ')[0].ToString();
                            string pSDTUV    = dataRow["DIENTHOAI"].ToString();
                            string pEMailUV  = dataRow["EMAIL"].ToString();
                            string pChucVuUV = dataRow["VITRITUYENDUNG"].ToString();
                            UserControl_Dong_UngVien usercotrol = new UserControl_Dong_UngVien(pMaUV, pTenUV, pNgayUV, pSDTUV, pEMailUV, pChucVuUV, loadhinh(pMaUV));
                            if (pChucVuUV.ToLower().ToString().Contains(txt_ChucVu.Text.ToLower().ToString()) == true && pTenUV.ToLower().ToString().Contains(txt_HoTenUV.Text.ToLower().ToString()) == true)
                            {
                                listQLNSSearch.Add(usercotrol);
                            }
                        }
                    }

                    sapxep(listQLNSSearch);
                }
                else
                {
                    if (txt_MaUV.Text.Trim().Length > 0 && txt_ChucVu.Text.Trim().Length > 0)
                    {
                        listQLNSSearch.Clear();

                        foreach (DataRow dataRow in dataSetQLNS.HOSOTUYENDUNG)
                        {
                            if (kiemtratrungMaUngVien(dataRow["MAUNGVIEN"].ToString()) == true)
                            {
                                string pMaUV     = dataRow["MAUNGVIEN"].ToString();
                                string pTenUV    = dataRow["HOTEN"].ToString();
                                string pNgayUV   = dataRow["NGAYSINH"].ToString().Split(' ')[0].ToString();
                                string pSDTUV    = dataRow["DIENTHOAI"].ToString();
                                string pEMailUV  = dataRow["EMAIL"].ToString();
                                string pChucVuUV = dataRow["VITRITUYENDUNG"].ToString();
                                UserControl_Dong_UngVien usercotrol = new UserControl_Dong_UngVien(pMaUV, pTenUV, pNgayUV, pSDTUV, pEMailUV, pChucVuUV, loadhinh(pMaUV));
                                if (pMaUV.ToLower().ToString().Contains(txt_MaUV.Text.ToLower().ToString()) == true && pChucVuUV.ToLower().ToString().Contains(txt_ChucVu.Text.ToLower().ToString()) == true)
                                {
                                    listQLNSSearch.Add(usercotrol);
                                }
                            }
                        }

                        sapxep(listQLNSSearch);
                    }
                    else
                    {
                        if (txt_MaUV.Text.Trim().Length > 0 && txt_HoTenUV.Text.Trim().Length > 0)
                        {
                            listQLNSSearch.Clear();

                            foreach (DataRow dataRow in dataSetQLNS.HOSOTUYENDUNG)
                            {
                                if (kiemtratrungMaUngVien(dataRow["MAUNGVIEN"].ToString()) == true)
                                {
                                    string pMaUV     = dataRow["MAUNGVIEN"].ToString();
                                    string pTenUV    = dataRow["HOTEN"].ToString();
                                    string pNgayUV   = dataRow["NGAYSINH"].ToString().Split(' ')[0].ToString();
                                    string pSDTUV    = dataRow["DIENTHOAI"].ToString();
                                    string pEMailUV  = dataRow["EMAIL"].ToString();
                                    string pChucVuUV = dataRow["VITRITUYENDUNG"].ToString();
                                    UserControl_Dong_UngVien usercotrol = new UserControl_Dong_UngVien(pMaUV, pTenUV, pNgayUV, pSDTUV, pEMailUV, pChucVuUV, loadhinh(pMaUV));
                                    if (pMaUV.ToLower().ToString().Contains(txt_MaUV.Text.ToLower().ToString()) == true && pTenUV.ToLower().ToString().Contains(txt_HoTenUV.Text.ToLower().ToString()) == true)
                                    {
                                        listQLNSSearch.Add(usercotrol);
                                    }
                                }
                            }

                            sapxep(listQLNSSearch);
                        }
                        else
                        {
                            if (txt_MaUV.Text.Trim().Length > 0)
                            {
                                listQLNSSearch.Clear();

                                foreach (DataRow dataRow in dataSetQLNS.HOSOTUYENDUNG)
                                {
                                    if (kiemtratrungMaUngVien(dataRow["MAUNGVIEN"].ToString()) == true)
                                    {
                                        string pMaUV     = dataRow["MAUNGVIEN"].ToString();
                                        string pTenUV    = dataRow["HOTEN"].ToString();
                                        string pNgayUV   = dataRow["NGAYSINH"].ToString().Split(' ')[0].ToString();
                                        string pSDTUV    = dataRow["DIENTHOAI"].ToString();
                                        string pEMailUV  = dataRow["EMAIL"].ToString();
                                        string pChucVuUV = dataRow["VITRITUYENDUNG"].ToString();
                                        UserControl_Dong_UngVien usercotrol = new UserControl_Dong_UngVien(pMaUV, pTenUV, pNgayUV, pSDTUV, pEMailUV, pChucVuUV, loadhinh(pMaUV));
                                        if (pMaUV.ToLower().ToString().Contains(txt_MaUV.Text.ToLower().ToString()) == true)
                                        {
                                            listQLNSSearch.Add(usercotrol);
                                        }
                                    }
                                }
                                sapxep(listQLNSSearch);
                            }
                            else
                            {
                                if (txt_HoTenUV.Text.Trim().Length > 0)
                                {
                                    listQLNSSearch.Clear();

                                    foreach (DataRow dataRow in dataSetQLNS.HOSOTUYENDUNG)
                                    {
                                        if (kiemtratrungMaUngVien(dataRow["MAUNGVIEN"].ToString()) == true)
                                        {
                                            string pMaUV     = dataRow["MAUNGVIEN"].ToString();
                                            string pTenUV    = dataRow["HOTEN"].ToString();
                                            string pNgayUV   = dataRow["NGAYSINH"].ToString().Split(' ')[0].ToString();
                                            string pSDTUV    = dataRow["DIENTHOAI"].ToString();
                                            string pEMailUV  = dataRow["EMAIL"].ToString();
                                            string pChucVuUV = dataRow["VITRITUYENDUNG"].ToString();
                                            UserControl_Dong_UngVien usercotrol = new UserControl_Dong_UngVien(pMaUV, pTenUV, pNgayUV, pSDTUV, pEMailUV, pChucVuUV, loadhinh(pMaUV));
                                            if (pTenUV.ToLower().ToString().Contains(txt_HoTenUV.Text.ToLower().ToString()) == true)
                                            {
                                                listQLNSSearch.Add(usercotrol);
                                            }
                                        }
                                    }
                                    sapxep(listQLNSSearch);
                                }
                                else
                                {
                                    if (txt_ChucVu.Text.Trim().Length > 0)
                                    {
                                        listQLNSSearch.Clear();

                                        foreach (DataRow dataRow in dataSetQLNS.HOSOTUYENDUNG)
                                        {
                                            if (kiemtratrungMaUngVien(dataRow["MAUNGVIEN"].ToString()) == true)
                                            {
                                                string pMaUV     = dataRow["MAUNGVIEN"].ToString();
                                                string pTenUV    = dataRow["HOTEN"].ToString();
                                                string pNgayUV   = dataRow["NGAYSINH"].ToString().Split(' ')[0].ToString();
                                                string pSDTUV    = dataRow["DIENTHOAI"].ToString();
                                                string pEMailUV  = dataRow["EMAIL"].ToString();
                                                string pChucVuUV = dataRow["VITRITUYENDUNG"].ToString();
                                                UserControl_Dong_UngVien usercotrol = new UserControl_Dong_UngVien(pMaUV, pTenUV, pNgayUV, pSDTUV, pEMailUV, pChucVuUV, loadhinh(pMaUV));
                                                if (pChucVuUV.ToLower().ToString().Contains(txt_ChucVu.Text.ToLower().ToString()) == true)
                                                {
                                                    listQLNSSearch.Add(usercotrol);
                                                }
                                            }
                                        }
                                        sapxep(listQLNSSearch);
                                    }
                                    else
                                    {
                                        sapxep(listQLNS);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }