Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.Title = "ShukkaUriageUpdate";

            if (loginbl.ReadConfig() == true)
            {
                mmpe.ID  = MultiPorpose_BL.ID_ShukkaUriageUpdate;
                mmpe.Key = "1";
                dtMulti  = ediAPI_bl.M_MultiPorpose_SelectID(mmpe);

                //【起動可否確認】
                //条件で獲得できる、汎用マスター.数字型1を、99:99の時刻形式に変換する
                string time = Convert.ToInt16(dtMulti.Rows[0]["Num1"]).ToString("D4");
                time = time.Substring(0, 2) + ":" + time.Substring(2, 2);
                //今の時間が、その時刻より先であれば、以下の処理を行う。
                string now = dtMulti.Rows[0]["HHMISS"].ToString().Substring(0, 5);

                int result = time.CompareTo(now);
                if (result > 0)
                {
                    return;
                }

                //【データ更新】
                D_Sales_Entity de = new D_Sales_Entity();
                de.PC       = Login_BL.GetHostName();
                de.Operator = "Administrator";
                api.ExecUpdate(de);
            }
        }
Exemplo n.º 2
0
        private void RunConsole()
        {
            string programID = "TempoRegiTorihikiReceipt";

            System.Uri u         = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
            string     filePath  = System.IO.Path.GetDirectoryName(u.LocalPath);
            string     Mode      = "2";
            string     depositNo = bbl.SimpleSelect1("52", "", Application.ProductName, "", "").Rows[0]["DepositNO"].ToString();
            string     cmdLine   = InCompanyCD + " " + InOperatorCD + " " + Login_BL.GetHostName() + " " + Mode + " " + depositNo; //parameter

            try
            {
                try
                {
                    cdo.RemoveDisplay(true);
                    cdo.RemoveDisplay(true);
                }
                catch { }
                if (Base_DL.iniEntity.IsDM_D30Used)
                {
                    CashDrawerOpen op = new CashDrawerOpen(); //2020_06_24
                    op.OpenCashDrawer();                      //2020_06_24     << PTK
                }
                var pro = System.Diagnostics.Process.Start(filePath + @"\" + programID + ".exe", cmdLine + "");
                pro.WaitForExit();
                Stop_DisplayService();
            }
            catch
            {
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// to check form is already open
        /// if already open show this form
        /// else show new form
        /// </summary>
        /// <param name="programID"></param>
        private void OpenForm(Button btn, string programID)
        {
            System.Uri u        = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
            string     filePath = System.IO.Path.GetDirectoryName(u.LocalPath);
            string     cmdLine  = " " + mse.CompanyCD + " " + mse.StaffCD + " " + Login_BL.GetHostName();

            btn.Tag = System.Diagnostics.Process.Start(filePath + @"\" + programID + ".exe", cmdLine + "");


            //mse.ProgramID = programID;

            //FormCollection frms = Application.OpenForms;
            //Form openForm = null;
            //foreach (Form frm in frms)
            //{
            //    if (frm.Text.Equals(programID))
            //    {
            //        openForm = frm;
            //    }
            //}

            //if (openForm != null)
            //{
            //    openForm.Show();
            //    openForm.WindowState = FormWindowState.Normal;
            //}
            //else
            //{
            //    switch (programID)
            //    {
            //        case "MasterTouroku_Souko": FrmMasterTouroku_Souko frmmts = new FrmMasterTouroku_Souko(mse);
            //            break;
            //    }
            //}
        }
        private void RunConsole(string programID, string YYYYMM)
        {
            System.Uri u        = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
            string     filePath = System.IO.Path.GetDirectoryName(u.LocalPath);
            string     Mode     = "1";
            string     cmdLine  = InOperatorCD + " " + Login_BL.GetHostName() + " " + StoreCD + " " + Mode + " " + YYYYMM;//parameter

            System.Diagnostics.Process.Start(filePath + @"\" + programID + ".exe", cmdLine + "");
        }
        private void RunConsole(string programID, string YYYYMM)
        {
            System.Uri u        = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
            string     filePath = System.IO.Path.GetDirectoryName(u.LocalPath);
            string     Mode     = "1";
            string     cmdLine  = " " + InOperatorCD + " " + Login_BL.GetHostName() + " " + StoreCD + " " + " " + Mode + " " + YYYYMM;//parameter
            string     str      = "GetsujiZaikoKeisanSyori,GetsujiShiireKeisanSyori";

            //System.Diagnostics.Process.Start(filePath + @"\" + programID + ".exe", cmdLine + "");
            System.Diagnostics.Process.Start(filePath + @"\" + str.Substring(0, 22) + ".exe", cmdLine + "");
            System.Diagnostics.Process.Start(filePath + @"\" + str.Substring(24, 23) + ".exe", cmdLine + "");
            //System.Diagnostics.Process.Start(filePath+@"\"+programID+".exe",cmdLine+"");
        }
Exemplo n.º 6
0
        private void OpenForm(object sender)
        {
            try
            {
                var        programID = (sender as CKM_Button).Text;
                var        exe_name  = menu.Select("ProgramID = '" + programID + "'").CopyToDataTable().Rows[0]["ProgramID_ID"].ToString();
                System.Uri u         = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
                string     filePath  = System.IO.Path.GetDirectoryName(u.LocalPath);
                string     cmdLine   = " " + "001" + " " + mse.StaffCD + " " + Login_BL.GetHostName();

                (sender as CKM_Button).Tag = System.Diagnostics.Process.Start(filePath + @"\" + exe_name + ".exe", cmdLine + "");
            }
            catch (Exception ex)
            {
                MessageBox.Show("The program cannot locate to the specified file!!!");
            }
        }
Exemplo n.º 7
0
        private void OpenForm(object sender)
        {
            try
            {
                var programID = (sender as CKM_Button).Text;
                var exe_name  = menu.Select("ProgramID = '" + programID + "'").CopyToDataTable().Rows[0]["ProgramID_ID"].ToString();
                //System.Uri u = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
                //string filePath = System.IO.Path.GetDirectoryName(u.LocalPath);
                string filePath = "";
                //System.Diagnostics.Debug
                if (Debugger.IsAttached || Login_BL.Islocalized)
                {
                    System.Uri u = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
                    filePath = System.IO.Path.GetDirectoryName(u.LocalPath);
                }
                else
                {
                    filePath = @"C:\\SMS\\AppData";
                }
                string cmdLine = " " + "001" + " " + mse.StaffCD + " " + Login_BL.GetHostName();
                //Process[] localByName = Process.GetProcessesByName(exe_name);
                //if (localByName.Count() > 0)
                //{
                //    IntPtr handle = localByName[0].MainWindowHandle;
                //    ShowWindow(handle, SW_SHOWMAXIMIZED);
                //    return;
                //}

                Process[] localByName = Process.GetProcessesByName(exe_name);
                if (localByName.Count() > 0)
                {
                    IntPtr handle = localByName[0].MainWindowHandle;
                    ShowWindow(handle, SW_SHOWMAXIMIZED);
                    SetForegroundWindow(handle);


                    return;
                }
                (sender as CKM_Button).Tag = System.Diagnostics.Process.Start(filePath + @"\" + exe_name + ".exe", cmdLine + "");
            }
            catch (Exception ex)
            {
                MessageBox.Show("The program cannot locate to the specified file!!!");
            }
        }
        private void RunConsole()
        {
            string programID = "TempoRegiTorihikiReceipt";

            System.Uri u        = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
            string     filePath = System.IO.Path.GetDirectoryName(u.LocalPath);
            string     Mode     = "5";

            dtDepositNO = bbl.SimpleSelect1("52", "", Application.ProductName, "", "");
            string DepositeNO = dtDepositNO.Rows[0]["DepositNO"].ToString();
            string cmdLine    = InCompanyCD + " " + InOperatorCD + " " + Login_BL.GetHostName() + " " + Mode + " " + DepositeNO;

            try
            {
                // MessageBox.Show(filePath + @"\" + programID + ".exe", cmdLine + "");
                try
                {
                    // Stop_DisplayService();
                    cdo.RemoveDisplay(true);
                    cdo.RemoveDisplay(true);
                }
                catch {
                    MessageBox.Show("Error in removing . . . .");
                }
                if (Base_DL.iniEntity.IsDM_D30Used)           // Wait
                {
                    CashDrawerOpen op = new CashDrawerOpen(); //ses  <<< PTK
                    op.OpenCashDrawer();
                }
                var pro = System.Diagnostics.Process.Start(filePath + @"\" + programID + ".exe", cmdLine + "");
                // cdo.SetDisplay(true, true, Base_DL.iniEntity.DefaultMessage);
                pro.WaitForExit();
                Stop_DisplayService();
                // RunDisplay_Service();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString() + Environment.NewLine + ex.StackTrace.ToString());
            }
        }
Exemplo n.º 9
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 OpenForm(object sender)
        {
            try
            {
                var programID = (sender as CKM_Button).Text;
                var exe_name  = menu.Select("ProgramID = '" + programID + "'").CopyToDataTable().Rows[0]["ProgramID_ID"].ToString();

                if (Base_DL.iniEntity.IsDM_D30Used && exe_name == "CashDrawerOpen")
                {
                    try
                    {
                        CashDrawerOpen cdo_open = new CashDrawerOpen();
                        cdo_open.OpenCashDrawer();
                        //Base_DL.iniEntity.CDO_DISPLAY = new EPSON_TM30.CashDrawerOpen(); ;
                        //Base_DL.iniEntity.CDO_DISPLAY.OpenCashDrawer();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message + ex.StackTrace);
                    }
                    // op.OpenCashDrawer();
                }
                else

                {
                    //System.Uri u = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
                    //string filePath = System.IO.Path.GetDirectoryName(u.LocalPath);
                    string filePath = "";
                    //System.Diagnostics.Debug
                    if (Debugger.IsAttached || Login_BL.Islocalized)
                    {
                        System.Uri u = new System.Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase);
                        filePath = System.IO.Path.GetDirectoryName(u.LocalPath);
                    }
                    else
                    {
                        filePath = @"C:\\SMS\\AppData";
                    }
                    string cmdLine = " " + "01" + " " + mse.StaffCD + " " + Login_BL.GetHostName();
                    //Process[] localByName = Process.GetProcessesByName(exe_name);
                    //if (localByName.Count() > 0)
                    //{
                    //    IntPtr handle = localByName[0].MainWindowHandle;
                    //    ShowWindow(handle, SW_SHOWMAXIMIZED);
                    //    return;
                    //}

                    //if (exe_name == "TempoRegiHanbaiTouroku" )
                    //{
                    //    try
                    //    {
                    //        if (Base_DL.iniEntity.IsDM_D30Used)
                    //        {
                    //            cdo.RemoveDisplay();
                    //        }
                    //        // Base_DL.Ini_Entity_CDP.CDO_DISPLAY.RemoveDisplay();
                    //    }
                    //    catch
                    //    {
                    //        MessageBox.Show("Reclick on HBT");
                    //    }
                    //}
                    RejectDisplay(exe_name);
                    Process[] localByName = Process.GetProcessesByName(exe_name);
                    if (localByName.Count() > 0)
                    {
                        //if (programID.TrimEnd() == "販売登録" || exe_name == "TempoRegiHanbaiTouroku" || exe_name == "TempoRegiHanbaiTouroku.exe")
                        //{
                        //  //  Login_BL bbl_1 = new Login_BL();
                        // //   bbl_1.Display_Service_Update(false);
                        //}
                        IntPtr handle = localByName[0].MainWindowHandle;
                        ShowWindow(handle, SW_SHOWMAXIMIZED);
                        SetForegroundWindow(handle);
                        return;
                    }


                    //if (P)
                    //   (sender as CKM_Button).Tag = System.Diagnostics.Process.Start(filePath + @"\" + exe_name + ".exe", cmdLine + "");   //original

                    ///ptk
                    /// (sender as CKM_Button).Tag = System.Diagnostics.Process.Start(filePath + @"\" + exe_name + ".exe", cmdLine + "");
                    //if (programID.TrimEnd() == "販売登録" || exe_name == "TempoRegiHanbaiTouroku")
                    //{
                    //    try
                    //    {
                    //        using (Process exeProcess = Process.Start(filePath + @"\" + exe_name + ".exe", cmdLine + ""))
                    //        {
                    //            if (Base_DL.iniEntity.IsDM_D30Used)
                    //            {
                    //                exeProcess.WaitForExit();
                    //                cdo.SetDisplay(true, true, Base_DL.iniEntity.DefaultMessage);
                    //            }
                    //        }
                    //    }
                    //    catch (Exception ex)
                    //    {
                    //        MessageBox.Show(ex.Message + filePath + @"\" + exe_name + ".exe");
                    //    }

                    //}
                    //else
                    //{
                    (sender as CKM_Button).Tag = System.Diagnostics.Process.Start(filePath + @"\" + exe_name + ".exe", cmdLine + "");
                    //}
                    ///ptk
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("The program cannot locate to the specified file!!!");
            }
        }