Exemplo n.º 1
0
        public void Calc(int nenndo, int kaikeiKubun)
        {
            KaikeiKubun = kaikeiKubun == -1 ? db.MTKaikeiKubun.RootNodeId : kaikeiKubun;
            Nenndo      = nenndo;

            GenkaSyoukyakuRuikeiGaku = 0;
            TyousyuuHunouKin         = 0;
            Tyuuki2     = "";
            Tyuuki6     = "";
            Tyuuki1Rows = new List <BalanceSheetTyuuki1Row>();
            Tyuuki3Rows = new List <BalanceSheetTyuuki3Row>();
            Tyuuki4Rows = new List <BalanceSheetTyuuki4Row>();
            Tyuuki5Rows = new List <BalanceSheetTyuuki5Row>();

            models.db.Row row = db.TaisyakuTaisyouhyouTyuuki.GetFirstRow("where nenndo=" + Nenndo);

            if (row != null)
            {
                tyuukiId = row.GetId();
                Tyuuki2  = row.GetStr("juuyou_henkou");
                Tyuuki6  = row.GetStr("juuyou_kouhatsu");

                CalcKyakutyuu();
                CalcTyuuki1();
                CalcTyuuki3();
                CalcTyuuki4();
                CalcTyuuki5();
            }
        }
Exemplo n.º 2
0
 // Rowデータの設定
 override protected void SetRowDataSub(models.db.Row rowData)
 {
     cmbKaikeiKubun.SelectRowByKeyValue(rowData.GetLong("kaikei_kubun", -1));
     cmbKamoku.SelectRowByKeyValue(rowData.GetLong("kamoku_id", -1));
     txtTekiyou.Text     = rowData.GetStr("tekiyou");
     txtAmount.AmountStr = rowData.GetStr("amount");
     SetKamokuLabel();
 }
Exemplo n.º 3
0
            public KanjouKamokuListRow(models.db.Row daikubunRow, models.db.Row kamokuRow, models.db.KaikeiDatabase db)
            {
                models.db.Row kanjouRow = db.MTKanjouKamoku.GetFirstRow("where id=" + kamokuRow.GetStr("kanjou_kamoku_id"));

                DaikubunCode = daikubunRow.GetStr("name");
                DaikubunName = daikubunRow.GetStr("display_order");
                KamokuCode   = kanjouRow.GetStr("kamoku");
                KamokuName   = kanjouRow.GetStr("kamoku_code");
                Hierarchy    = (int)kanjouRow.GetLong("hierarchy", -1);
            }
Exemplo n.º 4
0
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row rowData)
        {
            int      year = (int)rowData.GetLong("nenndo", 0);
            DateTime date = new DateTime(year, 4, 1);

            lblYear.Text        = helper.Converter.DateTimeToWarekiGengouKanji(date) + helper.Converter.DateTimeToWarekiYear(date).ToString();
            lblKeiriKubun.Text  = rowData.GetMasterStr("kaikei_kubun", "name", "", db.MTKaikeiKubun);
            lblYosanKubun.Text  = rowData.GetMasterStr("yosan_kubun", "yosan_kubun", "", db.MTYosanKubun);
            lblHoseiKaisuu.Text = rowData.GetLong("hosei_kaisuu", -1).ToString();

            amountYosan.AmountStr        = rowData.GetStr("yobihi");
            amountZenkiZandaka.AmountStr = rowData.GetStr("zenkimatsu_shiharai_shikin_zandaka");
        }
Exemplo n.º 5
0
        protected void SetRowDataToLabelAsAmount(Label control, models.db.Row rowData)
        {
            int amount;

            if (int.TryParse(rowData.GetStr(control.Tag as string, ""), out amount) == true)
            {
                control.Text = helper.Converter.LongToAmount(amount);
            }
            else
            {
                control.Text = rowData.GetStr(control.Tag as string, "");
            }
        }
        private void AddKessanHoukokusyoHyoushi(DataDynamics.ActiveReports.ActiveReport parentReport)
        {
            int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId;

            models.db.Row rootRow      = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId);
            string        houjinMei    = rootRow.GetStr("name");
            string        yuubinBangou = rootRow.GetStr("yuubin_bangou");
            string        juusyo       = Context.KaikeiDatabase.MTKaikeiKubun.GetJuusyoStr(rootRow);

            var report = new views.reports.KessanHoukokusyoHyoushi();

            report.SetHeader(form.StartDate.Value, form.EndDate.Value, houjinMei, yuubinBangou, juusyo);
            report.Run();
            parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count));
        }
