Esempio n. 1
0
        private void SummarizeMeisaiTable()
        {
            string orderStr = "order by display_order";

            foreach (models.db.Row kubunRow in db.MTKamokuKubun.SelectChildren((int)models.constants.MTKamokuKubun.TaisyakuRoot, order: orderStr))
            {
                foreach (models.db.Row daikubunRow in db.MTKamokuKubun.SelectChildren(kubunRow.GetId(), order: orderStr))
                {
                    if (daikubunRow.GetId() == (int)models.constants.MTKamokuKubun.JikiKurikoshikatsudouZougenSagakuDaikubun)
                    {
                        continue;
                    }

                    foreach (models.db.Row kamokuRow in db.MTKamokuKubun.SelectChildren(daikubunRow.GetId(), order: orderStr))
                    {
                        if (HideInnerKaikeiKubunKamoku && db.MTKamokuKubun.IsInnerKaikeiKubunKamoku(KaikeiKubunHierarchy, kamokuRow))
                        {
                            continue;
                        }

                        BalanceSheetRow balanceSheetRow = new BalanceSheetRow(kamokuRow.GetId(), daikubunRow.GetId(), kubunRow.GetId());
                        balanceSheetRow.CurrentSumAmount = kamokuKubunSummary.SummaryItem(kamokuRow.GetId()).GetTaisyaku(db);
                        balanceSheetRow.LastSumAmount    = 0;
                        kamokuKubunId2BalanceSheetRow.Add(kamokuRow.GetId(), balanceSheetRow);
                    }
                }
            }
        }
Esempio n. 2
0
        private List <JigyouSyuushiRow> SummarizeMeisaiTableSub(JigyouSyuushiRow parentJigyouSyuushiRow, int kamokuKubunHierarchy, string orderStr)
        {
            var list = new List <JigyouSyuushiRow>();

            foreach (models.db.Row row in db.MTKamokuKubun.SelectChildren(parentJigyouSyuushiRow.Id, order: orderStr))
            {
                if (HideInnerKaikeiKubunKamoku && db.MTKamokuKubun.IsInnerKaikeiKubunKamoku(KaikeiKubunHierarchy, row))
                {
                    continue;
                }
                JigyouSyuushiRow jigyouSyuushiRow = new JigyouSyuushiRow(row.GetId(), kamokuKubunHierarchy);
                jigyouSyuushiRow.CurrentYearSum = currentKamokuKubunSummary.SummaryItem(row.GetId()).GetTaisyaku(db);
                jigyouSyuushiRow.LastYearSum    = lastKamokuKubunSummary.SummaryItem(row.GetId()).GetTaisyaku(db);

                if (db.MTKamokuKubun.IsInnerKaikeiKubunKamoku(KaikeiKubunHierarchy - 1, row))
                {
                    jigyouSyuushiRow.NaibuTorihikiSyoukyoGaku = jigyouSyuushiRow.CurrentYearSum;
                }

                bool hasChild = false;
                if ((int)TargetKamokuKubunHierarchy > kamokuKubunHierarchy)
                {
                    var childList = SummarizeMeisaiTableSub(jigyouSyuushiRow, kamokuKubunHierarchy + 1, orderStr);
                    if (childList != null)
                    {
                        ChildRowsOf.Add(jigyouSyuushiRow.Id, childList);
                        hasChild = true;
                    }
                }

                if (OmitZeroRow == false || hasChild || jigyouSyuushiRow.CurrentYearSum != 0 || jigyouSyuushiRow.LastYearSum != 0)
                {
                    list.Add(jigyouSyuushiRow);
                }
                else if (OmitZeroRow == true)
                {
                    list.Add(jigyouSyuushiRow);
                }

                if (kamokuKubunHierarchy == (int)models.constants.MTKamokuKubunHierarchy.ChuuKubun)
                {
                    parentJigyouSyuushiRow.Add(jigyouSyuushiRow);
                }
            }

            if (list.Count > 0)
            {
                return(list);
            }
            return(null);
        }
Esempio n. 3
0
        private List <ShikinSyuushiRow> SummarizeMeisaiTableSub(ShikinSyuushiRow parentShikinSyuushiRow, int kamokuKubunHierarchy, string orderStr)
        {
            var list = new List <ShikinSyuushiRow>();

            foreach (models.db.Row row in db.MTKamokuKubun.SelectChildren(parentShikinSyuushiRow.Id, order: orderStr))
            {
                if (HideInnerKaikeiKubunKamoku && db.MTKamokuKubun.IsInnerKaikeiKubunKamoku(KaikeiKubunHierarchy, row))
                {
                    continue;
                }
                ShikinSyuushiRow shikinSyuushiRow = new ShikinSyuushiRow(row.GetId(), kamokuKubunHierarchy);
                shikinSyuushiRow.Yosan    = yosanTable.GetYosanRow(KaikeiKubun, row.GetId()).YosanHonnenDisplay;
                shikinSyuushiRow.Taisyaku = kamokuKubunSummary.SummaryItem(row.GetId()).GetTaisyaku(db);

                if (db.MTKamokuKubun.IsInnerKaikeiKubunKamoku(KaikeiKubunHierarchy - 1, row))
                {
                    shikinSyuushiRow.NaibuTorihikiSyoukyoGaku = shikinSyuushiRow.Taisyaku;
                }

                bool hasChild = false;
                if ((int)TargetKamokuKubunHierarchy > kamokuKubunHierarchy)
                {
                    var childList = SummarizeMeisaiTableSub(shikinSyuushiRow, kamokuKubunHierarchy + 1, orderStr);
                    if (childList != null)
                    {
                        ChildRowsOf.Add(shikinSyuushiRow.Id, childList);
                        hasChild = true;
                    }
                }
                if (OmitZeroRow == false || hasChild || shikinSyuushiRow.Yosan != 0 || shikinSyuushiRow.Taisyaku != 0)
                {
                    list.Add(shikinSyuushiRow);
                }
                else if (OmitZeroRow == true)
                {
                    list.Add(shikinSyuushiRow);
                }

                if (kamokuKubunHierarchy == (int)models.constants.MTKamokuKubunHierarchy.ChuuKubun)
                {
                    parentShikinSyuushiRow.Add(shikinSyuushiRow);
                }
            }

            if (list.Count > 0)
            {
                return(list);
            }
            return(null);
        }