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

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colDBDID);
                    strDBDID += "[DBDID] = \'" + strTemp + "\' Or ";
                }

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

                FrmAllocateDetail FrmAD = new FrmAllocateDetail(strDBDID);
                FrmAD.btnExportGrid_ItemClick(sender, e);
            }
        }
Ejemplo n.º 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 == colDBDH))
         {
             string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colDBDID);
             string strDBDID = "[DBDID] = \'" + strTemp + "\'";
             if (fc["FrmAllocateDetail"] != null)
             {
                 fc["FrmAllocateDetail"].Close();
             }
             FrmAllocateDetail FrmAD = new FrmAllocateDetail(strDBDID);
             FrmAD.Show();
             FrmAD.Activate();
         }
         else if ((hitInfo.Column != null) && (hitInfo.Column == colDBPZH))
         {
             string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colDBPZID);
             string strDBPZH = view.GetRowCellDisplayText(hitInfo.RowHandle, colDBPZH);
             if (!String.IsNullOrEmpty(strDBPZH))
             {
                 string strDBPZID = "[VOUCHERID] = \'" + strTemp + "\'";
                 //if (fc["FrmPurchaseReceiveTotal"] != null)
                 //{
                 //    fc["FrmPurchaseReceiveTotal"].Close();
                 //}
                 //FrmPurchaseReceiveTotal FrmPRT = new FrmPurchaseReceiveTotal(strSHHZDID);
                 //FrmPRT.Show();
                 //FrmPRT.Activate();
             }
         }
     }
 }
Ejemplo n.º 3
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)
                {
                    FrmAllocateDetail FrmAD = new FrmAllocateDetail();
                    FrmAD.Show();
                    FrmAD.Activate();
                }

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

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colDBDID);
                    strDBDID += "[DBDID] = \'" + strTemp + "\' Or ";
                }

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

                FrmAllocateDetail FrmAD = new FrmAllocateDetail(strDBDID);
                FrmAD.Show();
                FrmAD.Activate();
            }
        }