Exemplo n.º 7
0
        private void ReadTyuukiTanpo(int tyuukiId)
        {
            foreach (var row in db.Tyuuki8.Select("where tyuuki_id=" + tyuukiId))
            {
                string        name           = "";
                models.db.Row kamokuKubunRow = db.MTKamokuKubun.GetRowById((int)row.GetLong("kamoku_kubun_id", -1));
                if (kamokuKubunRow != null)
                {
                    name += kamokuKubunRow.GetStr("name");
                    models.db.Row parent = db.MTKamokuKubun.GetParentOf(kamokuKubunRow);
                    if (parent != null)
                    {
                        if (parent.GetId() == (int)models.constants.MTKamokuKubun.KoteiShisanKihonZaisan)
                        {
                            name += "(基本財産)";
                        }
                        if (parent.GetId() == (int)models.constants.MTKamokuKubun.KoteiShisanSonota)
                        {
                            name += "(その他の固定資産)";
                        }
                    }
                }

                TanpoRow tanpoRow = new TanpoRow((int)row.GetLong("tanpo_kubun_id", -1), name, row.GetLong("amount", 0));
                tanpoKubunRows.Add(tanpoRow);
            }
        }
        public void detail_Format(object sender, EventArgs e)
        {
            int kamokuKubunId = helper.Converter.ObjToInt(txtKamokuId.Text, -1);

            models.db.Row kamokuKubunRow = db.MTKamokuKubun.GetRowById(kamokuKubunId);
            if (kamokuKubunRow == null)
            {
                return;
            }
            int kanjouKamokuId = (int)kamokuKubunRow.GetLong("kanjou_kamoku_id", -1);

            models.db.Row kanjouKamokuRow = db.MTKanjouKamoku.GetRowById(kanjouKamokuId);

            txtKamokuCode.Text = kanjouKamokuRow.GetStr("kamoku_code");
            txtKamoku.Text     = kanjouKamokuRow.GetStr("kamoku");
        }
        private void ValidateKihyoubi(models.db.KaikeiDatabase db, models.db.Row row)
        {
            form_.HeaderKihyoubiGengouText = row.GetStr("kihyoubi_gengou", "");
            form_.HeaderKihyoubiYearText   = row.GetStr("kihyoubi_year", "");
            form_.HeaderKihyoubiMonthText  = row.GetStr("kihyoubi_month", "");
            form_.HeaderKihyoubiDayText    = row.GetStr("kihyoubi_day", "");

            if (!models.Validator.CheckKihyoubiFormatIsValid(db, row))
            {
                gridController.ShowMsgAndChangeFocus(KaikeiSystemBody.Properties.Resources.MsgInvalidDate, "warn", null);
            }
            else if (!models.Validator.CheckKihyoubiIsInNendoKisanbi(db, row))
            {
                gridController.ShowMsgAndChangeFocus(KaikeiSystemBody.Properties.Resources.MsgKihyoubiOutOfRange, "warn", null);
            }
        }
        private void AddHikiatekinMeisaiReport(DataDynamics.ActiveReports.ActiveReport parentReport)
        {
            DateTime startDate = helper.Helper.GetNenndoKisanbi(form.StartDate.Value);
            DateTime endDate   = helper.Helper.GetNenndoKimatsubi(form.EndDate.Value);

            models.query.HikiatekinMeisai meisai = new models.query.HikiatekinMeisai(Context.KaikeiDatabase);
            meisai.Calc(startDate, endDate, form.KaikeiKubun);

            var report = new views.reports.HikiatekinMeisaiReport();

            report.SetDB(Context.KaikeiDatabase);

            int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId;

            models.db.Row rootRow         = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId);
            string        houjinMei       = rootRow.GetStr("name");
            string        kaikeiKubunName = "";

            if (form.KaikeiKubun != rootKaikeiKubunId)
            {
                kaikeiKubunName = Context.KaikeiDatabase.MTKaikeiKubun.GetFirst("name", "where id=" + form.KaikeiKubun) as string;
            }
            report.SetHeader(startDate, endDate, houjinMei, kaikeiKubunName);
            report.SetFooter(meisai.SumRow);
            report.DataSource = meisai.GetMeisaiList();
            report.Run();
            parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count));
        }
        private void AddKessanShikinUchiwakeReportSub(DataDynamics.ActiveReports.ActiveReport report, views.reports.ShikinSyuushiKessanUchiwakeEngine engine, models.query.ShikinSyuushiUchiwake uchiwake, int startCol, int endCol)
        {
            engine.SetDB(Context.KaikeiDatabase);

            int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId;

            models.db.Row rootRow   = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId);
            string        houjinMei = rootRow.GetStr("name");
            string        title     = "【拠点区分資金収支明細書】";
            string        youshiki  = "別紙3(⑩)";

            if (form.KaikeiKubun == 1)
            {
                title    = "【資金収支内訳表】";
                youshiki = "第一号第二様式";
            }
            else if (form.KaikeiKubun == 2)
            {
                title    = "【事業区分資金収支内訳表】";
                youshiki = "第一号第三様式";
            }
            engine.SetHeader(form.StartDate.Value, form.EndDate.Value, houjinMei, uchiwake.GetColCaptions(startCol, endCol), title, youshiki);
            engine.SetFooter(
                uchiwake.GetSummaryRow(models.query.ShikinSyuushi.SummaryItem.ToukiShikin, startCol, endCol),
                uchiwake.GetSummaryRow(models.query.ShikinSyuushi.SummaryItem.ZenkiZandaka, startCol, endCol),
                uchiwake.GetSummaryRow(models.query.ShikinSyuushi.SummaryItem.ToukiZandaka, startCol, endCol));

            var source = uchiwake.GetRows(startCol, endCol);

            report.DataSource = source;
            report.Run();
        }
