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

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colCGSHID);
                    strCGSHID += "[CGSHID] = \'" + strTemp + "\' Or ";
                }

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

                FrmPurchaseReceiveDetail FrmPRD = new FrmPurchaseReceiveDetail(m_fgBranch, strCGSHID);
                FrmPRD.btnExportGrid_ItemClick(sender, e);
            }
        }
Ejemplo n.º 2
0
        private void gridView1_DoubleClick(object sender, EventArgs e)
        {
            GridView view = (GridView)sender;
            GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Control.MousePosition));

            FormCollection fc = Application.OpenForms;

            if (hitInfo.HitTest == GridHitTest.RowCell)
            {
                if ((hitInfo.Column != null) && (hitInfo.Column == colCGSHDH))
                {
                    string strTemp = view.GetRowCellDisplayText(hitInfo.RowHandle, colCGSHID);
                    string strCGSHID = "[CGSHID] = \'" + strTemp + "\'";
                    if (fc["FrmPurchaseReceiveDetail"] != null)
                    {
                        fc["FrmPurchaseReceiveDetail"].Close();
                    }
                    FrmPurchaseReceiveDetail FrmPRD = new FrmPurchaseReceiveDetail(m_fgBranch, strCGSHID);
                    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["FrmPurchaseReveiveVoucherNote"] != null)
                        {
                            fc["FrmPurchaseReveiveVoucherNote"].Close();
                        }
                        FrmPurchaseReveiveVoucherNote FrmPRVN = new FrmPurchaseReveiveVoucherNote(strSHPZID);
                        FrmPRVN.Show();
                        FrmPRVN.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)
                {
                    FrmPurchaseReceiveDetail FrmPRD = new FrmPurchaseReceiveDetail(m_fgBranch);
                    FrmPRD.Show();
                    FrmPRD.Activate();
                }

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

                    string strTemp = gridView1.GetRowCellDisplayText(RowHandle, colCGSHID);
                    strCGSHID += "[CGSHID] = \'" + strTemp + "\' Or ";
                }

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

                FrmPurchaseReceiveDetail FrmPRD = new FrmPurchaseReceiveDetail(m_fgBranch, strCGSHID);
                FrmPRD.Show();
                FrmPRD.Activate();
            }
        }