private void SearchByMisc()
        {
            string strKeyWord = "", strFrom = "", strTo = "";
            bool flag = false;
            Messages oErrMsg = Messages.Instance;
            CallerAssistant oCallerAssistant = new CallerAssistant();

            if (!Utils.PingTest())
            {
                if (this.InvokeRequired)
                {
                    this.Invoke(new MethodInvoker(delegate
                    {
                        //this.Cursor = Cursors.Default;
                        MessageBox.Show("VPN disconnected. Please connect and try again.", "CSRAssistance");
                        return;
                    }));
                }
                else
                {
                    //this.Cursor = Cursors.Default;
                    MessageBox.Show("VPN disconnected. Please connect and try again.", "CSRAssistance");
                    return;
                }
            }

            if (this.InvokeRequired)
            {

                this.Invoke(new MethodInvoker(delegate
                {
                    //this.Cursor = Cursors.WaitCursor;
                    btnGo.Enabled = false;
                    btnFillJobs.Enabled = false;

                    if (rdAllDebtorJobs.Checked)
                    {
                        strKeyWord = "ALL DEBTOR JOBS";
                        flag = true;
                    }

                    if (!flag)
                    {
                        if (rdCallBack.Checked)
                        {
                            strKeyWord = "ONLY CALL BACK JOBS";
                            flag = true;
                        }
                    }

                    if (!flag)
                    {
                        if (rdAllDoneShip.Checked)
                        {
                            strKeyWord = "ALL DONE AND SHIPPED JOBS";
                            flag = true;
                        }
                    }

                    if (!flag)
                    {
                        if (rdCallNotDone.Checked)
                        {
                            strKeyWord = "ALL CALL NOT DONE JOBS";
                            flag = true;
                        }
                    }

                    if (!flag)
                    {
                        if (rdAllEscalated.Checked)
                        {
                            strKeyWord = "ALL ESCALATED JOBS";
                            flag = true;
                        }
                    }

                    if (!flag)
                    {
                        if (rdFrom.Checked)
                        {
                            strKeyWord = "FROM";
                            strFrom = dtpkFrom.Value.ToString("yyyyMMdd");
                            strTo = dtpkTo.Value.AddDays(1).ToString("yyyyMMdd");
                            flag = true;
                        }
                        else
                        {
                            strKeyWord = "";
                            strFrom = dtpkJobDate.Value.ToString("yyyyMMdd");
                            strTo = dtpkJobDate.Value.AddDays(1).ToString("yyyyMMdd");
                        }
                    }
                }));
            }
            else
            {
                btnFillJobs.Enabled = false;
                btnGo.Enabled = false;
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate
                {
                    oErrMsg = oCallerAssistant.LoadData(strKeyWord, strFrom, strTo, 0);
                    if (!oErrMsg.IsError)
                    {
                        dgList.DataSource = ((DataSet) oErrMsg.Results).Tables[0];
                        this.wfrm.Hide();
                        btnGo.Enabled = true;
                        btnFillJobs.Enabled = true;
                    }
                    else
                    {
                        this.wfrm.Hide();
                        btnGo.Enabled = true;
                        btnFillJobs.Enabled = true;
                        MessageBox.Show(oErrMsg.Message);
                    }
                }));
            }
        }
        private void SearchByID()
        {
            Messages oErrMsg = Messages.Instance;
            CallerAssistant oCallerAssistant = new CallerAssistant();

            if (this.InvokeRequired)
            {

                this.Invoke(new MethodInvoker(delegate
                {
                    //this.Cursor = Cursors.WaitCursor;
                    btnGo.Enabled = false;
                    btnFillJobs.Enabled = false;
                }));
            }
            else
            {
                btnFillJobs.Enabled = false;
                btnGo.Enabled = false;
            }

            if (!Utils.PingTest())
            {
                if (this.InvokeRequired)
                {
                    this.Invoke(new MethodInvoker(delegate
                    {
                        //this.Cursor = Cursors.Default;
                        MessageBox.Show("VPN disconnected. Please connect and try again.", "CSRAssistance");
                        return;
                    }));
                }
                else
                {
                    //this.Cursor = Cursors.Default;
                    MessageBox.Show("VPN disconnected. Please connect and try again.", "CSRAssistance");
                    return;
                }
            }

            if (this.InvokeRequired)
            {
                this.Invoke(new MethodInvoker(delegate
                {
                    oErrMsg = oCallerAssistant.LoadData(txtJID.Text.Trim(), txtTrackNo.Text.Trim(), 1, 100, 0);
                    if (!oErrMsg.IsError)
                    {
                        dgList.DataSource = ((DataSet) oErrMsg.Results).Tables[0];
                        this.wfrm.Hide();
                        btnGo.Enabled = true;
                        btnFillJobs.Enabled = true;
                    }
                    else
                    {
                        this.wfrm.Hide();
                        btnGo.Enabled = true;
                        btnFillJobs.Enabled = true;
                        MessageBox.Show(oErrMsg.Message);
                    }
                }));
            }
        }