Exemplo n.º 12
0
        private void DaikubunGridRowSelected(int daikubunId)
        {
            form.ClearKamokuGrid();

            if (shikinSyuushi.ChildRowsOf.ContainsKey(daikubunId) == false)
            {
                return;
            }

            foreach (var row in shikinSyuushi.ChildRowsOf[daikubunId])
            {
                int           kamokuId  = row.Id;
                models.db.Row kamokuRow = Context.KaikeiDatabase.MTKamokuKubun.GetRowById(kamokuId);

                if (kamokuRow == null)
                {
                    continue;
                }

                form.AddKamokuGridRow(
                    kamokuRow.GetStr("name"),
                    row.Taisyaku
                    );
            }
        }
Exemplo n.º 13
0
        private void InitTableAddRow(models.db.Row kamokuKubunRow)
        {
            int             kamokuKubunId = kamokuKubunRow.GetId();
            int             parentId      = (int)kamokuKubunRow.GetLong("parent_id", -1);
            string          parentName;
            KoteiShisanType type;

            if (parentId == (int)models.constants.MTKamokuKubun.KoteiShisanKihonZaisan)
            {
                parentName = KaikeiSystemBody.Properties.Resources.CaptionKihonZaisanYuukei;
                type       = KoteiShisanType.KihonZaisan;
            }
            else if (models.KoteiShisanFunc.IsSonotaYuukeiKoteiShisan(kamokuKubunId))
            {
                parentName = Properties.Resources.CaptionSonotaKoteishisanYuukei;
                type       = KoteiShisanType.SonotaYuukei;
            }
            else
            {
                parentName = Properties.Resources.CaptionSonotaKoteishisanMukei;
                type       = KoteiShisanType.SonotaMukei;
            }
            MeisaiRow row = new MeisaiRow(kamokuKubunRow.GetStr("name"), parentName, type);

            meisaiTable.Add(kamokuKubunRow.GetId(), row);
            meisaiList.Add(row);
        }
Exemplo n.º 14
0
        private void SetGroupHeader(DataDynamics.ActiveReports.TextBox txtId,
                                    DataDynamics.ActiveReports.TextBox txtName,
                                    DataDynamics.ActiveReports.TextBox txtYosan,
                                    DataDynamics.ActiveReports.TextBox txtJisseki,
                                    DataDynamics.ActiveReports.TextBox txtSagaku,
                                    DataDynamics.ActiveReports.TextBox txtHiritsu,
                                    string namePrefix,
                                    string nameSuffix)
        {
            int  kamokuKubunId = helper.Converter.ObjToInt(txtId.Text, -1);
            long yosan         = helper.Converter.AmountToLongObj(txtYosan.Text).Value;
            long jisseki       = helper.Converter.AmountToLongObj(txtJisseki.Text).Value;

            if (yosan == 0)
            {
                txtHiritsu.Text = "0.0";
            }
            else
            {
                txtHiritsu.Text = string.Format("{0:0.0}", ((double)jisseki) / ((double)yosan) * 100);
            }

            models.db.Row kamokuKubunRow = db.MTKamokuKubun.GetRowById(kamokuKubunId);
            txtName.Text = namePrefix + kamokuKubunRow.GetStr("name") + nameSuffix;
        }
