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 == colSYDH))
         {
             string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colSYDID);
             string strSYDID = "[SYDID] = \'" + strTemp + "\'";
             if (fc["FrmProfitLossDetail"] != null)
             {
                 fc["FrmProfitLossDetail"].Close();
             }
             FrmProfitLossDetail FrmPLD = new FrmProfitLossDetail(strSYDID);
             FrmPLD.Show();
             FrmPLD.Activate();
         }
         else if ((hitInfo.Column != null) && (hitInfo.Column == colPZH))
         {
             string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colPZID);
             string strPZH = view.GetRowCellDisplayText(hitInfo.RowHandle, colPZH);
             if (!String.IsNullOrEmpty(strPZH))
             {
                 string strPZID = "[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)
                {
                    FrmProfitLossDetail FrmPLD = new FrmProfitLossDetail();
                    FrmPLD.Show();
                    FrmPLD.Activate();
                }

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

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colSYDID);
                    strSYDID += "[SYDID] = \'" + strTemp + "\' Or ";
                }

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

                FrmProfitLossDetail FrmPLD = new FrmProfitLossDetail(strSYDID);
                FrmPLD.Show();
                FrmPLD.Activate();
            }
        }