コード例 #1
0
        public IkkatsuSyoriMasterFormController()
        {
            form           = new KaikeiSystemBody.views.IkkatsuSyoriMasterForm();
            gridController = new grid.DBPanelGridController <views.grid.IkkatsuSyoriMasterRow>(form.Grid, true);
            gridController.ValidateColumnValue += Grid_ValidateColumnValue;

            form.MenuButtonClicked          += () => MainController.PopActivity();
            form.KaikeiDenpyouButtonClicked += delegate() {
                MainController.SwitchActivity(
                    controllers.MainController.ActivityType.KaikeiDenpyou,
                    controllers.MainController.ActivitySwitchMethod.Change,
                    Context,
                    null);
            };
            form.KamokuButtonClicked  += () => kamokuPopupControlelr.ShowPopup(form);
            form.TekiyouButtonClicked += () => tekiyouPopupController.ShowPopup(form);
            form.NewButtonClicked     += () => form.Grid.SelectBottomRow();

            kamokuPopupControlelr                      = new popup.KamokuPopupController();
            kamokuPopupControlelr.RowClicked          += this.KamokuPopupGridRowClicked;
            hojoKamokuPopupController                  = new popup.HojoKamokuPopupController();
            hojoKamokuPopupController.RowClicked      += this.HojoKamokuPopupGridRowClicked;
            kamokuPopupControlelr.HojoKamokuController = hojoKamokuPopupController;
            tekiyouPopupController                     = new popup.TekiyouPopupController();
            tekiyouPopupController.RowClicked         += TekiyouPopupGridRowClicked;
        }
コード例 #2
0
        public SyuushiKakuninFormController()
        {
            form = new KaikeiSystemBody.views.SyuushiKakuninForm();
            form.TargetDateChanged    += TargetDateChanged;
            form.ShowAllButtonClicked += ShowAllButtonClicked;

            form.ShowAddDenpyouViewButtonClicked += delegate() {
                this.MainController.SwitchActivity(
                    controllers.MainController.ActivityType.KaikeiDenpyou,
                    controllers.MainController.ActivitySwitchMethod.Change,
                    this.Context,
                    KaikeiDenpyouFormController.QueryType.EditingRows
                    );
            };

            form.ShowEditDenpyouViewButtonClicked += delegate() {
                this.MainController.SwitchActivity(
                    controllers.MainController.ActivityType.KaikeiDenpyou,
                    controllers.MainController.ActivitySwitchMethod.Change,
                    this.Context,
                    KaikeiDenpyouFormController.QueryType.CurrentYear
                    );
            };

            form.ReturnToMenuButtonClicked += delegate() {
                this.MainController.PopActivity();
            };

            gridController = new grid.DBPanelGridController <views.grid.SyuushiKakuninRow>(form.Grid, false);
        }
