Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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");
        }
Ejemplo n.º 3
0
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row rowData)
        {
            models.db.Row kamokuRow = db.MTKanjouKamoku.GetRowFromKamokuKubun(rowData.GetLong("kamoku_kubun_id", -1));
            if (kamokuRow != null)
            {
                txtKamokuCode.Text = kamokuRow.GetStr("kamoku_code");
            }
            else
            {
                txtKamokuCode.Text = "";
            }

            txtKaikeiKubun.Text   = rowData.GetMasterStr("kaikei_kubun", "name", "", db.MTKaikeiKubun);
            txtKamokuKubun.Text   = rowData.GetMasterStr("kamoku_kubun_id", "name", "", db.MTKamokuKubun);
            amountYosan.AmountStr = rowData.GetStr("yosan");
        }
Ejemplo n.º 4
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   = "";
            }
Ejemplo n.º 5
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.DateTimeToWarekiGengou(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();
            lblHojoKamoku.Text  = rowData.GetMasterStr("kamoku_kubun_id", "name", "", db.MTKamokuKubun);
            lblYosan.Text       = helper.Converter.LongToAmount(rowData.GetLong("yosan", 0));

            {
                models.db.Row kamokuRow = db.MTKamokuKubun.GetRowFromCache((int)rowData.GetLong("kamoku_kubun_id", -1));
                if (kamokuRow != null)
                {
                    lblKamoku.Text = kamokuRow.GetMasterStr("parent_id", "name", "", db.MTKamokuKubun);
                }
            }
        }
Ejemplo n.º 6
0
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row rowData)
        {
            int torihikiKubunId = (int)rowData.GetLong("torihiki_kubun", -1);

            this.BackColor = Color.White;

            base.SetRowDataToLabel(lblTsuikaKubun, rowData);
            lblKaikeiKubun.Text   = rowData.GetMasterStr(lblKaikeiKubun.Tag as string, "name", "", db.MTKaikeiKubun);
            lblTorihikiKubun.Text = rowData.GetMasterStr(lblTorihikiKubun.Tag as string, "name", "", db.MTTorihikiKubun);

            base.SetRowDataToLabel(lblKashikataKamokuCode, rowData);
            base.SetRowDataToLabel(lblKashikataHojoSeiri, rowData);
            base.SetRowDataToLabel(lblKarikataKamokuCode, rowData);
            base.SetRowDataToLabel(lblKarikataHojoSeiri, rowData);
            base.SetRowDataToLabelAsAmount(lblKingaku, rowData);
            base.SetRowDataToLabel(lblTekiyouId, rowData);
            base.SetRowDataToLabel(lblComment, rowData);
            base.SetRowDataToCheckBox(chkTouroku, rowData);

            lblKarikataKamoku.Text  = db.MTKanjouKamoku.GetKamokuStr((int)rowData.GetLong("karikata_kamoku_id", -1), torihikiKubunId);
            lblKashikataKamoku.Text = db.MTKanjouKamoku.GetKamokuStr((int)rowData.GetLong("kashikata_kamoku_id", -1), torihikiKubunId);
            lblKarikataHojo.Text    = db.MTKanjouKamoku.GetKamokuStr((int)rowData.GetLong("karikata_hojo_id", -1), torihikiKubunId);
            lblKashikataHojo.Text   = db.MTKanjouKamoku.GetKamokuStr((int)rowData.GetLong("kashikata_hojo_id", -1), torihikiKubunId);
        }
Ejemplo n.º 7
0
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row rowData)
        {
            base.SetRowDataToTextBox(txtKamokuCode, rowData);
            base.SetRowDataToTextBox(txtKamoku, rowData);
            base.SetRowDataToCheckBox(chkUsable, rowData);
            base.SetRowDataToCheckBox(chkPrintTarget, rowData);

            { // parent
                int kubunId = 0;
                kubunId = (int)rowData.GetLong("jigyou_kamoku_kubun_id", -1);
                if (kubunId == -1)
                {
                    kubunId = (int)rowData.GetLong("shikin_kamoku_kubun_id", -1);
                }
                if (kubunId == -1)
                {
                    kubunId = (int)rowData.GetLong("taisyaku_kamoku_kubun_id", -1);
                }

                if (kubunId != -1)
                {
                    models.db.Row parentKubunRow = db.MTKamokuKubun.GetParentOf(db.MTKamokuKubun.GetRowFromCache(kubunId));
                    if (parentKubunRow != null)
                    {
                        txtParent.Text = parentKubunRow.GetStr("name");
                    }
                    else
                    {
                        txtParent.Text = "";
                    }
                }
                else
                {
                    txtParent.Text = "";
                }
            }

            txtTaisyakuKubun.Text = rowData.GetMasterStr("taisyaku_kubun_id", "caption", "", db.MTTaisyakuKubun);

            SetKamokuKubunParentText(txtShikinKamokuKubun, rowData, "shikin_kamoku_kubun_id", (int)models.constants.MTKamokuKubunHierarchy.Kubun);
            SetKamokuKubunParentText(txtJigyouKamokuKubun, rowData, "jigyou_kamoku_kubun_id", (int)models.constants.MTKamokuKubunHierarchy.Kubun);
            SetKamokuKubunParentText(txtTaisyakuKamokuKubun, rowData, "taisyaku_kamoku_kubun_id", (int)models.constants.MTKamokuKubunHierarchy.Kubun);
        }
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row rowData)
        {
            models.db.Row kanjouKamokuRow = db.MTKanjouKamoku.GetRowFromKamokuKubun(rowData.GetLong("kamoku_kubun_id", -1));
            if (kanjouKamokuRow != null)
            {
                txtTaisyakuKubun.Text = kanjouKamokuRow.GetMasterStr("taisyaku_kubun_id", "caption", "", db.MTTaisyakuKubun);
            }
            else
            {
                txtTaisyakuKubun.Text = "";
                models.db.Row childKamokuKubunRow = db.MTKamokuKubun.GetFirstRow("where parent_id=" + rowData.GetLong("kamoku_kubun_id", -1));
                if (childKamokuKubunRow != null)
                {
                    models.db.Row childKanjouKamokuRow = db.MTKanjouKamoku.GetRowFromKamokuKubun(childKamokuKubunRow.GetId());
                    if (childKanjouKamokuRow != null)
                    {
                        txtTaisyakuKubun.Text = childKanjouKamokuRow.GetMasterStr("taisyaku_kubun_id", "caption", "", db.MTTaisyakuKubun);
                    }
                }
            }

            txtKamokuKubun.Text       = rowData.GetMasterStr("kamoku_kubun_id", "name", "", db.MTKamokuKubun);
            amountKurikoshi.AmountStr = rowData.GetStr("zenki_kurikoshi_gaku");
        }
