Пример #1
0
        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)
                {
                    FrmClientAccountDetailBranch FrmCADB = new FrmClientAccountDetailBranch();
                    FrmCADB.Show();
                    FrmCADB.Activate();
                }

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

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colZTBMKHSPTZID);
                    strZTBMKHSPTZID += "[ZTBMKHSPTZID] = \'" + strTemp + "\' Or ";
                }

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

                FrmClientAccountDetailBranch FrmCADB = new FrmClientAccountDetailBranch(strZTBMKHSPTZID);
                FrmCADB.Show();
                FrmCADB.Activate();
            }
        }
Пример #2
0
 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 == colYWBMMC))
         {
             string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colZTBMKHSPTZID);
             string strZTBMKHSPTZID = "[ZTBMKHSPTZID] = \'" + strTemp + "\'";
             if (fc["FrmClientAccountDetailBranch"] != null)
             {
                 fc["FrmClientAccountDetailBranch"].Close();
             }
             FrmClientAccountDetailBranch FrmCADB = new FrmClientAccountDetailBranch(strZTBMKHSPTZID);
             FrmCADB.Show();
             FrmCADB.Activate();
         }
     }
 }