Exemplo n.º 15
0
 // Rowデータの設定
 override protected void SetRowDataSub(models.db.Row rowData)
 {
     cmbKeiriKubun.SelectRowByKeyValue(rowData.GetLong("keiri_kubun", -1));
     cmbKamoku.SelectRowByKeyValue(rowData.GetLong("kamoku_id", 0));
     SetKamokuCodeText();
     amountYosan.AmountStr = rowData.GetStr("yosan");
 }
Exemplo n.º 16
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;
        }
Exemplo n.º 17
0
/*            public YosanJissekiRow(int kamokuId, string kamokuCode, string name, long yosan, long jisseki) {
 *              KamokuId = kamokuId;
 *              KamokuCode = kamokuCode;
 *              Name = name;
 *              YosanDisplay = yosan;
 *              JissekiDisplay = jisseki;
 *          }
 */


            public YosanJissekiRow(int kamokuId, string name, long yosan, long jisseki, models.db.KaikeiDatabase db)
            {
                KamokuId = kamokuId;
                Yosan    = yosan;
                Jisseki  = jisseki;
                Name     = name;

                YosanDaikubun   = 0;
                JissekiDaikubun = 0;
                YosanKubun      = 0;
                JissekiKubun    = 0;

                models.db.Row kamokuKubunRow = db.MTKamokuKubun.GetRowById(kamokuId);
                if (kamokuKubunRow != null)
                {
                    if (name == null)
                    {
                        Name = kamokuKubunRow.GetStr("name");
                    }

                    models.db.Row kanjouKamokuRow = db.MTKanjouKamoku.GetRowById((int)kamokuKubunRow.GetLong("kanjou_kamoku_id", -1));
                    if (kanjouKamokuRow != null)
                    {
                        KamokuCode = kanjouKamokuRow.GetStr("kamoku_code");
                    }
                    else
                    {
                        KamokuCode = "";
                    }
                }
            }
Exemplo n.º 18
0
        public void SetRowData(models.db.Row row)
        {
            inSetRowDataFunction = true;

            int torihikiKubunId = (int)row.GetLong("torihiki_kubun", -1);

            txtDenpyouBangou.Text  = row.GetStr("denpyou_bangou_cache", "");
            txtKihyoubiGengou.Text = row.GetStr("kihyoubi_gengou");
            txtKihyoubiYear.Text   = row.GetStr("kihyoubi_year");
            txtKihyoubiMonth.Text  = row.GetStr("kihyoubi_month");
            txtKihyoubiDay.Text    = row.GetStr("kihyoubi_day");
            cmbKarikataKamoku.SelectRowByKeyValue(row.GetStr("karikata_kamoku_code", ""));
            lblKarikataKamoku.Text = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("karikata_kamoku_id", -1), torihikiKubunId);
            cmbKashikataKamoku.SelectRowByKeyValue(row.GetStr("kashikata_kamoku_code", ""));
            lblKashikataKamoku.Text     = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("kashikata_kamoku_id", -1), torihikiKubunId);
            txtKingaku.AmountStr        = row.GetStr("karikata_kingaku", "");
            txtTekiyouId.Text           = row.GetStr("tekiyou_id", "");
            txtComment.Text             = row.GetStr("comment", "");
            checkDenpyouKakunin.Checked = row.GetBool("denpyou_kakunin", false);
            cmbKaikeiKubun.SelectRowByKeyValue(row.GetLong("kaikei_kubun", -1));
            cmbTorihikiKubun.SelectRowByKeyValue(row.GetLong("torihiki_kubun", -1));
            cmbKarikataHojo.SelectRowByKeyValue(row.GetLong("karikata_hojo_seiri", 0));
            lblKarikataHojo.Text = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("karikata_hojo_id", -1), torihikiKubunId);
            cmbKashikataHojo.SelectRowByKeyValue(row.GetLong("kashikata_hojo_seiri", 0));
            lblKashikataHojo.Text = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("kashikata_hojo_id", -1), torihikiKubunId);

            bool isBindedShikinDenpyou = db.KaikeiDenpyouMeisai.IsAutoInsertedShikinDenpyouRow(row);

            txtDenpyouBangou.ReadOnly   = isBindedShikinDenpyou;
            txtKihyoubiGengou.ReadOnly  = isBindedShikinDenpyou;
            txtKihyoubiYear.ReadOnly    = isBindedShikinDenpyou;
            txtKihyoubiMonth.ReadOnly   = isBindedShikinDenpyou;
            txtKihyoubiDay.ReadOnly     = isBindedShikinDenpyou;
            cmbKarikataKamoku.Enabled   = !isBindedShikinDenpyou;
            cmbKashikataKamoku.Enabled  = !isBindedShikinDenpyou;
            txtKingaku.ReadOnly         = isBindedShikinDenpyou;
            txtTekiyouId.ReadOnly       = isBindedShikinDenpyou;
            txtComment.ReadOnly         = isBindedShikinDenpyou;
            checkDenpyouKakunin.Enabled = !isBindedShikinDenpyou;
            cmbKaikeiKubun.Enabled      = !isBindedShikinDenpyou;
            cmbTorihikiKubun.Enabled    = !isBindedShikinDenpyou;
            cmbKarikataHojo.Enabled     = !isBindedShikinDenpyou;
            cmbKashikataHojo.Enabled    = !isBindedShikinDenpyou;
            btnDelete.Enabled           = !isBindedShikinDenpyou;

            inSetRowDataFunction = false;
        }
