Пример #1
0
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row row_data)
        {
            int torihikiKubunId = (int)row_data.GetLong("torihiki_kubun", -1);

            lblId.Text = row_data.GetStr("id", "(新規)");
            {
                DateTime?createdAt = row_data.GetDate("created_at");
                lblCreateDate.Text = createdAt != null?helper.Converter.DateTimeToWarekiStr(createdAt.Value) : "";
            }
            {
                DateTime?updatedAt = row_data.GetDate("updated_at");
                lblUpdateDate.Text = updatedAt != null?helper.Converter.DateTimeToWarekiStr(updatedAt.Value) : "";
            }
            txtDenpyouBangou.Text       = row_data.GetStr("denpyou_bangou_cache", "");
            txtKihyoubiGengou.Text      = row_data.GetStr("kihyoubi_gengou", "");
            txtKihyoubiYear.Text        = row_data.GetStr("kihyoubi_year", "");
            txtKihyoubiMonth.Text       = row_data.GetStr("kihyoubi_month", "");
            txtKihyoubiDay.Text         = row_data.GetStr("kihyoubi_day", "");
            txtKarikataKamokuCode.Text  = row_data.GetStr("karikata_kamoku_code", "");
            lblKarikataKamoku.Text      = db.MTKanjouKamoku.GetKamokuStr((int)row_data.GetLong("karikata_kamoku_id", -1), torihikiKubunId);
            txtKashikataKamokuCode.Text = row_data.GetStr("kashikata_kamoku_code", "");
            lblKashikataKamoku.Text     = db.MTKanjouKamoku.GetKamokuStr((int)row_data.GetLong("kashikata_kamoku_id", -1), torihikiKubunId);
            txtKingaku.AmountStr        = row_data.GetStr("karikata_kingaku", "");
            txtTekiyou.Text             = row_data.GetStr("tekiyou_id", "");
            txtComment.Text             = row_data.GetStr("comment", "");
            chkKessanSyuuryou.Checked   = row_data.GetBool("kessan_syuuryou", false);
            chkDenpyouKakunin.Checked   = row_data.GetBool("denpyou_kakunin", false);
            cmbKaikeiKubun.SelectRowByKeyValue(row_data.GetLong("kaikei_kubun", -1));
            cmbTorihikiKubun.SelectRowByKeyValue(torihikiKubunId);
            txtKarikataHojoSeiri.Text  = row_data.GetStr("karikata_hojo_seiri", "");
            lblKarikataHojo.Text       = db.MTKanjouKamoku.GetKamokuStr((int)row_data.GetLong("karikata_hojo_id", -1), torihikiKubunId);
            txtKashikataHojoSeiri.Text = row_data.GetStr("kashikata_hojo_seiri", "");
            lblKashikataHojo.Text      = db.MTKanjouKamoku.GetKamokuStr((int)row_data.GetLong("kashikata_hojo_id", -1), torihikiKubunId);

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

            txtKihyoubiGengou.ReadOnly      = isBindedShikinDenpyou;
            txtKihyoubiYear.ReadOnly        = isBindedShikinDenpyou;
            txtKihyoubiMonth.ReadOnly       = isBindedShikinDenpyou;
            txtKihyoubiDay.ReadOnly         = isBindedShikinDenpyou;
            cmbKaikeiKubun.Enabled          = !isBindedShikinDenpyou;
            cmbTorihikiKubun.Enabled        = !isBindedShikinDenpyou;
            txtKarikataKamokuCode.ReadOnly  = isBindedShikinDenpyou;
            txtKarikataHojoSeiri.ReadOnly   = isBindedShikinDenpyou;
            txtKashikataKamokuCode.ReadOnly = isBindedShikinDenpyou;
            txtKashikataHojoSeiri.ReadOnly  = isBindedShikinDenpyou;
            txtKingaku.ReadOnly             = isBindedShikinDenpyou;
            txtTekiyou.ReadOnly             = isBindedShikinDenpyou;
            txtComment.ReadOnly             = isBindedShikinDenpyou;
            btnRemoveRow.Enabled            = !isBindedShikinDenpyou;
            chkKessanSyuuryou.Enabled       = !isBindedShikinDenpyou;
        }
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row rowData)
        {
            base.SetRowDataToTextBox(txtKamokuCode, rowData);
            base.SetRowDataToMTCombo(cmbTaisyaku, rowData);
            base.SetRowDataToCheckBox(chkUsable, rowData);
            base.SetRowDataToCheckBox(chkPrintTarget, rowData);
            base.SetRowDataToTextBox(txtKamoku, rowData);
            base.SetRowDataToTextBox(txtKamokuYomi, rowData);
            base.SetRowDataToTextBox(txtJigyouKamokuKubun, rowData);
            base.SetRowDataToTextBox(txtTaisyakuKamokuKubun, rowData);
            base.SetRowDataToTextBox(txtShikinKamokuKubun, rowData);
            base.SetRowDataToTextBox(txtParentShikin, rowData);
            base.SetRowDataToTextBox(txtParentJigyou, rowData);
            base.SetRowDataToTextBox(txtParentTaisyaku, rowData);

            bool editable = rowData.GetBool("editable", false);

            txtKamokuCode.Enabled          = editable;
            cmbTaisyaku.Enabled            = editable;
            chkPrintTarget.Enabled         = editable;
            txtKamoku.Enabled              = editable;
            txtKamokuYomi.Enabled          = editable;
            txtJigyouKamokuKubun.Enabled   = editable;
            txtTaisyakuKamokuKubun.Enabled = editable;
            txtShikinKamokuKubun.Enabled   = editable;
            lblNotEditable.Visible         = !editable;
            btnDelete.Enabled              = editable;

            txtJigyouKamokuKubun.Enabled   = editable && (rowData.GetLong("parent_jigyou_kamoku_kubun_id", -1) != -1);
            txtShikinKamokuKubun.Enabled   = editable && (rowData.GetLong("parent_shikin_kamoku_kubun_id", -1) != -1);
            txtTaisyakuKamokuKubun.Enabled = editable && (rowData.GetLong("parent_taisyaku_kamoku_kubun_id", -1) != -1);
        }
