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; }
public void InitRowsWithMTKanjouKamokuFilterByDaikubun(models.db.mtables.MTKanjouKamoku table, models.db.mtables.MTKamokuKubun kubunTable, int daikubunId, string kubunColName, string orderBy = "kamoku_code") { this.ClearRows(); this.InitColumns(4, 3, 0); this.SetColumnVisibility(3, false); string daikubunStr = ""; string sql = string.Format( " as a left join {0} as kubun1 on a.{3} = kubun1.id" + " left join {0} as kubun2 on kubun1.parent_id = kubun2.id where kubun2.id = {1} order by {2}", kubunTable.TableName, daikubunId, orderBy, kubunColName ); daikubunStr = kubunTable.GetFirst("name", "where id = " + daikubunId) as string; if (daikubunStr == null) { daikubunStr = ""; } foreach (var row in table.Select(sql)) { this.AddRow(row.GetStr("kamoku_code", "00000"), daikubunStr, row.GetStr("kamoku", ""), row.GetLong("id", 0)); } this.AdjustDropDownWidth(); bindedTable = table; }
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; }
// 会計区分 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(); } }
// 科目 (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; }
// 貸借区分 public void InitRowsWithMTTaisyakuKubun(models.db.mtables.MTTaisyakuKubun table, string orderBy = "id") { this.ClearRows(); this.InitColumns(2, 1, 0); this.SetColumnVisibility(1, false); foreach (var row in table.Select(" order by " + orderBy)) { this.AddRow(row.GetStr("caption", ""), row.GetLong("id", -1)); } this.AdjustDropDownWidth(); bindedTable = table; }
// 大区分 public void InitRowsWithMTDaikubun(models.db.mtables.MTDaikubun table, string orderBy = "daikubun_code") { this.ClearRows(); this.InitColumns(2, 1, 0); this.SetColumnVisibility(1, false); foreach (var row in table.Select("order by " + orderBy)) { this.AddRow(row.GetStr("daikubun", ""), row.GetStr("daikubun_code", "000")); } this.AdjustDropDownWidth(); bindedTable = table; }
// 貸借対照項目 // id (invisible, key) // caption (caption) public void InitRowsWithMTTaisyakuTaisyouKoumoku(models.db.mtables.MTTaisyakuTaisyouKoumoku table) { this.ClearRows(); this.InitColumns(2, 0, 1); this.SetColumnVisibility(0, false); foreach (var key in table.RowCache.Keys) { this.AddRow(key, table.RowCache[key].GetStr("caption")); } this.AdjustDropDownWidth(); bindedTable = table; }
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; }
// 取引区分 // torihiki_kubun_id (invisible, key) // torihiki_kubun (caption) public void InitRowsWithMTTorihikiKubun(models.db.mtables.MTTorihikiKubun table) { this.ClearRows(); this.InitColumns(2, 0, 1); this.SetColumnVisibility(0, false); foreach (var key in table.RowCache.Keys) { this.AddRow(key, table.RowCache[key].GetStr("torihiki_kubun")); } this.AdjustDropDownWidth(); bindedTable = table; }
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; }
// 科目区分 (親区分は表示しない) public void InitRowsWithMTKamokuKubunWithoutParent(models.db.mtables.MTKamokuKubun table, int hierarchy, string orderBy = "display_order") { this.ClearRows(); this.InitColumns(2, 0, 1); this.SetColumnVisibility(0, false); foreach (var parentRow in table.Select("where hierarchy = " + (hierarchy - 1) + " order by " + orderBy)) { foreach (var row in table.Select("where parent_id = " + parentRow.GetLong("id", -1) + " order by " + orderBy)) { this.AddRow(row.GetLong("id", -1), row.GetStr("name", "")); } } this.AdjustDropDownWidth(); bindedTable = table; }
// 法人施設(経理区分) // keiri_kubun_id (invisible, key) // keiri_kubun (caption) public void InitRowsWithMTHoujinShisetsu(models.db.mtables.MTHoujinShisetsu table, bool showAll) { this.ClearRows(); this.InitColumns(2, 0, 1); this.SetColumnVisibility(0, false); foreach (var key in table.RowCache.Keys) { if (key == 99 && showAll == false) // "すべて"は表示しない { continue; } this.AddRow(key, table.RowCache[key].GetStr("shisetsu_meisyou")); } this.AdjustDropDownWidth(); bindedTable = table; }
// 科目 (caption: 科目コード) public void InitRowsWithMTKanjouKamokuWithKamokuCodeCaption(models.db.mtables.MTKanjouKamoku table, int parentId, string orderBy = "kamoku_code", int hierarchy = 1) { this.ClearRows(); this.InitColumns(2, 0, 0); foreach (var row in table.Select("where parent_id = " + parentId + " order by " + orderBy)) { this.AddRow(row.GetStr("kamoku_code", "00000"), row.GetStr("kamoku", "")); if (hierarchy == 1) { continue; } foreach (var row2 in table.Select("where parent_id = " + row.GetLong("id", -1) + " order by " + orderBy)) { this.AddRow(row2.GetStr("kamoku_code", "00000"), " " + row2.GetStr("kamoku", "")); } } this.AdjustDropDownWidth(); bindedTable = table; }
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; }
public DBPanelGridController(PanelGrid <Type> grid, bool newRowIsVisible) { table_ = null; new_row_ = null; sql_ = ""; ShowInvalidColumnValueMessage = true; grid_ = grid; grid_.UpdateRowsAction += (begin, end) => RefreshRows(begin, end, false); grid_.NewRowIsVisible = newRowIsVisible; foreach (var row in grid_.AllRowControls()) { row.Column_BeforeChangeValueAction += Column_BeforeChangeValue; row.Column_UpdateValueAction += Column_UpdateValue; row.Column_LostFocusAction += Column_LostFocus; row.RemoveAction += Row_Remove; row.Leave += Row_LostFocus; row.Enter += Row_GotFocus; row.SetStatusMessageAction += delegate(string msg) { if (SetStatusMessage != null) { SetStatusMessage(msg); } }; row.RowClicked += delegate(AbstractPanelGridRow sender) { if (RowClicked != null) { RowClicked(sender as Type); } }; } delayTimerController = new misc.DelayTimerController(); }
public void InitRowsWithTaisyakuKanjouKamoku(models.db.mtables.MTKanjouKamoku table, models.db.mtables.MTKamokuKubun kamokuKubun, string orderBy = "kamoku_code") { this.ClearRows(); this.InitColumns(4, 3, 0); this.SetColumnVisibility(3, false); string sql = string.Format( "where hierarchy = {0} and taisyaku_kamoku_kubun_id <> -1 order by {1}", (int)models.constants.MTKanjouKamokuHierarchy.ChuuKubun, orderBy ); foreach (var row in table.Select(sql)) { string daikubunStr = ""; models.db.Row kubunRow = kamokuKubun.GetFirstRow("where id = " + row.GetLong("taisyaku_kamoku_kubun_id", -1)); if (kubunRow == null) { continue; } models.db.Row daikubunRow = kamokuKubun.GetFirstRow("where id = " + kubunRow.GetLong("parent_id", -1)); if (daikubunRow != null) { if ((int)daikubunRow.GetLong("id", -1) == (int)models.constants.MTKamokuKubun.JikiKurikoshikatsudouZougenSagakuDaikubun) { continue; } daikubunStr = daikubunRow.GetStr("name", ""); } this.AddRow(row.GetStr("kamoku_code", "00000"), daikubunStr, row.GetStr("kamoku", ""), row.GetLong("id", 0)); } this.AdjustDropDownWidth(); bindedTable = table; }
public void SetTable(models.db.AbstractTable table) { table_ = table; new_row_ = table_.NewRow(); SetMasterTableForRows(table.OwnerDB); }