コード例 #3
0
        public KanjouKamokuFormController()
        {
            form = new KaikeiSystemBody.views.KanjouKamokuForm();

            gridController = new grid.DBPanelGridController <views.grid.KanjouKamokuRow>(form.Grid, false);

            form.MenuButtonClicked   += () => MainController.PopActivity();
            form.DetailButtonClicked += delegate(object sender) {
                if (sender != null && (sender as views.grid.AbstractDBGridRow).RowData != null)
                {
                    var popupController = new controllers.popup.KanjouKamokuDetailPopupController();
                    popupController.Context = this.Context;
                    popupController.ShowPopup(form, form.Grid.SelectedRowControl.RowData, bufferedKanjouKamokuTable);
                    Context.KaikeiDatabase.MTKanjouKamoku.UpdateCache();
                    Context.KaikeiDatabase.MTKamokuKubun.UpdateCache();
                    gridController.Refresh();
                }
            };
            form.AddButtonClicked += delegate() {
                var popupController = new controllers.popup.KanjouKamokuDetailPopupController();
                popupController.Context = this.Context;
                popupController.ShowPopup(form, null, bufferedKanjouKamokuTable);
                Context.KaikeiDatabase.MTKanjouKamoku.UpdateCache();
                Context.KaikeiDatabase.MTKamokuKubun.UpdateCache();
                gridController.Refresh();
            };
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public KaikeiTanniFormController()
        {
            form           = new KaikeiSystemBody.views.KaikeiTanniForm();
            gridController = new grid.DBPanelGridController <views.grid.KaikeiTanniRow>(form.Grid, true);

            form.MenuButtonClicked += () => MainController.PopActivity();
        }
コード例 #6
0
        public KaikeiDenpyouFormController()
        {
            form_ = new views.KaikeiDenpyouForm();
            form_.ReturnToMenuButtonClicked      += () => MainController.PopActivity();
            form_.ShowAllDataButtonClicked       += () => ChangeQuery(QueryType.All, null);
            form_.ShowCurrentYearButtonClicked   += () => ChangeQuery(QueryType.CurrentYear, null);
            form_.ToggleInvalidDataButtonClicked += delegate() {
                if (queryType == QueryType.InvalidRows)
                {
                    ChangeQuery(QueryType.CurrentYear, null);
                }
                else
                {
                    ChangeQuery(QueryType.InvalidRows, null);
                }
            };
            form_.NewRowButtonClicked               += () => form_.Grid.SelectBottomRow();
            form_.CopyCommentCalled                 += Row_CopyComment;
            form_.CopyKarikataCalled                += Row_CopyKarikata;
            form_.CopyKashikataCalled               += Row_CopyKashikata;
            form_.CopyRowCalled                     += Row_CopyRow;
            form_.SetStatusMessage                  += SetStatusMessage;
            form_.ShowKamokuPopupButtonClicked      += ShowKamokuPopup;
            form_.ShowTekiyouPopupButtonClicked     += ShowTekiyouPopup;
            form_.ShowSubfunctionPopupButtonClicked += ShowSubfunctionPopup;

            queryType = QueryType.None;
            sql_      = "";

            gridController = new grid.DBPanelGridController <views.grid.KaikeiDenpyouRow>(form_.Grid, true);

            gridController.InitInsertedRow        += Grid_InitInsertedRow;
            gridController.ValidateColumnValue    += Grid_ValidateColumnValue;
            gridController.Column_LostFocusAction += Column_LostFocus;
            gridController.ValidateRowValue       += Grid_ValidateRowValue;
            gridController.SetStatusMessage       += SetStatusMessage;
            gridController.RowClicked             += RowClicked;
            gridController.RowUpdated             += Grid_RowUpdated;
            gridController.RowDeleted             += Grid_RowDeleted;

            kamokuPopupControlelr                                       = new popup.KamokuPopupController();
            kamokuPopupControlelr.RowClicked                           += this.KamokuPopupGridRowClicked;
            hojoKamokuPopupController                                   = new popup.HojoKamokuPopupController();
            hojoKamokuPopupController.RowClicked                       += this.HojoKamokuPopupGridRowClicked;
            kamokuPopupControlelr.HojoKamokuController                  = hojoKamokuPopupController;
            tekiyouPopupController                                      = new popup.TekiyouPopupController();
            tekiyouPopupController.RowClicked                          += TekiyouPopupGridRowClicked;
            subfunctionPopupController                                  = new popup.SubfunctionPopupController();
            denpyouBangouSeiriPopupController                           = new popup.DenpyouBangouSeiriPopupController();
            denpyouBangouSeiriPopupController.DenpyouBangouUpdated     += () => this.gridController.Refresh();
            denpyouBangouSeiriPopupController.ReturnToSubfunctionPopup += () => this.ShowSubfunctionPopup();
            ikkatsuSyoriPopupController                                 = new popup.IkkatsuSyoriPopupController();
            ikkatsuSyoriPopupController.DenpyouInerted                 += () => this.ChangeQuery(queryType, "1=1");

            kessanSyuuryouChkIsVisible = true;
            ChangeKessanSyuuryouChkVisibility();
        }
コード例 #7
0
        public DaikubunFormController()
        {
            form           = new KaikeiSystemBody.views.DaikubunForm();
            gridController = new grid.DBPanelGridController <views.grid.DaikubunRow>(form.Grid, true);
            gridController.InitInsertedRow += delegate(models.db.Row row) {
                row.Table.SetColumnValue(row, "has_child", false);
                row.Table.SetColumnValue(row, "parent_id", -1);
                row.Table.SetColumnValue(row, "hierarchy", (int)models.constants.MTKamokuKubunHierarchy.Daikubun);
                row.Table.SetColumnValue(row, "kanjou_kamoku_id", -1);

                int maxDisplayOrder = row.Table.GetMax("display_order", "where hierarchy=" + (int)models.constants.MTKamokuKubunHierarchy.Daikubun);
                row.Table.SetColumnValue(row, "display_order", maxDisplayOrder + 1);
            };

            form.MenuButtonClicked += () => MainController.PopActivity();
        }
コード例 #8
0
        public KoteiShisanFormController()
        {
            form            = new KaikeiSystemBody.views.KoteiShisanForm();
            focusController = new misc.FocusController(form);
            gridController  = new grid.DBPanelGridController <views.grid.KoteiShisanRow>(form.Grid, false);
            popupController = new popup.KoteiShisanDetailPopupController();

            form.ShowAllButtonClicked += ShowAllRows;
            form.SelectButtonClicked  += () => ShowSelectedKaikeiKubunRows(form.KaikeiKubun);
            form.DetailButtonClicked  += DetailButtonClicked;
            form.NewButtonClicked     += () => ShowDetailPopup(-1);
            form.MenuButtonClicked    += () => MainController.PopActivity();

            foreach (var row in form.Grid.AllRowControls())
            {
                (row as views.grid.KoteiShisanRow).DetailButtonClicked += DetailButtonClicked;
            }
        }
コード例 #9
0
        public HoujinShisetsuFormController()
        {
            form           = new KaikeiSystemBody.views.HoujinShisetsuForm();
            gridController = new grid.DBPanelGridController <views.grid.HoujinShisetsuRow>(form.HoujinShisetsuGrid, true);

            form.HoujinDantaiRow.Column_UpdateValueAction += delegate(views.grid.AbstractPanelGridRow rowControl, string column, object value) {
                var row   = (rowControl as views.grid.AbstractDBGridRow).RowData;
                var table = row.Table;
                var db    = Context.KaikeiDatabase;

                if (table.SetColumnValue(row, column, value))
                {
                    table.Update(row);
                }
                else
                {
                    // ShowMsgAndChangeFocus(KaikeiSystemBody.Properties.Resources.MsgInvalidInput.Replace("%s", value.ToString()), "err", column);
                }
                (rowControl as views.grid.AbstractDBGridRow).SetRowData(row, true);    // 表示の更新
            };
            gridController.InitInsertedRow += delegate(models.db.Row row) {
                row.Table.SetColumnValue(row, "parent_id", 1);
                row.Table.SetColumnValue(row, "kubun_code", row.Table.GetMax("kubun_code") + 1);
            };
            gridController.RowUpdated += delegate(views.grid.HoujinShisetsuRow row) {
                Context.KaikeiDatabase.MTKaikeiKubun.UpdateCache();
                gridController.ResetMasterTableInfo();

                delayTimerController.SetDelayedProc(delegate() {
                    CheckParentKubunYosan(row.RowData);
                });
            };

            form.CloseButtonClicked += () => MainController.PopActivity();

            delayTimerController = new misc.DelayTimerController(form);
        }
コード例 #10
0
        public TekiyouFormController()
        {
            form           = new KaikeiSystemBody.views.TekiyouForm();
            gridController = new grid.DBPanelGridController <views.grid.TekiyouRow>(form.Grid, true);
            gridController.InitInsertedRow += delegate(models.db.Row row) {
                tekiyouTable.SetColumnValue(row, "tekiyou_code", tekiyouTable.GetMax("tekiyou_code") + 1);
            };
            gridController.ValidateColumnValue += delegate(views.grid.TekiyouRow row_control, string column, object value) {
                var row = row_control.RowData;
                var db  = Context.KaikeiDatabase;

                if (column == "tekiyou_mei")
                {
                    row_control.FireColumnUpdateValueEvent("tekiyou_yomi");
                }
            };
            gridController.ValidateRemoveRow += delegate(views.grid.TekiyouRow rowControl) {
                long ct = Context.KaikeiDatabase.KaikeiDenpyouMeisai.RowCount("where tekiyou_id = " + rowControl.RowData.GetLong("tekiyou_code", -1));

                if (ct > 0)
                {
                    helper.MsgBox.Err(KaikeiSystemBody.Properties.Resources.MsgUsedTekiyouCanntRemove);
                    return(false);
                }
                else
                {
                    var res = System.Windows.Forms.MessageBox.Show(KaikeiSystemBody.Properties.Resources.MsgConfirmToDeleteRow,
                                                                   KaikeiSystemBody.Properties.Resources.CaptionConfirm,
                                                                   System.Windows.Forms.MessageBoxButtons.OKCancel,
                                                                   System.Windows.Forms.MessageBoxIcon.Warning);
                    return(res == System.Windows.Forms.DialogResult.OK);
                }
            };

            form.MenuButtonClicked += () => MainController.PopActivity();
            form.NewButtonClicked  += () => form.Grid.SelectBottomRow();
        }
コード例 #11
0
        public BalanceSheetCommentFormController()
        {
            tyuukiRow = null;

            form = new KaikeiSystemBody.views.BalanceSheetCommentForm();
            form.CloseButtonClicked += () => MainController.PopActivity();

            form.JuuyouKaikeiHoushinHenkouChanged += delegate() {
                if (tyuukiRow != null)
                {
                    tyuukiRow.Table.SetColumnValue(tyuukiRow, "juuyou_henkou", form.JuuyouKaikeiHoushinHenkou);
                    tyuukiRow.Table.Update(tyuukiRow);
                }
            };

            form.JuuyouKouhatsuJisyouChanged += delegate() {
                if (tyuukiRow != null)
                {
                    tyuukiRow.Table.SetColumnValue(tyuukiRow, "juuyou_kouhatsu", form.JuuyouKouhatsuJisyou);
                    tyuukiRow.Table.Update(tyuukiRow);
                }
            };

            form.ExecButtonClicked += delegate() {
                if (form.InputDate != null)
                {
                    if (SetNenndo(form.InputDate.Value.Year) == 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);
                }
            };

            genkaGridController = new grid.DBPanelGridController <views.grid.BSCGenkaRow>(form.GenkaGrid, true);
            genkaGridController.InitInsertedRow += delegate(models.db.Row row) {
                row.Table.SetColumnValue(row, "tyuuki_id", tyuukiId);
            };

            kaikeiHoushinGridController = new grid.DBPanelGridController <views.grid.BSCKaikeiHoushinRow>(form.KaikeiHoushinGrid, true);
            kaikeiHoushinGridController.InitInsertedRow += delegate(models.db.Row row) {
                row.Table.SetColumnValue(row, "tyuuki_id", tyuukiId);
                row.Table.SetColumnValue(row, "seiri_bangou", row.Table.GetMax("seiri_bangou") + 1);
            };

            zaisanGridController = new grid.DBPanelGridController <views.grid.BSCZaisanRow>(form.ZaisanGrid, true);
            zaisanGridController.InitInsertedRow += delegate(models.db.Row row) {
                row.Table.SetColumnValue(row, "tyuuki_id", tyuukiId);
            };

            torikuzushiGridController = new grid.DBPanelGridController <views.grid.BSCTorikuzushiRow>(form.TorikuzushiGrid, true);
            torikuzushiGridController.InitInsertedRow += delegate(models.db.Row row) {
                row.Table.SetColumnValue(row, "tyuuki_id", tyuukiId);
            };

            tanpoGridController = new grid.DBPanelGridController <views.grid.BSCTanpoRow>(form.TanpoGrid, true);
            tanpoGridController.InitInsertedRow += delegate(models.db.Row row) {
                row.Table.SetColumnValue(row, "tyuuki_id", tyuukiId);
            };

            focusController = new misc.FocusController(form);

            tyuukiId = 0;
        }
コード例 #12
0
        public KurikoshiFormController()
        {
            form = new KaikeiSystemBody.views.KurikoshiForm();
            form.SearchButtonClicked += UpdateViews;
            form.AddButtonClicked    += AddButtonClicked;
            form.DeleteButtonClicked += DeleteButtonClicked;
            form.CloseButtonClicked  += () => MainController.PopActivity();

            daikubunGridController  = new grid.DBPanelGridController <views.grid.ZenkiKurikoshiKamokuKubunRow>(form.DaikubunGrid, false);
            chukubunGridController  = new grid.DBPanelGridController <views.grid.ZenkiKurikoshiKamokuKubunRow>(form.ChukubunGrid, false);
            syoukubunGridController = new grid.DBPanelGridController <views.grid.ZenkiKurikoshiKamokuKubunRow>(form.SyoukubunGrid, false);
            hojoGridController      = new grid.DBPanelGridController <views.grid.ZenkiKurikoshiKamokuKubunRow>(form.HojokamokuGrid, false);

            daikubunGridController.RowUpdated  += (row) => DaikubunRowUpdated();
            chukubunGridController.RowUpdated  += (row) => ChukubunRowUpdated();
            syoukubunGridController.RowUpdated += (row) => SyoukubunRowUpdated();
            hojoGridController.RowUpdated      += (row) => HojokamokuRowUpdated();

            daikubunGridController.Row_GotFocusAction += delegate(views.grid.ZenkiKurikoshiKamokuKubunRow row) {
                delayTimerController.SetDelayedProc(delegate() {
                    DaikubunRowSelectionChanged();
                });
            };
            chukubunGridController.Row_GotFocusAction += delegate(views.grid.ZenkiKurikoshiKamokuKubunRow row) {
                delayTimerController.SetDelayedProc(delegate() {
                    ChukubunRowSelectionChanged();
                });
            };
            syoukubunGridController.Row_GotFocusAction += delegate(views.grid.ZenkiKurikoshiKamokuKubunRow row) {
                delayTimerController.SetDelayedProc(delegate() {
                    SyoukubunRowSelectionChanged();
                });
            };
            hojoGridController.Row_GotFocusAction += delegate(views.grid.ZenkiKurikoshiKamokuKubunRow row) {
                delayTimerController.SetDelayedProc(delegate() {
                    HojokamokuRowSelectionChanged();
                });
            };

            form.ZenkimatsuShiharaiShikinZandakaChanged += delegate() {
                delayTimerController.SetDelayedProc(delegate() {
                    var result = MessageBox.Show(
                        KaikeiSystemBody.Properties.Resources.MsgConfirmZenkimatsuShiharaiShikinZandakaChange,
                        form.Text,
                        MessageBoxButtons.OKCancel,
                        MessageBoxIcon.Warning);
                    if (result == DialogResult.OK)
                    {
                        SetZenkimatsuShiharaiShikinZandaka(form.ZenkimatsuShiharaiShikinZandaka);
                        UpdateZenkimatsuShiharaiShikinZandakaTextBox();
                    }
                    else
                    {
                        UpdateZenkimatsuShiharaiShikinZandakaTextBox();
                    }
                });
            };

            form.JikiKurikoshiChanged += delegate() {
                SetJikiKurikoshi(form.JikiKurikoshi);
                UpdateJikiKurikoshiTextBox();
            };

            focusController      = new misc.FocusController(form);
            delayTimerController = new misc.DelayTimerController(form);
        }