private void toolStripLabelPrint_Click(object sender, EventArgs e)
        {
            if (DgvHead.Rows.Count <= 0) return;
            if (DgvHead.SelectedRows.Count != 1) return;

            string TransferMoneyNo = DgvHead.SelectedRows[0].Cells["TransferMoneyNo"].Value.ToString();

            string sql = "SELECT *                                                                                       \n" +
                        "FROM ProductionTransferMoneyHead pth                                                            \n" +
                        "INNER JOIN ProductionTransferMoneyDetail ptd ON pth.TransferMoneyNo = ptd.TransferMoneyNo       \n" +
                        "INNER JOIN EMPLOYER e ON pth.EmployerId = e.EmployerId                                          \n" +
                        "INNER JOIN ProductionPrisonWage ppw ON ptd.PwId = ppw.PwId                                      \n" +
                        "INNER JOIN UserLogin u ON pth.UserName = u.UserName where pth.TransferMoneyNo = '" + TransferMoneyNo + "'";

            DataTable data = Class.DBConnString.clsDB.QueryDataTable(sql);
            data.TableName = "TransferMoneyToJ";

            Report.Production.CtrTransferMoneyJ j = new Report.Production.CtrTransferMoneyJ();
            j.SetDataSource(data);
            j.SetParameterValue("Company", Class.DBConnString.sDb);

            RptProductionReq CtrV = new RptProductionReq(j);
            CtrV.StartPosition = FormStartPosition.CenterParent;
            CtrV.ShowDialog();
        }
Exemplo n.º 2
0
        private void showReport(string strTranfNo)
        {
            string sql = "SELECT *                                                                                       \n" +
                        "FROM ProductionTransferMoneyHead pth                                                            \n" +
                        "INNER JOIN ProductionTransferMoneyDetail ptd ON pth.TransferMoneyNo = ptd.TransferMoneyNo       \n" +
                        "INNER JOIN EMPLOYER e ON pth.EmployerId = e.EmployerId                                          \n" +
                        "INNER JOIN ProductionPrisonWage ppw ON ptd.PwId = ppw.PwId                                      \n" +
                        "INNER JOIN UserLogin u ON pth.UserName = u.UserName where pth.TransferMoneyNo = '" + strTranfNo + "'";

            DataTable data = Class.DBConnString.clsDB.QueryDataTable(sql);
            data.TableName = "TransferMoneyToJ";

            Report.Production.CtrTransferMoneyJ j = new Report.Production.CtrTransferMoneyJ();
            j.SetDataSource(data);
            j.SetParameterValue("Company", DBConnString.sDb);

            RptProductionReq CtrV = new RptProductionReq(j);
            CtrV.StartPosition = FormStartPosition.CenterParent;
            CtrV.ShowDialog();
        }