예제 #1
0
        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);
        }
        private void ChangeQuery(DateTime?targetDate)
        {
            (gridController.DBTable as models.db.tables.KaikeiDenpyouMeisai).UpdateEditingRows();

            var condition = "where (1=1)";

            if (targetDate == null)
            {
                form.TargetDate = targetDate;

                var kisanbi = Context.Setting.GetStr("nenndo_kisanbi", "");
                if (kisanbi != "" && helper.Converter.IsDateStr(kisanbi))
                {
                    int kisaibi_int = helper.Converter.DateTimeToInt(helper.Converter.DateStrToDateTime(kisanbi));
                    condition += "and kihyoubi >= " + kisaibi_int.ToString();
                }
            }
            else
            {
                int min = targetDate.Value.Year * 10000 + targetDate.Value.Month * 100 + 0;
                int max = targetDate.Value.Year * 10000 + targetDate.Value.Month * 100 + 99;
                condition += string.Format("and {0} <= kihyoubi and kihyoubi <= {1}", min, max);
            }

            var sortOrder = " order by kihyoubi, id";

            gridController.SetQuery(condition + sortOrder);

            {
                long sum = Context.KaikeiDatabase.KaikeiDenpyouMeisai.SelectSum("karikata_kingaku", condition);
                form.SumAmountText = helper.Converter.LongToAmount(sum);
            }
        }
        // events

        override protected void OnActivated(object option)
        {
            tekiyouTable = new models.db.BufferedTable(Context.KaikeiDatabase.MTTekiyou);
            tekiyouTable.SqlCondition = "order by tekiyou_code";
            tekiyouTable.SyncRowList();
            gridController.SetTable(tekiyouTable);
            gridController.SetQuery("");
        }
        // events

        override protected void OnActivated(object option)
        {
            kaikeiTanniTable = new models.db.BufferedTable(Context.KaikeiDatabase.MTKaikeiTanni);
            kaikeiTanniTable.SqlCondition = "order by id";
            kaikeiTanniTable.SyncRowList();
            gridController.SetTable(kaikeiTanniTable);
            gridController.SetQuery("");
        }
        // events

        override protected void OnActivated(object option)
        {
            torihikiKubunTable = new models.db.BufferedTable(Context.KaikeiDatabase.MTTorihikiKubun);
            torihikiKubunTable.SqlCondition = "order by id";
            torihikiKubunTable.SyncRowList();
            gridController.SetTable(torihikiKubunTable);
            gridController.SetQuery("");
        }
예제 #6
0
        override protected void OnActivated(object option)
        {
            kamokuPopupControlelr.Context     = Context;
            hojoKamokuPopupController.Context = Context;
            tekiyouPopupController.Context    = Context;

            gridController.SetTable(Context.KaikeiDatabase.MTIkkatsuSyori);
            gridController.SetQuery("order by id");
        }
예제 #7
0
        // events

        override protected void OnActivated(object option)
        {
            bufferedKanjouKamokuTable           = new models.db.vtables.BufferedMTKanjouKamoku(Context.KaikeiDatabase);
            bufferedKanjouKamokuTable.Recursive = false;
            bufferedKanjouKamokuTable.RootId    = -1;
            bufferedKanjouKamokuTable.SyncRowList();

            gridController.SetTable(bufferedKanjouKamokuTable);
            gridController.SetQuery("");
        }
        // events

        override protected void OnActivated(object option)
        {
            bufferedKaikeiKubunTable = new models.db.BufferedTable(Context.KaikeiDatabase.MTKaikeiKubun);
            bufferedKaikeiKubunTable.SqlCondition = "where parent_id <> -1 order by kubun_code";
            bufferedKaikeiKubunTable.SyncRowList();

            gridController.SetTable(bufferedKaikeiKubunTable);
            gridController.SetQuery("");

            SetHoujinShisetsuRowData();
        }
        private void UpdateGrids()
        {
            daikubunTable.KamokuKubunParentId = (int)models.constants.MTKamokuKubun.TaisyakuRoot;
            daikubunTable.KamokuKubunDepth    = 2;
            daikubunTable.KaikeiKubunId       = displayKaikeiKubunId;
            daikubunTable.Year = displayYear;
            daikubunTable.WithoutJikiKurikoshi = true;
            daikubunTable.SyncRowList();
            daikubunGridController.SetQuery("");

            //form.DaikubunSumAmount = daikubunTable.SumZenkiKurikoshiGaku();
            DaikubunRowSelectionChanged();
        }
