Example #1
0
        static void Main(string[] args)
        {
            Console.Title = "GetsujiShiireSyuukeiSyori";

            if (loginbl.ReadConfig() == true)
            {
                //コマンドライン引数を配列で取得する
                string[] cmds = System.Environment.GetCommandLineArgs();

                if (cmds.Length - 1 >= (int)FrmMainForm.ECmdLine.PcID + 1)
                {
                    InOperatorCD   = cmds[(int)FrmMainForm.ECmdLine.OperatorCD];
                    InStoreCD      = cmds[(int)FrmMainForm.ECmdLine.PcID + 1];
                    InProcessMode  = cmds[(int)FrmMainForm.ECmdLine.PcID + 2];
                    InFiscalYYYYMM = cmds[(int)FrmMainForm.ECmdLine.PcID + 3].Replace("/", "");
                }

                gsbl = new GetsujiShimeShori_BL();

                //処理モードを覚える
                M_Control_Entity mce = new M_Control_Entity();
                mce.MainKey = "1";
                Mode        = gsbl.GetMode(mce);

                bool execFlg = false;

                M_StoreClose_Entity me = new M_StoreClose_Entity();
                if (Mode.Equals(1))
                {
                    //Mode		=	1	の場合			(=ALL店舗)
                }
                else if (Mode.Equals(2))
                {
                    //Mode		=	2	の場合			(=店舗ごとに計算)
                    me.StoreCD = InStoreCD;
                }
                bool ret = gsbl.M_StoreClose_SelectAll(me);
                if (ret)
                {
                    //FiscalYYYYMM<Parameter受取	FiscalYYYYMM
                    //またはFiscalYYYYMM=Parameter受取	FiscalYYYYMM&	ClosePosition5=0なら
                    if (gsbl.Z_Set(me.FiscalYYYYMM) <= gsbl.Z_Set(InFiscalYYYYMM))
                    {
                        if (gsbl.Z_Set(me.FiscalYYYYMM) == gsbl.Z_Set(InFiscalYYYYMM))
                        {
                            if (me.ClosePosition5.Equals("0"))
                            {
                                execFlg = true;
                            }
                        }
                        else
                        {
                            execFlg = true;
                        }
                        InFiscalYYYYMM = me.FiscalYYYYMM;
                    }
                }

                if (execFlg)
                {
                    //【データ更新】
                    D_MonthlyPurchase_Entity de = new D_MonthlyPurchase_Entity
                    {
                        PC       = Login_BL.GetHostName(),
                        Operator = InOperatorCD,
                        YYYYMM   = InFiscalYYYYMM,
                        StoreCD  = InStoreCD,
                        Mode     = Mode
                    };

                    api.ExecUpdate(de);
                }
            }
        }
        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();
            }
        }