protected override void ExecDisp() { //if (CboStoreCD.SelectedValue == null) // return; M_StoreClose_Entity me = new M_StoreClose_Entity { StoreCD = CboStoreCD.SelectedValue == null ? "": CboStoreCD.SelectedValue.ToString(), FiscalYYYYMM = lblChangeDate.Text.Replace("/", ""), Operator = InOperatorCD, Mode = Mode }; if (Mode.Equals(1)) { M_Store_Entity mse = new M_Store_Entity(); mse.ChangeDate = gsbl.GetDate(); me.StoreCD = gsbl.GetHonsha(mse); } bool ret = gsbl.M_StoreClose_SelectAll(me); if (!ret) { //Insertしたあとに再度Select ret = gsbl.M_StoreClose_SelectAll(me); } if (!string.IsNullOrWhiteSpace(me.FiscalYYYYMM)) { lblChangeDate.Text = me.FiscalYYYYMM.Substring(0, 4) + "/" + me.FiscalYYYYMM.Substring(4, 2); lblKakutei.Text = lblChangeDate.Text; } SetProperty(me.ClosePosition1, lblUriage, BtnUriage); SetProperty(me.ClosePosition3, lblNyukin, BtnNyukin); SetProperty(me.ClosePosition2, lblShiire, BtnShiire); SetProperty(me.ClosePosition4, lblShiharai, BtnShiharai); SetProperty(me.ClosePosition5, lblZaiko, BtnZaiko); SetPropertyShukei(me.MonthlyClaimsFLG, lblSaiken, BtnSaiken); SetPropertyShukei(me.MonthlyDebtFLG, lblSaimu, BtnSaimu); SetPropertyShukei(me.MonthlyStockFLG, lblZaikoShukei, BtnZaikoShukei); BtnAllShukei.Text = "まとめて\n計算する"; BtnKakutei.Text = "確定する(翌月度へ)"; BtnKaijo.Text = "解除する(前月度へ)"; if (me.ClosePosition1.Equals("1") && me.ClosePosition2.Equals("1") && me.ClosePosition3.Equals("1") && me.ClosePosition4.Equals("1") && me.ClosePosition5.Equals("1") && me.MonthlyClaimsFLG.Equals("1") && me.MonthlyDebtFLG.Equals("1") && me.MonthlyStockFLG.Equals("1")) { BtnKakutei.BackColor = Color.FromArgb(255, 192, 0); BtnKakutei.Enabled = true; BtnKaijo.Enabled = true; } else { BtnKakutei.BackColor = Color.FromArgb(255, 255, 0); BtnKakutei.Enabled = false; BtnKaijo.Enabled = true; } }
private void Form_Load(object sender, EventArgs e) { try { base.InProgramID = ProID; base.InProgramNM = ProNm; this.SetFunctionLabel(EProMode.BATCH); this.InitialControlArray(); Btn_F12.Text = ""; //起動時共通処理 base.StartProgram(); gsbl = new GetsujiShimeShori_BL(); SetFuncKeyAll(this, "100001000001"); Scr_Clr(0); //処理モードを覚える M_Control_Entity mce = new M_Control_Entity(); mce.MainKey = "1"; Mode = gsbl.GetMode(mce); if (Mode.Equals(1)) { //Mode=1の場合 全社モード(店舗を選ぶことができない) //画面はLable表示 CboStoreCD.Visible = false; lblStore.Visible = true; } else { //Mode=2の場合 店舗モード(店舗は選ぶことができる) CboStoreCD.Visible = true; lblStore.Visible = false; string ymd = gsbl.GetDate(); //画面はListBox表示 CboStoreCD.Bind(ymd, InOperatorCD); //コマンドライン引数を配列で取得する string[] cmds = System.Environment.GetCommandLineArgs(); if (cmds.Length - 1 == (int)FrmMainForm.ECmdLine.PcID + 1) { InStoreCD = cmds[(int)FrmMainForm.ECmdLine.PcID + 1]; CboStoreCD.SelectedValue = InStoreCD; } else { CboStoreCD.SelectedValue = StoreCD; } } //画面転送表00に従って、画面表示 ExecDisp(); //Mode = 2 の場合 //レコ―ドが無い場合、 テーブル転送仕様Aに従ってInsert M_StoreClose } catch (Exception ex) { //エラー時共通処理 MessageBox.Show(ex.Message); EndSec(); } }