Exemplo n.º 1
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 == colXTDH))
                {
                    string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colXTDID);
                    string strXTDID = "[XTDID] = \'" + strTemp + "\'";
                    if (fc["FrmSaleReturnDetail"] != null)
                    {
                        fc["FrmSaleReturnDetail"].Close();
                    }
                    FrmSaleReturnDetail FrmSRD = new FrmSaleReturnDetail(m_fgBranch, strXTDID);
                    FrmSRD.Show();
                    FrmSRD.Activate();
                }
                else if ((hitInfo.Column != null) && (hitInfo.Column == colXSHZDH))
                {
                    string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colXSHZDID);
                    string strXSHZDH = view.GetRowCellDisplayText(hitInfo.RowHandle, colXSHZDH);
                    if (!String.IsNullOrEmpty(strXSHZDH))
                    {
                        string strXSHZDID = "[XSHZDID] = \'" + strTemp + "\'";
                        if (FrmLogin.getZTID == "2314" || FrmLogin.getZTID == "2312" || FrmLogin.getZTID == "306")
                        {
                            if (fc["FrmSaleTotal"] != null)
                            {
                                fc["FrmSaleTotal"].Close();
                            }
                            FrmSaleTotal FrmST = new FrmSaleTotal(m_fgBranch, strXSHZDID);
                            FrmST.Show();
                            FrmST.Activate();
                        }
                        else
                        {
                            if (fc["FrmSaleTotalBranch"] != null)
                            {
                                fc["FrmSaleTotalBranch"].Close();
                            }
                            FrmSaleTotalBranch FrmSTB = new FrmSaleTotalBranch(m_fgBranch, strXSHZDID);
                            FrmSTB.Show();
                            FrmSTB.Activate();
                        }
                    }
                }
                else if ((hitInfo.Column != null) && (hitInfo.Column == colFHPZH))
                {
                    string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colFHPZID);
                    string strFHPZH = view.GetRowCellDisplayText(hitInfo.RowHandle, colFHPZH);
                    if (!String.IsNullOrEmpty(strFHPZH))
                    {
                        string strFHPZID = "[VOUCHERID] = \'" + strTemp + "\'";
                        //if (fc["FrmPurchaseReceiveTotal"] != null)
                        //{
                        //    fc["FrmPurchaseReceiveTotal"].Close();
                        //}
                        //FrmPurchaseReceiveTotal FrmPRT = new FrmPurchaseReceiveTotal(strSHHZDID);
                        //FrmPRT.Show();
                        //FrmPRT.Activate();
                    }
                }

            }
        }
Exemplo n.º 2
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)
                {
                    FrmSaleReturnDetail FrmSRD = new FrmSaleReturnDetail(m_fgBranch);
                    FrmSRD.Show();
                    FrmSRD.Activate();
                }

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

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colXTDID);
                    strXTDID += "[XTDID] = \'" + strTemp + "\' Or ";
                }

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

                FrmSaleReturnDetail FrmSRD = new FrmSaleReturnDetail(m_fgBranch, strXTDID);
                FrmSRD.Show();
                FrmSRD.Activate();
            }
        }