Пример #3
0
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row rowData)
        {
            base.SetRowDataToTextBox(txtKamokuCode, rowData);
            base.SetRowDataToTextBox(txtKamoku, rowData);
            base.SetRowDataToTextBox(txtJigyouKamokuKubun, rowData);
            base.SetRowDataToTextBox(txtTaisyakuKamokuKubun, rowData);
            base.SetRowDataToTextBox(txtShikinKamokuKubun, rowData);
            base.SetRowDataToCheckBox(chkPrintTarget, rowData);
            base.SetRowDataToMTCombo(cmbKaikeiKubun, rowData);

            txtJigyouKamokuKubun.Enabled   = (rowData.GetLong("jigyou_kamoku_kubun_id", -1) != -1);
            txtTaisyakuKamokuKubun.Enabled = (rowData.GetLong("taisyaku_kamoku_kubun_id", -1) != -1);
            txtShikinKamokuKubun.Enabled   = (rowData.GetLong("shikin_kamoku_kubun_id", -1) != -1);

            if (rowData.GetBool("has_child", false))
            {
                btnDelete.Enabled = false;
            }
            else
            {
                btnDelete.Enabled = true;
            }

            int hierarchy = (int)rowData.GetLong("hierarchy", -1);

            if (hierarchy == (int)models.constants.MTKanjouKamokuHierarchy.HojoKamoku)
            {
                btnAddHojoKamoku.Enabled = false;
                chkPrintTarget.Enabled   = false;
                pictChild.Show();

                txtKamoku.Bounds = new Rectangle(
                    pictChild.Location.X + pictChild.Size.Width,
                    txtKamoku.Location.Y,
                    txtJigyouKamokuKubun.Size.Width - pictChild.Size.Width,
                    txtJigyouKamokuKubun.Size.Height
                    );
            }
            else
            {
                btnAddHojoKamoku.Enabled = true;
                chkPrintTarget.Enabled   = true;
                pictChild.Hide();

                txtKamoku.Bounds = new Rectangle(
                    pictChild.Location.X,
                    txtKamoku.Location.Y,
                    txtJigyouKamokuKubun.Size.Width,
                    txtJigyouKamokuKubun.Size.Height
                    );
            }
        }
        private void AddKamokuRow(models.db.Row daikubunRow, models.db.Row kamokuKubunRow, int groupId)
        {
            int kamokuKubunId = (int)kamokuKubunRow.GetId();

            models.db.Row kanjouKamokuRow = db.MTKanjouKamoku.GetFirstRow("where id=" + kamokuKubunRow.GetLong("kanjou_kamoku_id", -1));
            if (kanjouKamokuRow == null)
            {
                return;
            }
            if (kanjouKamokuRow.GetBool("usable", false) == false)
            {
                return;
            }

            int taisyakuKubunId = (int)kanjouKamokuRow.GetLong("taisyaku_kubun_id", -1);

            if ((taisyakuKubunId == (int)models.constants.MTTaisyakuKubun.KariPlus || taisyakuKubunId == (int)models.constants.MTTaisyakuKubun.KariMinus) &&
                groupId == GroupIdSyuunyuu)
            {
                return;
            }
            if ((taisyakuKubunId == (int)models.constants.MTTaisyakuKubun.KashiPlus || taisyakuKubunId == (int)models.constants.MTTaisyakuKubun.KashiMinus) &&
                groupId == GroupIdShisyutsu)
            {
                return;
            }

            if (kanjouKamokuHash.ContainsKey(kanjouKamokuRow.GetId()))
            {
                return;
            }
            kanjouKamokuHash.Add(kanjouKamokuRow.GetId(), true);

            ShisanRow shisanRow = new ShisanRow();

            shisanRow.GroupId        = groupId;
            shisanRow.KanjouKamokuId = kanjouKamokuRow.GetId();
            //shisanRow.KamokuKubunId = kamokuRow.GetId();
            shisanRow.DaikubunId            = daikubunRow.GetId();
            shisanRow.TaisyakuKubun         = taisyakuKubunId;
            shisanRow.IsShikinKamoku        = (kanjouKamokuRow.GetLong("shikin_kamoku_kubun_id", -1) != -1) || (kanjouKamokuRow.GetLong("taisyaku_kamoku_kubun_id", -1) != -1);
            shisanRow.IsJigyouKamoku        = kanjouKamokuRow.GetLong("jigyou_kamoku_kubun_id", -1) != -1 || (kanjouKamokuRow.GetLong("taisyaku_kamoku_kubun_id", -1) != -1);
            shisanRow.KanjouKamokuHierarchy = (int)kanjouKamokuRow.GetLong("hierarchy", -1);
            RowList.Add(shisanRow);

            if (kamokuKubunId == (int)models.constants.MTKamokuKubun.JikiKurikoshikatsudouZougenSagakuChukubun)
            {
                jikiKurikoshiIndex = RowList.Count - 1;
            }
        }
        // 行の変更内容の有効性をチェック
        private bool Grid_ValidateRowValue(views.grid.AbstractDBGridRow rowControl)
        {
            models.db.Row row = rowControl.RowData;

            if (!row.GetBool("kessan_syuuryou", false))
            {
                return(true);
            }
            else
            {
                gridController.ShowMsgAndChangeFocus(KaikeiSystemBody.Properties.Resources.MsgKessanSyuuryou, "warn", null);
                return(false);
            }
        }
