private void btnExportDetail_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (selection.SelectedCount == 0)
            {
                MessageBox.Show("请先选择需要导出明细的记录");
            }
            else
            {
                string strJTDID = null;
                for (int i = 0; i < selection.SelectedCount; ++i)
                {
                    int RowIndex = selection.GetSelectedRowIndex(i);
                    int RowHandle = gridView1.GetRowHandle(RowIndex);

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colJTDID);
                    strJTDID += "[JTDID] = \'" + strTemp + "\' Or ";
                }

                int index = strJTDID.LastIndexOf("'");
                strJTDID = strJTDID.Substring(0, index + 1).Trim();

                FrmPurchaseReturnDetailBranch FrmPRD = new FrmPurchaseReturnDetailBranch(m_fgBranch, strJTDID);
                FrmPRD.btnExportGrid_ItemClick(sender, e);
            }
        }
        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            FormCollection fc = Application.OpenForms;
            GridView view = (GridView)sender;
            GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Control.MousePosition));
            if (hitInfo.HitTest == GridHitTest.RowCell)
            {
                if ((hitInfo.Column != null) && (hitInfo.Column == colJTDH))
                {
                    string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colJTDID);
                    string strJTDID = "[JTDID] = \'" + strTemp + "\'";
                    if (fc["FrmPurchaseReturnDetailBranch"] != null)
                    {
                        fc["FrmPurchaseReturnDetailBranch"].Close();
                    }
                    FrmPurchaseReturnDetailBranch FrmPRD = new FrmPurchaseReturnDetailBranch(m_fgBranch, strJTDID);
                    FrmPRD.Show();
                    FrmPRD.Activate();
                }
                //else if ((hitInfo.Column != null) && (hitInfo.Column == colSHHZDH))
                //{
                //    string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colSHHZDID);
                //    string strSHHZDH = view.GetRowCellDisplayText(hitInfo.RowHandle, colSHHZDH);
                //    if (!String.IsNullOrEmpty(strSHHZDH))
                //    {
                //        string strSHHZDID = "[SHHZDID] = \'" + strTemp + "\'";
                //        if (FrmLogin.getZTID == "2314" || FrmLogin.getZTID == "2312" || FrmLogin.getZTID == "306")
                //        {
                //            if (fc["FrmPurchaseReceiveTotal"] != null)
                //            {
                //                fc["FrmPurchaseReceiveTotal"].Close();
                //            }
                //            FrmPurchaseReceiveTotal FrmPRT = new FrmPurchaseReceiveTotal(m_fgBranch, strSHHZDID);
                //            FrmPRT.Show();
                //            FrmPRT.Activate();
                //        }
                //        else
                //        {
                //            if (fc["FrmPurchaseReceiveTotalBranch"] != null)
                //            {
                //                fc["FrmPurchaseReceiveTotalBranch"].Close();
                //            }
                //            FrmPurchaseReceiveTotalBranch FrmPRTB = new FrmPurchaseReceiveTotalBranch(m_fgBranch, strSHHZDID);
                //            FrmPRTB.Show();
                //            FrmPRTB.Activate();
                //        }
                //    }
                //}
                //else if ((hitInfo.Column != null) && (hitInfo.Column == colSHPZDH))
                //{
                //    string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colSHPZID);
                //    string strSHPZDH = view.GetRowCellDisplayText(hitInfo.RowHandle, colSHPZDH);
                //    if (!String.IsNullOrEmpty(strSHPZDH))
                //    {
                //        string strSHPZID = "[VOUCHERID] = \'" + strTemp + "\'";
                //        //if (fc["FrmPurchaseReceiveTotal"] != null)
                //        //{
                //        //    fc["FrmPurchaseReceiveTotal"].Close();
                //        //}
                //        //FrmPurchaseReceiveTotal FrmPRT = new FrmPurchaseReceiveTotal(strSHHZDID);
                //        //FrmPRT.Show();
                //        //FrmPRT.Activate();
                //    }
                //}

            }
        }
        private void btnDetailQuery_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (selection.SelectedCount == 0)
            {
                const string message = "没有勾选主单进行的详单查询时间会比较久(3分钟左右),继续么?";
                const string caption = "详单查询?";
                var result = MessageBox.Show(message, caption,
                                             MessageBoxButtons.YesNo,
                                             MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                {
                    FrmPurchaseReturnDetailBranch FrmPRD = new FrmPurchaseReturnDetailBranch(m_fgBranch);
                    FrmPRD.Show();
                    FrmPRD.Activate();
                }

            }
            else
            {
                string strJTDID = null;
                for (int i = 0; i < selection.SelectedCount; ++i)
                {
                    int RowIndex = selection.GetSelectedRowIndex(i);
                    int RowHandle = gridView1.GetRowHandle(RowIndex);

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colJTDID);
                    strJTDID += "[JTDID] = \'" + strTemp + "\' Or ";
                }

                int index = strJTDID.LastIndexOf("'");
                strJTDID = strJTDID.Substring(0, index + 1).Trim();

                FrmPurchaseReturnDetailBranch FrmPRD = new FrmPurchaseReturnDetailBranch(m_fgBranch, strJTDID);
                FrmPRD.Show();
                FrmPRD.Activate();
            }
        }