예제 #10
0
        // events

        override protected void OnActivated(object option)
        {
            daikubunTable = new models.db.BufferedTable(Context.KaikeiDatabase.MTKamokuKubun);
            daikubunTable.SyncRowListFunc += delegate(List <models.db.Row> rowList) {
                foreach (var kubunRow in Context.KaikeiDatabase.MTKamokuKubun.Select("where hierarchy=" + ((int)models.constants.MTKamokuKubunHierarchy.Kubun) + " order by display_order"))
                {
                    foreach (var row in Context.KaikeiDatabase.MTKamokuKubun.Select("where parent_id=" + kubunRow.GetLong("id", -1) + " order by display_order"))
                    {
                        models.db.Row newRow = daikubunTable.NewRow();
                        row.CopyColumns(newRow);
                        rowList.Add(newRow);
                    }
                }
            };
            daikubunTable.SyncRowList();
            gridController.SetTable(daikubunTable);
            gridController.SetQuery("");
        }
예제 #11
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);
            }
        }
        private void DaikubunRowSelectionChanged()
        {
            models.db.Row selected = form.DaikubunGrid.SelectedRowControl.RowData;

            if (form.DaikubunGrid.SelectedRowIsVisible && selected != null)
            {
                chukubunTable.KamokuKubunParentId = (int)selected.GetLong("kamoku_kubun_id", -1);
                chukubunTable.KamokuKubunDepth    = 1;
                chukubunTable.KaikeiKubunId       = displayKaikeiKubunId;
                chukubunTable.Year = displayYear;
                chukubunTable.SyncRowList();
            }
            else
            {
                chukubunTable.ClearRows();
            }
            chukubunGridController.SetQuery("", dontMoveFocus: true);
            ChukubunRowSelectionChanged();

            //form.ChukubunSumAmount = chukubunTable.SumZenkiKurikoshiGaku();
        }
예제 #13
0
 private void ShowAllRows()
 {
     table.SqlCondition = "";
     table.SyncRowList();
     gridController.SetQuery("");
 }
        private void ChangeQuery(QueryType query, string filter)
        {
            if (queryType == query && filter == null)
            {
                return;
            }
            queryType = query;
            if (query == QueryType.None)
            {
                return;
            }

            (gridController.DBTable as models.db.tables.KaikeiDenpyouMeisai).UpdateEditingRows();
            insertCt = 0;

            var sql = "where (1=1)";

            if (query == QueryType.All)
            {
            }
            else if (query == QueryType.CurrentYear || query == QueryType.InvalidRows)
            {
                var kisanbi = Context.Setting.GetStr("nenndo_kisanbi", "");
                if (kisanbi != "" && helper.Converter.IsDateStr(kisanbi))
                {
                    int kisaibi_int = helper.Converter.DateTimeToInt(helper.Converter.DateStrToDateTime(kisanbi));
                    if (query == QueryType.CurrentYear)
                    {
                        sql += "and (kihyoubi >= " + kisaibi_int.ToString() + " or editing <> 0)";
                    }
                    else
                    {
                        sql += " and ((kihyoubi >= " + kisaibi_int.ToString() +
                               " and ( karikata_kamoku_id is null or kashikata_kamoku_id is null or karikata_kingaku is null))" +
                               " or editing <> 0)";
                    }
                }
            }
            else if (query == QueryType.EditingRows)
            {
                sql += " and (editing <> 0)";
            }

            if (filter != null)
            {
                sql += " and (" + filter + ")";
            }


            sql += " order by denpyou_bangou";

            form_.ShowInvalidRowButtonChecked = false;
            form_.ShowAllDataButtonChecked    = false;
            form_.ShowCurrentYearDataChecked  = false;
            if (query == QueryType.CurrentYear)
            {
                form_.ShowCurrentYearDataChecked = true;
            }
            else if (query == QueryType.All)
            {
                form_.ShowAllDataButtonChecked = true;
            }
            else if (query == QueryType.InvalidRows)
            {
                form_.ShowInvalidRowButtonChecked = true;
            }

            gridController.SetQuery(sql);
            gridController.SetFocus(0, "kihyoubi_gengou");
            sql_ = sql;
        }