public TyuukiFormController() { tyuukiRow = null; tyuukiId = -1; form = new KaikeiSystemBody.views.TyuukiForm(); form.CloseButtonClicked += () => MainController.PopActivity(); form.TyuukiTextChanged += delegate(string columnName, string value) { if (tyuukiRow != null) { tyuukiRow.Table.SetColumnValue(tyuukiRow, columnName, value); tyuukiRow.Table.Update(tyuukiRow); } }; form.ExecButtonClicked += delegate() { if (form.InputDate != null) { if (SearchData(form.InputDate.Value.Year, form.KaikeiKubun) == SetNenndoResult.Inserted) { helper.MsgBox.Info(KaikeiSystemBody.Properties.Resources.MsgInsertSuccess); } else { helper.MsgBox.Info(KaikeiSystemBody.Properties.Resources.MsgSearchSuccess); } } else { helper.MsgBox.Err(KaikeiSystemBody.Properties.Resources.MsgInvalidDate); } }; tyuuki8GridController = new grid.DBPanelGridController <views.grid.Tyuuki8Row>(form.Tyuuki8Grid, true); tyuuki8GridController.IsValidNewRow += delegate(models.db.Row row) { return(row.GetLong("tyuuki_id", -1) != -1); }; tyuuki8GridController.InitInsertedRow += delegate(models.db.Row row) { row.Table.SetColumnValue(row, "tyuuki_id", tyuukiId); }; tyuuki10GridController = new grid.DBPanelGridController <views.grid.Tyuuki10Row>(form.Tyuuki10Grid, true); tyuuki10GridController.IsValidNewRow += delegate(models.db.Row row) { return(row.GetLong("tyuuki_id", -1) != -1); }; tyuuki10GridController.InitInsertedRow += delegate(models.db.Row row) { row.Table.SetColumnValue(row, "tyuuki_id", tyuukiId); }; tyuuki11GridController = new grid.DBPanelGridController <views.grid.Tyuuki11Row>(form.Tyuuki11Grid, true); tyuuki11GridController.IsValidNewRow += delegate(models.db.Row row) { return(row.GetLong("tyuuki_id", -1) != -1); }; tyuuki11GridController.InitInsertedRow += delegate(models.db.Row row) { row.Table.SetColumnValue(row, "tyuuki_id", tyuukiId); }; focusController = new misc.FocusController(form); }
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(); } }
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 ); } }
private void ValidateKamokuCode(models.db.KaikeiDatabase db, models.db.Row row, models.constants.Taisyaku taisyaku) { if (models.Validator.IsHurikaeTaisyouKamokuCode(db, row, taisyaku)) { ShowMsgDelay(KaikeiSystemBody.Properties.Resources.MsgHurikaeTaisyouKamoku, "warn"); } }
private void Grid_InitInsertedRow(models.db.Row row) { row.Table.SetColumnValue(row, "nenndo", year); row.Table.SetColumnValue(row, "keiri_kubun", keiriKubun); row.Table.SetColumnValue(row, "yosan_kubun", yosanKubun); row.Table.SetColumnValue(row, "hosei_kaisuu", hoseiKaisuu); }
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(); }
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; }
// Rowデータの設定 override protected void SetRowDataSub(models.db.Row rowData) { base.SetRowDataToMTCombo(cmbKamokuKubun, rowData); base.SetRowDataToAmount(amountSaikenGaku, rowData); base.SetRowDataToAmount(amountTyousyuuhunouZandaka, rowData); base.SetRowDataToAmount(amountToukimatsuZandaka, rowData); }
// Rowデータの設定 override protected void SetRowDataSub(models.db.Row rowData) { base.SetRowDataToTextBox(txtCaption, rowData); base.SetRowDataToAmount(amountTyouboKagaku, rowData); base.SetRowDataToAmount(amountJika, rowData); base.SetRowDataToAmount(amountHyoukaSoneki, rowData); }
private void RowFocused() { models.db.Row kamoku_row = Context.KaikeiDatabase.MTKanjouKamoku.GetRowFromCodeCache(-1, popup.SelectedKey); if (kamoku_row != null) { HojoKamokuController.KamkokuId = (int)kamoku_row.GetLong("id", 0); } }
// Rowデータの設定 override protected void SetRowDataSub(models.db.Row rowData) { base.SetRowDataToFormattedValueTextBox(txtId, rowData); base.SetRowDataToTextBox(txtSuuryou, rowData); base.SetRowDataToTextBox(txtName, rowData); base.SetRowDataToMTCombo(cmbKamokuKubun, rowData); base.SetRowDataToMTCombo(cmbKaikeiKubun, rowData); }
// 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(); }
private void OnChangeTaiyouNennsuu(models.db.Row row) { int syoukyakuHouhou = (int)row.GetLong("syoukyaku_houhou", 0); int taiyouNennsuu = (int)row.GetLong("taiyou_nennsuu", 0); double syoukyakuritsu = models.KoteiShisanFunc.Syoukyakuritu(syoukyakuHouhou, taiyouNennsuu); row.Table.SetColumnValue(row, "syoukyaku_ritsu", syoukyakuritsu); }
public void SetAddedShiwake(models.db.KaikeiDatabase db, models.db.Row row) { int torihikiKubunId = (int)row.GetLong("torihiki_kubun", -1); KarikataKamoku2 = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("karikata_kamoku_id", -1), torihikiKubunId); KashikataKamoku2 = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("kashikata_kamoku_id", -1), torihikiKubunId); KarikataHojo2 = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("karikata_hojo_id", -1), torihikiKubunId); KashikataHojo2 = db.MTKanjouKamoku.GetKamokuStr((int)row.GetLong("kashikata_hojo_id", -1), torihikiKubunId); }
private int kamokuCode2KanjouKamokuId(string code) { models.db.Row kamokuRow = context.KaikeiDatabase.MTKanjouKamoku.GetRowFromCodeCache(-1, code); if (kamokuRow == null) { return(-1); } return((int)kamokuRow.GetLong("id", -1)); }
public static bool IsKoteiShisanKanjouKamoku(models.db.KaikeiDatabase db, int kanjouKamokuId) { models.db.Row kamokuKubunRow = db.MTKanjouKamoku.GetKamokuKubunRow(kanjouKamokuId, models.constants.MTTorihikiKubun.Shikin); if (kamokuKubunRow == null) { return(false); } return(IsKoteiShisanKamokuKubun(db, kamokuKubunRow.GetId())); }
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", "") + "】"; } }
public void SetRowData(models.db.Row rowData, bool dirty) { RowData = rowData; this.RowEditing = dirty; inSetRowDataFunction = true; SetRowDataSub(rowData); inSetRowDataFunction = false; }
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", ""); } }
private void ValidateKashikataHojoSeiri(models.db.KaikeiDatabase db, models.db.Row row) { if (!models.Validator.CheckHojoSeiriIsFitInKaikeiKubun(db, row, models.constants.Taisyaku.Kashikata)) { delayTimerController.SetDelayedProc(delegate() { helper.MsgBox.ShowMsg(KaikeiSystemBody.Properties.Resources.MsgInvaidHojoSeiri, "warn"); popup.FocusKashikataHojoCmbBox(); }); } }
private int hojoSeiri2KanjouKamokuId(string seiri, int parentKanjouKamokuId) { models.db.Row hojoRow = context.KaikeiDatabase.MTKanjouKamoku.GetRowFromCodeCacheByTopParent(parentKanjouKamokuId, seiri); if (hojoRow == null) { return(-1); } return((int)hojoRow.GetLong("id", -1)); }
// 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(); }
// Rowデータの設定 override protected void SetRowDataSub(models.db.Row rowData) { base.SetRowDataToMTCombo(cmbKaikeiKubun, rowData); base.SetRowDataToMTCombo(cmbKamoku, rowData); base.SetRowDataToTextBox(txtName, rowData); base.SetRowDataToTextBox(txtSuuryou, rowData); base.SetRowDataToTextBox(txtTaikyuuNennsuu, rowData); base.SetRowDataToAmount(amountSyutokuKakaku, rowData); base.SetRowDataToDateInputPanel(dateSyutokuNenngappi, rowData); }
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); }
// 会計区分 public void InitRowsWithMTKaikeiKubun(models.db.mtables.MTKaikeiKubun table, bool onlyLeafNode, int maxNumCol = int.MaxValue - 1) { int numCol = Math.Min(table.TreeDepth + 1, maxNumCol + 1); this.ClearRows(); this.InitColumns(numCol, 0, 0); this.SetColumnVisibility(0, false); if (onlyLeafNode) { this.SetColumnVisibility(1, false); } object[] columns = new object[numCol]; for (int i = 0; i < columns.Length; i++) { columns[i] = ""; } models.db.Row root = table.RowCache[table.RootNodeId]; Action <models.db.Row, int> traceTree = null; traceTree = delegate(models.db.Row row, int depth) { if (depth >= maxNumCol) { return; } int id = (int)row.GetLong("id", -1); columns[depth + 1] = row.GetStr("name"); columns[0] = id; if (!onlyLeafNode || !table.ParentId2Child.ContainsKey(id)) { this.AddRowWithCaption(depth + 1, columns); } foreach (var child in table.Select("where parent_id = " + id + " order by kubun_code")) { traceTree(child, depth + 1); } columns[depth + 1] = ""; }; traceTree(root, 0); this.AdjustDropDownWidth(); bindedTable = table; if (!onlyLeafNode) { this.ChangeToTreeView(); } }
private void SetTextBoxValue(TextBox txtBox, models.db.Row tyuukiRow) { if (tyuukiRow == null) { txtBox.Text = ""; } else { txtBox.Text = tyuukiRow.GetStr(txtBox.Tag as string); } }
private void SetNullData() { tyuukiRow = null; tyuukiId = -1; form.SetTyuukiRow(tyuukiRow); string gridSql = "where tyuuki_id=" + tyuukiId; tyuuki8GridController.SetQuery(gridSql); tyuuki10GridController.SetQuery(gridSql); tyuuki11GridController.SetQuery(gridSql); }
// validate private void ValidateKihyoubi(models.db.KaikeiDatabase db, models.db.Row row) { if (!models.Validator.CheckKihyoubiFormatIsValid(db, row)) { ShowMsgDelay(KaikeiSystemBody.Properties.Resources.MsgInvalidDate, "warn"); } else if (!models.Validator.CheckKihyoubiIsInNendoKisanbi(db, row)) { ShowMsgDelay(KaikeiSystemBody.Properties.Resources.MsgKihyoubiOutOfRange, "warn"); } }
private void ValidateKashikataHojoSeiri(models.db.KaikeiDatabase db, models.db.Row row, bool kamokuCheck = true) { if (kamokuCheck && !models.Validator.CheckHojoSeiriIsFitInKamokuCode(db, row, models.constants.Taisyaku.Kashikata)) { gridController.ShowMsgAndChangeFocus(KaikeiSystemBody.Properties.Resources.MsgHojoSeiriNotFound, "warn", "kashikata_hojo_seiri"); } else if (!models.Validator.CheckHojoSeiriIsFitInKaikeiKubun(db, row, models.constants.Taisyaku.Kashikata)) { gridController.ShowMsgAndChangeFocus(KaikeiSystemBody.Properties.Resources.MsgInvaidHojoSeiri, "warn", "kashikata_hojo_seiri"); } }
private void ValidateKamokuCode(models.db.KaikeiDatabase db, models.db.Row row, models.constants.Taisyaku taisyaku) { /* if(models.Validator.IsHurikaeTaisyouKamokuCode(db, row, taisyaku)){ * gridController.ShowMsgAndChangeFocus(KaikeiSystemBody.Properties.Resources.MsgHurikaeTaisyouKamoku, "warn", null); * } */ if (!models.Validator.IsUseableKamokuCode(db, row, taisyaku)) { gridController.ShowMsgAndChangeFocus(KaikeiSystemBody.Properties.Resources.MsgShiyouKubun, "warn", null); } }