Пример #6
0
        // Rowデータの設定
        override protected void SetRowDataSub(models.db.Row rowData)
        {
            base.SetRowDataToTextBox(txtDaikubunCode, rowData);
            base.SetRowDataToTextBox(txtName, rowData);
            base.SetRowDataToMTCombo(cmbParent, rowData);

            bool editable = rowData.GetBool("editable", false);//(rowData.GetLong("id", ((int)models.constants.MTKamokuKubun.ReservedMax) + 1)

            //        > (long)models.constants.MTKamokuKubun.ReservedMax);
            txtDaikubunCode.Enabled = editable;
            txtName.Enabled         = editable;
            cmbParent.Enabled       = editable;
            btnDelete.Enabled       = editable;
        }
Пример #7
0
        private long GetSumYosanOfKamokuKubun(int kaikeiKubun, int year, int parentKamokuKubun)
        {
            long sum = 0;

            foreach (var row in Context.KaikeiDatabase.MTKamokuKubun.SelectChildren(parentId: parentKamokuKubun))
            {
                models.db.Row kanjouRow = Context.KaikeiDatabase.MTKanjouKamoku.GetRowFromCache((int)row.GetLong("kanjou_kamoku_id", -1));
                if (kanjouRow == null || kanjouRow.GetBool("usable", false) == false)
                {
                    continue;
                }
                sum += GetYosanOfKamokuKubun(kaikeiKubun, year, (int)row.GetLong("id", -1));
            }

            return(sum);
        }
