private void Search()
        {
            frmDoiTacTimKiem frm = new frmDoiTacTimKiem();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                _listDoiTac = frm.GetResultListOfDoiTac();
                if (_listDoiTac.Count > 0)
                {
                    GridControl_DoiTac.DataSource = _listDoiTac;
                }
                else
                {
                    new MessageBox.MessageBoxBA().Show("Không tìm thấy kết quả nào");
                }
            }
        }
예제 #2
0
        private void mnuTimKiem_Click(object sender, EventArgs e)
        {
            frmDoiTacTimKiem frm = new frmDoiTacTimKiem();

            if (frm.ShowDialog(this) == DialogResult.OK)
            {
                if (frm.GetResultListOfDoiTac().Count > 0)
                {
                    grdDoiTac.DataSource = null;
                    grdDoiTac.DataMember = "ListOfDoiTac";
                    grdDoiTac.SetDataBinding(frm.GetResultListOfDoiTac(), "ListOfDoiTac");
                }
                else
                {
                    new MessageBox.MessageBox().Show("Không tìm thấy kết quả nào");
                    return;
                }
            }
        }
        private void cmdAdd_CommandClick(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e)
        {
            //cmdNew cmdEdit cmdDelete cmdExit cmdHelp
            if (e.Command.Key == "cmdNew")
            {
                this.ThemDoiTac();
            }
            else if (e.Command.Key == "cmdEdit")
            {
                this.SuaDoiTac();
            }
            else if (e.Command.Key == "cmdDelete")
            {
                DeleteDoiTac();
            }
            else if (e.Command.Key == "cmdActive")
            {
                this.ActiveDoiTac(true);
            }
            else if (e.Command.Key == "cmdUnActive")
            {
                this.ActiveDoiTac(false);
            }
            else if (e.Command.Key == "cmdExit")
            {
                this.Close();
                this.Dispose();
            }
            else if (e.Command.Key == "cmdHelp")
            {
                frmDoiTacTimKiem frm = new frmDoiTacTimKiem();
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    ListDoiTac = frm.GetResultListOfDoiTac();
                    if (ListDoiTac.Count > 0)
                    {
                        grdDoiTac.DataSource = null;
                        grdDoiTac.DataMember = "ListOfDoiTac";
                        grdDoiTac.SetDataBinding(ListDoiTac, "ListOfDoiTac");

                        gridExport.DataSource = null;
                        gridExport.DataMember = "ListOfDoiTacEx";
                        gridExport.SetDataBinding(ListDoiTac, "ListOfDoiTacEx");
                    }
                    else
                    {
                        new MessageBox.MessageBoxBA().Show("Không tìm thấy kết quả nào");
                        return;
                    }
                }
            }
            else if (e.Command.Key == "cmdCapNhatMoiGioi")
            {
                frmCapNhatThongTinMoiGioi frm = new frmCapNhatThongTinMoiGioi();
                frm.ShowDialog();
                // // Create a background thread
                //bw  = new BackgroundWorker();
                // bw.DoWork += new DoWorkEventHandler(bw_DoWorkNew);
                // bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bw_RunWorkerCompleted);

                // // Create a progress form on the UI thread
                // m_fmProgress = null;
                // m_fmProgress = new fmProgress();

                // // Kick off the Async thread
                // bw.RunWorkerAsync();

                // // Lock up the UI with this modal progress form.
                // try
                // {

                //     m_fmProgress.ShowDialog(this);
                //     m_fmProgress = null;

                // }
                // catch (Exception ex)
                // {

                // }
            }
            else if (e.Command.Key == "cmdKiemTraTrung")
            {
                frmKiemTraTrungSoDoiTac frm = new frmKiemTraTrungSoDoiTac();
                frm.Show();
            }
            else if (e.Command.Key == "cmdExcel")
            {
                this.XuatExcel();
            }
        }