Ejemplo n.º 9
0
        // row = nullのときは新規作成
        private models.db.Row CreateKanjouKamokuDetailRow(System.Windows.Forms.Form owner, models.db.Row row)
        {
            if (row == null)
            {
                views.controls.SelectKanjouKamokuDialog dlg = new views.controls.SelectKanjouKamokuDialog();
                if (dlg.ShowDialog(owner, Context) != System.Windows.Forms.DialogResult.OK)
                {
                    return(null);
                }

                row = bufferedKanjouKamokuTable.NewRow();
                row.Set("parent_id", -1);
                row.Set("has_child", false);
                row.Set("parent_shikin_kamoku_kubun_id", dlg.ShikinKamokuKubunId);
                row.Set("parent_jigyou_kamoku_kubun_id", dlg.JigyouKamokuKubunId);
                row.Set("parent_taisyaku_kamoku_kubun_id", dlg.TaisyakuKamokuKubunId);
                row.Set("taisyaku_kubun_id", (int)models.constants.MTTaisyakuKubun.KariMinus);
                row.Set("usable", true);
                row.Set("editable", true);
                row.Set("denpyou_print_target", true);
                row.Set("hierarchy", (int)models.constants.MTKanjouKamokuHierarchy.ChuuKubun);

                int kamokuCode    = 0;
                var maxKamokuRows = Context.KaikeiDatabase.MTKanjouKamoku.Select("where parent_id = -1 order by kamoku_code desc limit 1");
                if (maxKamokuRows.Count() == 1)
                {
                    string maxKamokuCodeStr = maxKamokuRows.First().GetStr("kamoku_code");
                    kamokuCode = helper.Converter.ObjToInt(maxKamokuCodeStr, 0) + 1;
                }
                else
                {
                    kamokuCode = 1;
                }
                string kamokuCodeStr = string.Format("{0:D5}", kamokuCode);
                row.Set("kamoku_code", kamokuCodeStr);
                bufferedKanjouKamokuTable.Insert(row);
                row = bufferedKanjouKamokuTable.LastInsertedRow();
            }

            int jigyouKubunId   = (int)row.GetLong("jigyou_kamoku_kubun_id", -1);
            int taisyakuKubunId = (int)row.GetLong("taisyaku_kamoku_kubun_id", -1);
            int shikinKubunId   = (int)row.GetLong("shikin_kamoku_kubun_id", -1);

            models.db.Row jigyouRow   = Context.KaikeiDatabase.MTKamokuKubun.GetRowById(jigyouKubunId);
            models.db.Row taisyakuRow = Context.KaikeiDatabase.MTKamokuKubun.GetRowById(taisyakuKubunId);
            models.db.Row shikinRow   = Context.KaikeiDatabase.MTKamokuKubun.GetRowById(shikinKubunId);
            if (jigyouRow != null)
            {
                row.Set("parent_jigyou_kamoku_kubun_id", jigyouRow.GetLong("parent_id", -1));
                row.Set("parent_jigyou_kamoku_kubun", jigyouRow.GetMasterStr("parent_id", "name", "", Context.KaikeiDatabase.MTKamokuKubun));
            }
            if (taisyakuRow != null)
            {
                row.Set("parent_taisyaku_kamoku_kubun_id", taisyakuRow.GetLong("parent_id", -1));
                row.Set("parent_taisyaku_kamoku_kubun", taisyakuRow.GetMasterStr("parent_id", "name", "", Context.KaikeiDatabase.MTKamokuKubun));
            }
            if (shikinRow != null)
            {
                row.Set("parent_shikin_kamoku_kubun_id", shikinRow.GetLong("parent_id", -1));
                row.Set("parent_shikin_kamoku_kubun", shikinRow.GetMasterStr("parent_id", "name", "", Context.KaikeiDatabase.MTKamokuKubun));
            }

            return(row);
        }
Ejemplo n.º 10
0
 // Rowデータの設定
 override protected void SetRowDataSub(models.db.Row rowData)
 {
     txtKaikeiKubun.Text = rowData.GetMasterStr("kaikei_kubun", "name", "", db.MTKaikeiKubun);
     txtKamokuKubun.Text = rowData.GetMasterStr("kamoku_kubun_id", "name", "", db.MTKaikeiKubun);
 }