Exemplo n.º 19
0
        private void shikinSyuushiGroupHeader_Format(object sender, EventArgs e)
        {
            models.db.Row row = db.MTKamokuKubun.GetRowFromCache(helper.Converter.ObjToInt(txtShikinSyuushiId.Text, -1));

            if (row != null)
            {
                txtShikinSyuushi.Text = row.GetStr("name", "");
            }
        }
Exemplo n.º 20
0
        private void daikubunGroupHeader_Format(object sender, EventArgs e)
        {
            models.db.Row row = db.MTKamokuKubun.GetRowFromCache(helper.Converter.ObjToInt(txtDaikubunId.Text, -1));

            if (row != null)
            {
                txtDaikubun.Text = "【" + row.GetStr("name", "") + "】";
            }
        }
Exemplo n.º 21
0
            public ShiwakeDenpyouRow(models.db.KaikeiDatabase db, models.db.Row row)
            {
                Id            = row.GetId();
                DenpyouBangou = row.GetStr("denpyou_bangou", "");
                KaikeiKubun   = row.GetMasterStr("kaikei_kubun", "name", "", db.MTKaikeiKubun);
                TorihikiKubun = row.GetMasterStr("torihiki_kubun", "torihiki_kubun", "", db.MTTorihikiKubun);

                Kihyoubi = row.GetDate("kihyoubi");

                int torihikiKubunId = (int)row.GetLong("torihiki_kubun", -1);

                KarikataKamoku  = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("karikata_kamoku_id", -1), torihikiKubunId);
                KashikataKamoku = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("kashikata_kamoku_id", -1), torihikiKubunId);
                KarikataHojo    = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("karikata_hojo_id", -1), torihikiKubunId);
                KashikataHojo   = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("kashikata_hojo_id", -1), torihikiKubunId);
                Tekiyou         = row.GetStr("comment");
                //Kingaku = helper.Converter.LongToAmount(row.GetLong("karikata_kingaku", 0));
                Kingaku = row.GetLong("karikata_kingaku", 0);

                KarikataKamokuCode = row.GetStr("karikata_kamoku_code");
                int karikataHojoSeiriLong = (int)row.GetLong("karikata_hojo_seiri", 0);

                KarikataHojoSeiri = (karikataHojoSeiriLong > 0) ? karikataHojoSeiriLong.ToString() : "";

                KashikataKamokuCode = row.GetStr("kashikata_kamoku_code");
                int kashikataHojoSeiriLong = (int)row.GetLong("kashikata_hojo_seiri", 0);

                KashikataHojoSeiri = (kashikataHojoSeiriLong > 0) ? kashikataHojoSeiriLong.ToString() : "";

                KarikataKamoku2  = "";
                KashikataKamoku2 = "";
                KarikataHojo2    = "";
                KashikataHojo2   = "";

                KarikataKamoku3  = "";
                KashikataKamoku3 = "";
                KarikataHojo3    = "";
                KashikataHojo3   = "";

                KarikataKamoku4  = "";
                KashikataKamoku4 = "";
                KarikataHojo4    = "";
                KashikataHojo4   = "";
            }
