Example #1
0
        public void InitRowsWithTaisyakuKamoku(models.db.mtables.MTKamoku table, models.db.mtables.MTDaikubun daikubun, string orderBy = "kamoku_code")
        {
            this.ClearRows();
            this.InitColumns(4, 3, 0);
            this.SetColumnVisibility(3, false);

            foreach (var row in table.Select("order by " + orderBy))
            {
                string daikubunStr = "";

                var daikubunRow = daikubun.Select("where id = " + row.GetLong("daikubun_id", -1));
                if (daikubunRow.Count() > 0)
                {
                    daikubunStr = daikubunRow.First().GetStr("daikubun");
                    string daikubunCode = daikubunRow.First().GetStr("daikubun_code");
                    if (int.Parse(daikubunCode) == (int)models.constants.MTDaikubunCode.JikiKurikoshikatsudouSyuushiSagaku)
                    {
                        continue;
                    }
                    if (daikubunRow.First().GetLong("taisyaku_taisyou_id", 0) <= 0)
                    {
                        continue;
                    }
                }
                this.AddRow(row.GetStr("kamoku_code", "00000"), daikubunStr, row.GetStr("kamoku", ""), row.GetLong("id", 0));
            }
            this.AdjustDropDownWidth();
            bindedTable = table;
        }
Example #2
0
        public void InitRowsWithShisanKamoku(models.db.mtables.MTKamoku table, models.db.mtables.MTDaikubun daikubun)
        {
            this.ClearRows();
            this.InitColumns(3, 2, 0);
            this.SetColumnVisibility(2, false);

            foreach (var row in table.Select("where shiyou_kubun = 0 order by daikubun_id, kamoku_yomi"))
            {
                models.db.Row daikubunRow = daikubun.GetRowFromCache((int)row.GetLong("daikubun_id", -1));
                if (daikubunRow == null)
                {
                    continue;
                }
                int taisyakuId = (int)daikubunRow.GetLong("taisyaku_taisyou_id", -1);
                if (taisyakuId != 1)
                {
                    continue;
                }
                if (table.IsRyuudouShisanKamoku((int)row.GetLong("id", -1)))
                {
                    continue;
                }
                this.AddRow(row.GetStr("kamoku", ""), daikubunRow.GetStr("daikubun"), row.GetLong("id", 0));
            }
            this.AdjustDropDownWidth();
            bindedTable = table;
        }
Example #3
0
 // 科目 (ID, 名称)
 public void InitRowsWithMTKamokuReverse(models.db.mtables.MTKamoku table, string orderBy = "kamoku_code")
 {
     this.ClearRows();
     this.InitColumns(2, 0, 0);
     foreach (var row in table.Select("order by " + orderBy))
     {
         this.AddRow(row.GetStr("kamoku_code", "00000"), row.GetStr("kamoku", ""));
     }
     this.AdjustDropDownWidth();
     bindedTable = table;
 }
Example #4
0
 public void InitRowsWithMTKamokuUsableOnly(models.db.mtables.MTKamoku table, string orderBy = "kamoku_code")
 {
     this.ClearRows();
     this.InitColumns(2, 1, 0);
     this.SetColumnVisibility(1, false);
     foreach (var row in table.Select("where shiyou_kubun = 0 order by " + orderBy))
     {
         this.AddRow(row.GetStr("kamoku", ""), row.GetLong("id", 0));
     }
     this.AdjustDropDownWidth();
     bindedTable = table;
 }
Example #5
0
        public void InitRowsWithMTKamokuFilterByMTDaikubun2(models.db.mtables.MTKamoku table, models.db.mtables.MTDaikubun daikubun, int daikubunId, string orderBy = "kamoku_code")
        {
            this.ClearRows();
            this.InitColumns(3, 2, 1);
            this.SetColumnVisibility(0, false);
            this.SetColumnVisibility(2, false);

            foreach (var row in table.Select("where daikubun_id = " + daikubunId + " order by " + orderBy))
            {
                this.AddRow(row.GetStr("kamoku_code", "00000"), row.GetStr("kamoku", ""), row.GetLong("id", 0));
            }
            this.AdjustDropDownWidth();
            bindedTable = table;
        }
Example #6
0
        public void InitRowsWithMTKamokuFilterByMTDaikubun(models.db.mtables.MTKamoku table, models.db.mtables.MTDaikubun daikubun, int daikubunCode, string orderBy = "kamoku_code")
        {
            this.ClearRows();
            this.InitColumns(4, 3, 0);
            this.SetColumnVisibility(3, false);

            string daikubunStr = "";
            int    daikubunId  = 0;
            var    daikubunRow = daikubun.Select("where daikubun_code = '" + daikubunCode + "'");

            if (daikubunRow.Count() > 0)
            {
                daikubunStr = daikubunRow.First().GetStr("daikubun");
                daikubunId  = (int)daikubunRow.First().GetLong("id", 0);
            }

            foreach (var row in table.Select("where daikubun_id = " + daikubunId + " order by " + orderBy))
            {
                this.AddRow(row.GetStr("kamoku_code", "00000"), daikubunStr, row.GetStr("kamoku", ""), row.GetLong("id", 0));
            }
            this.AdjustDropDownWidth();
            bindedTable = table;
        }