Exemplo n.º 1
0
        //-----------------------------------------------//
        //      Property
        //-----------------------------------------------//

        //-----------------------------------------------//
        //      Method
        //-----------------------------------------------//
        private void FormCostDetail_Load(object sender, EventArgs e)
        {
            // DataGridViewの列タイトル設定
            UiHandling ui = new UiHandling(dataGridView1);

            ui.DgvColumnName(2, cif.EditColumnNameArray(cif.Class0, cif.Class1));
            ui.DgvColumnHeader(2, cif.EditColumnHeaderArray(cif.Class0, cif.Class1));

            //原価計上日
            labelFrom.Text = cif.DateSOP.ToString("yyyy/MM/dd");
            labelTo.Text   = cif.DateEOP.ToString("yyyy/MM/dd");

            //明細表
            labelType.Text = cif.ClassificationItem;

            //出力範囲
            labelRange.Text = cif.OutputRange;

            labelOffice.Text = cif.Office;

            // データ読み込み
            string strSql = " D_CR.ReportDate AS ReportDate, D_CR.SlipNo AS SlipNo, D_CR.TaskCode AS TaskCode, SUBSTRING(D_CR.TaskCode, 2, 6) AS TaskBaseCode, D_CR.ItemCode AS ItemCode, D_CR.Quantity AS Quantity,"
                            + " D_CR.Unit AS Unit, D_CR.UnitPrice AS UnitPrice, D_CR.Cost AS Cost ,D_T.PartnerCode AS CustoCode, "
                            + " CASE WHEN LEN(ISNULL(D_CR.LeaderMCode, '')) < 3 THEN RIGHT('00' + RTRIM(ISNULL(D_CR.LeaderMCode, '')), 3) ELSE ISNULL(D_CR.LeaderMCode, '') END AS LeaderMCode, "
                            + " CASE WHEN LEN(ISNULL(D_CR.SalesMCode, '')) < 3 THEN RIGHT('00' + RTRIM(ISNULL(D_CR.SalesMCode, '')), 3) ELSE ISNULL(D_CR.SalesMCode, '') END AS SalesMCode, "
                            //+ " M_C.CostCode AS CostCode, M_C.Item AS Item FROM D_CostReport AS D_CR "
                            + " M_C.CostCode AS CostCode, D_CR.Item AS Item FROM D_CostReport AS D_CR "
                            + " LEFT JOIN M_Cost AS M_C ON D_CR.ItemCode = M_C.CostCode AND D_CR.OfficeCode = M_C.OfficeCode "
                            + " LEFT JOIN D_Task AS D_T ON D_T.TaskBaseCode = SUBSTRING(D_CR.TaskCode, 2, 6) ";

            strSql = strSql + cif.WherePhraseDate;
            displayDetailInformation(dataGridView1, strSql);
        }