private void btnCuocGoiTruoc_Click(object sender, EventArgs e)
        {
            frmTimKiem frmSearch = new frmTimKiem(lblDienThoai.Text);

            if (frmSearch.ShowDialog() == DialogResult.OK)
            {
                txtTenKH.Text   = frmSearch.GetTenKhachHang;
                txtNoiDung.Text = frmSearch.GetNoiDung;
            }
        }
예제 #2
0
        private void uiCommandBar2_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
        {
            if (e.Command.Key == "cmdThemCuocGoi")
            {
                frmChenCuocGoi frmChenCuocGoi = new frmChenCuocGoi();
                DialogResult   dialogResult   = frmChenCuocGoi.ShowDialog(this);
                if (dialogResult == DialogResult.OK)
                {
                    LoadPhanAnh_ChuaGiaiQuyet(grdGiaiQuyetPA.Row);

                    new Taxi.MessageBox.MessageBox().Show("Chèn thêm cuộc gọi thành công");
                    frmChenCuocGoi.Close();
                }
            }
            else if (e.Command.Key == "cmdTinhTien")
            {
                new frmTinhTienTheoKmCP().ShowDialog();
            }
            else if (e.Command.Key == "cmdTongDai1080")
            {
                new frmDMDiaDanh().ShowDialog();
            }
            else if (e.Command.Key == "cmdVeHuy")
            {
                new frmTraCuu().ShowDialog();
            }
            else if (e.Command.Key == "cmdXuatExcel")
            {
                XuatExcel();
            }
            else if (e.Command.Key == "cmdNhapTuExcel")
            {
                new frmNhapTuExcel().ShowDialog();
            }
            else if (e.Command.Key == "cmdTimKiem")
            {
                if (tabGoiLaiGoiKhac.SelectedIndex == 0)
                {
                    trangThai = false;
                    chuyenDV  = false;
                }
                else if (tabGoiLaiGoiKhac.SelectedIndex == 1)
                {
                    trangThai = false;
                    chuyenDV  = true;
                }
                else if (tabGoiLaiGoiKhac.SelectedIndex == 2)
                {
                    trangThai = true;
                    chuyenDV  = false;
                }
                frmSearch = new frmTimKiem(trangThai, chuyenDV);
                frmSearch.TimKiemThanhCongClick += new frmTimKiem.TimKiemThanhCongEvent(frmSearch_TimKiemThanhCongClick);
                DialogResult diaLog = frmSearch.ShowDialog();

                if (diaLog == DialogResult.OK)
                {
                    List <ThongTinPhanAnh> lstThongTinPA = new List <ThongTinPhanAnh>();
                    lstThongTinPA = frmSearch.GetPhanAnh;

                    if (lstThongTinPA == null || lstThongTinPA.Count <= 0)
                    {
                        new Taxi.MessageBox.MessageBox().Show("Không tìm thấy dữ liệu");

                        BaoCuocGoiMoi.Enabled = true;
                    }
                    else
                    {
                        BaoCuocGoiMoi.Enabled = false;
                        if (trangThai == false && chuyenDV == false)
                        {
                            grdGiaiQuyetPA.DataMember = "listPhanAnh";
                            grdGiaiQuyetPA.SetDataBinding(lstThongTinPA, "listPhanAnh");
                            //grdGiaiQuyetPA.Focus();
                            frmSearch.Focus();
                        }
                        else if (trangThai == false && chuyenDV == true)
                        {
                            grdChuyenDV.DataMember = "listPhanAnh";
                            grdChuyenDV.SetDataBinding(lstThongTinPA, "listPhanAnh");
                            //grdChuyenDV.Focus();
                        }
                        else if (trangThai == true && chuyenDV == false)
                        {
                            grdDaGiaiQuyetPA.DataMember = "listPhanAnh";
                            grdDaGiaiQuyetPA.SetDataBinding(lstThongTinPA, "listPhanAnh");
                            //grdDaGiaiQuyetPA.Focus();
                        }
                        //frmSearch.Show();
                    }
                }
                else if (diaLog == DialogResult.Cancel)
                {
                    BaoCuocGoiMoi.Enabled = true;
                }
            }
        }