Exemplo n.º 22
0
        private SetNenndoResult SetNenndo(int year)
        {
            bool inserted = false;

            var rows = Context.KaikeiDatabase.TaisyakuTaisyouhyouTyuuki.Select("where nenndo=" + year);

            if (rows.Count() == 0)
            {
                SetInitialData(year);
                rows = Context.KaikeiDatabase.TaisyakuTaisyouhyouTyuuki.Select("where nenndo=" + year);
                if (rows.Count() == 0)
                {
                    System.Diagnostics.Debug.Print("貸借対照表注記 登録失敗");
                    return(SetNenndoResult.Failed);
                }
                inserted = true;
            }

            models.db.Row row = rows.First();
            tyuukiRow = row;
            tyuukiId  = (int)row.GetLong("id", 0);
            form.JuuyouKaikeiHoushinHenkou = row.GetStr("juuyou_henkou");
            form.JuuyouKouhatsuJisyou      = row.GetStr("juuyou_kouhatsu");

            string sql = "where tyuuki_id=" + tyuukiId;

            genkaGridController.SetQuery(sql);
            kaikeiHoushinGridController.SetQuery(sql);
            zaisanGridController.SetQuery(sql);
            torikuzushiGridController.SetQuery(sql);
            tanpoGridController.SetQuery(sql);

            form.SetCurrentYear(year);

            if (inserted)
            {
                return(SetNenndoResult.Inserted);
            }
            else
            {
                return(SetNenndoResult.Searched);
            }
        }
Exemplo n.º 23
0
 private void SetTextBoxValue(TextBox txtBox, models.db.Row tyuukiRow)
 {
     if (tyuukiRow == null)
     {
         txtBox.Text = "";
     }
     else
     {
         txtBox.Text = tyuukiRow.GetStr(txtBox.Tag as string);
     }
 }
 public void groupHeaderKubun_Format(object sender, EventArgs e)
 {
     models.db.Row row = db.MTKamokuKubun.GetRowById(helper.Converter.ObjToInt(txtKubunId.Text, -1));
     if (row != null)
     {
         txtKubunName.Text = row.GetStr("name");
     }
     else
     {
         txtKubunName.Text = "";
     }
 }
Exemplo n.º 25
0
        public string GetKamokuStr(int kanjouKamokuId, int torihikiKubun)
        {
            models.db.Row kamokuRow = this.GetRowFromCache(kanjouKamokuId);
            if (kamokuRow == null)
            {
                return("");
            }

            int kubunId = this.GetKamokuKubunId(kamokuRow, (models.constants.MTTorihikiKubun)torihikiKubun);

            models.db.Row kubunRow = (OwnerDB as KaikeiDatabase).MTKamokuKubun.GetRowFromCache(kubunId);
            return(kubunRow.GetStr("name"));
        }
Exemplo n.º 26
0
        /// <summary>
        ///  使用区分のチェック ( 使用区分がONの科目は使用できない)
        /// </summary>
        public static bool IsUseableKamokuCode(models.db.KaikeiDatabase db, models.db.Row row, constants.Taisyaku taisyaku)
        {
            var kamoku = db.MTKanjouKamoku.GetRowFromCodeCache(-1, row.GetStr(GetTaisyakuStr(taisyaku, "_kamoku_code")));

            if (kamoku != null)
            {
                if (kamoku.GetBool("usable", true) == false)
                {
                    return(false);
                }
            }
            return(true);
        }
Exemplo n.º 27
0
        private void AddMeisaiRow(int kamokuKubunId)
        {
            models.db.Row kamokuKubunRow = db.MTKamokuKubun.GetRowById(kamokuKubunId);

            if (kamokuKubunRow == null)
            {
                return;
            }

            MeisaiRow row = new MeisaiRow(kamokuKubunId, kamokuKubunRow.GetStr("name", ""), 0, 0, 0, 0, 0, 0, 0);

            meisaiList.Add(row);
        }