Пример #8
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;
        }
Пример #9
0
        private void CalcSummaryInfo()
        {
            string range = string.Format(
                "where nenndo={0} and kaikei_kubun = {1} and hosei_kaisuu <= {2} ",
                form.Year,
                form.KaikeiKubun,
                form.HoseiKaisuu);

            long syuunyuu  = 0;
            long shisyutsu = 0;

            foreach (var row in Context.KaikeiDatabase.YosanKamokuKubun.Select(range))
            {
                int           kamokuKubunId = (int)(int)row.GetLong("kamoku_kubun_id", -1);
                models.db.Row kamokuRow     = Context.KaikeiDatabase.MTKamokuKubun.GetRowFromCache(kamokuKubunId);
                if (kamokuRow == null || (int)kamokuRow.GetLong("hierarchy", -1) != (int)models.constants.MTKamokuKubunHierarchy.ChuuKubun)
                {
                    continue;
                }
                models.db.Row kanjouRow = Context.KaikeiDatabase.MTKanjouKamoku.GetRowFromCache((int)kamokuRow.GetLong("kanjou_kamoku_id", -1));
                if (kanjouRow == null || kanjouRow.GetBool("usable", false) == false)
                {
                    continue;
                }
                if (Context.KaikeiDatabase.MTKamokuKubun.IsSyuunyuuKamoku(kamokuKubunId))
                {
                    syuunyuu += row.GetLong("yosan", 0);
                }
                else
                {
                    shisyutsu += row.GetLong("yosan", 0);
                }
            }
            long yobihi  = Context.KaikeiDatabase.YosanYobihi.SelectSum("yobihi", range);
            long zandaka = Context.KaikeiDatabase.YosanYobihi.SelectSum("zenkimatsu_shiharai_shikin_zandaka", range);

            long sagaku = syuunyuu - shisyutsu - yobihi - zandaka;

            form.SetSummaryInfo(syuunyuu, shisyutsu, yobihi, zandaka, sagaku);
        }
Пример #10
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);
        }
Пример #11
0
        private long GetYosanOfKamokuKubun(int kaikeiKubun, int year, int kamokuKubun)
        {
            string sql = string.Format(
                "where kaikei_kubun = {0} and nenndo = {1} and kamoku_kubun_id = {2}",
                kaikeiKubun,
                year,
                kamokuKubun);
            long sum = 0;

            foreach (var row in Context.KaikeiDatabase.YosanKamokuKubun.Select(sql))
            {
                int           kamokuKubunId = (int)(int)row.GetLong("kamoku_kubun_id", -1);
                models.db.Row kamokuRow     = Context.KaikeiDatabase.MTKamokuKubun.GetRowFromCache(kamokuKubunId);
                models.db.Row kanjouRow     = Context.KaikeiDatabase.MTKanjouKamoku.GetRowFromCache((int)kamokuRow.GetLong("kanjou_kamoku_id", -1));
                if (kanjouRow == null || kanjouRow.GetBool("usable", false) == false)
                {
                    continue;
                }
                sum += row.GetLong("yosan", 0);
            }

            return(sum);
        }
Пример #12
0
 protected void SetRowDataToCheckBox(CheckBox control, models.db.Row rowData)
 {
     control.Checked = rowData.GetBool(control.Tag as string, false);
 }