Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
 private void AddChildRowsTo(List <JigyouSyuushiRow> rows, int parentKubunId, int printGroupKubunId, int kamokuKubunHierarchy)
 {
     if (kamokuKubunHierarchy > (int)TargetKamokuKubunHierarchy)
     {
         return;
     }
     if (ChildRowsOf.ContainsKey(parentKubunId) == false)
     {
         return;
     }
     foreach (var row in ChildRowsOf[parentKubunId])
     {
         if (OmitZeroRow == false || row.CurrentYearSum != 0 || row.LastYearSum != 0)
         {
             row.PrintGroupKubunId = printGroupKubunId;
             rows.Add(row);
             AddChildRowsTo(rows, row.Id, printGroupKubunId, kamokuKubunHierarchy + 1);
         }
     }
 }