Exemplo n.º 28
0
        private void AddRow(models.db.Row daikubunRow, models.db.Row kamokuRow, bool usableOnly)
        {
            models.db.Row kanjouRow = db.MTKanjouKamoku.GetFirstRow("where id=" + kamokuRow.GetStr("kanjou_kamoku_id"));

            if (usableOnly == true && kanjouRow.GetBool("usable", false) == false)
            {
                return;
            }
            if (kamokuRow.GetBool("deleted", false) == true)
            {
                return;
            }
            KanjouKamokuListRow row = new KanjouKamokuListRow(
                daikubunRow.GetStr("display_order"),
                daikubunRow.GetStr("name"),
                kanjouRow.GetStr("kamoku_code"),
                kanjouRow.GetStr("kamoku"),
                (int)kanjouRow.GetLong("hierarchy", -1));

            row.Index = Rows.Count;
            Rows.Add(row);
        }
Exemplo n.º 29
0
        protected void SetRowDataToTextBoxAsFloat(TextBox control, models.db.Row rowData, string format)
        {
            string strValue = rowData.GetStr(control.Tag as string);
            double?value    = helper.Converter.ObjToDoubleObj(strValue);

            if (value == null)
            {
                control.Text = strValue;
            }
            else
            {
                control.Text = value.Value.ToString(format);
            }
        }
Exemplo n.º 30
0
        private void DenpyouHakkouButtonClicked(object sender)
        {
            models.db.Row syoukyakuRow = (sender as views.grid.AbstractDBGridRow).RowData;
            if (syoukyakuRow == null)
            {
                return;
            }
            if (SelectedRowId == -1)
            {
                return;
            }
            syoukyakuRow.Table.SetColumnValue(syoukyakuRow, "denpyou_hakkou", true);
            (sender as views.grid.AbstractDBGridRow).SetRowData(syoukyakuRow, true);

            models.db.Row newRow = Context.KaikeiDatabase.KaikeiDenpyouMeisai.NewRow();
            //newRow.Table.SetColumnValue(newRow, "kaikei_tanni", (int)models.constants.MTKaikeiTanni.Hukushi);
            newRow.Table.SetColumnValue(newRow, "kaikei_kubun", selectedRow.GetLong("kaikei_kubun", -1));
            newRow.Table.SetColumnValue(newRow, "torihiki_kubun", (int)models.constants.MTTorihikiKubun.Jigyou);
            if (syoukyakuRow.GetDate("gensyoubi") != null)
            {
                DateTime?date = syoukyakuRow.GetDate("gensyoubi");
                Context.KaikeiDatabase.KaikeiDenpyouMeisai.SetKihyoubiAndDenpyouBangouCache(newRow, date.Value);
            }

            models.db.Row karikataKamokuRow = Context.KaikeiDatabase.MTKanjouKamoku.GetRowById((int)models.constants.MTKanjouKamoku.GenkaSyoukyakuhi);
            if (karikataKamokuRow != null)
            {
                newRow.Table.SetColumnValue(newRow, "karikata_kamoku_code", karikataKamokuRow.GetStr("kamoku_code"));
            }

            models.db.Row kashikataKamokuKubunRow = Context.KaikeiDatabase.MTKamokuKubun.GetRowById((int)selectedRow.GetLong("kamoku_kubun_id", -1));
            models.db.Row kashikataKamokuRow      = Context.KaikeiDatabase.MTKanjouKamoku.GetRowById((int)kashikataKamokuKubunRow.GetLong("kanjou_kamoku_id", -1));
            if (kashikataKamokuRow != null)
            {
                newRow.Table.SetColumnValue(newRow, "kashikata_kamoku_code", kashikataKamokuRow.GetStr("kamoku_code"));
            }

            newRow.Table.SetColumnValue(newRow, "karikata_kingaku", syoukyakuRow.GetLong("touki_genka_syoukyaku_kagaku", 0));
            newRow.Table.SetColumnValue(newRow, "comment", selectedRow.GetStr("shisan_meisyou"));

            newRow.Table.Insert(newRow);
            models.db.Row insertedRow = newRow.Table.LastInsertedRow();

            helper.MsgBox.Info(KaikeiSystemBody.Properties.Resources.MsgConfirmSyoukyakuMeisaiDenpyouHakkou);
            var denpyouPopupController = new popup.DenpyouInfoPopupController();

            denpyouPopupController.ShowPopupModal(popup, insertedRow, Context);
        }