public CmdBLL(WindownApplication _app)
 {
     cmd_ohtcDAO      = _app.CMD_OHTCDao;
     cmd_mcsDao       = _app.CMD_MCSDao;
     vcmd_mcsDao      = _app.VCMD_MCSDao;
     webClientManager = _app.GetWebClientManager();
 }
 public UserBLL(WindownApplication _app)
 {
     app                    = _app;
     OperateDBUser          = new DB_User(app.UserDao, app.UserFuncDao);
     OperateDBUserGroup     = new DB_UserGroup(app.UserGroupDao);
     OperateDBUserGroupFunc = new DB_UserGroupFunc(app.UserFuncDao);
     OperateDBFunctionCode  = new DB_FunctionCode(app.FunctionCodeDao);
 }
        //A0.07 Add End

        public static Boolean isLogin(WindownApplication app)
        {
            string loginUserID = app.LoginUserID;

            if (SCUtility.isEmpty(loginUserID))
            {
                return(false);
            }
            return(true);
        }
        private async void MainForm_Load(object sender, EventArgs e)
        {
            await Task.Run(() => app = WindownApplication.getInstance());

            oHT_Form           = new OHT_Form(this);
            oHT_Form.MdiParent = this;
            oHT_Form.Show();
            oHT_Form.Focus();
            oHT_Form.AutoScroll  = true;
            oHT_Form.WindowState = FormWindowState.Maximized;
        }
 public MapBLL(WindownApplication _app)
 {
     app             = _app;
     objCacheManager = app.ObjCacheManager;
     adrDAO          = app.AddressDao;
     sectionDAO      = app.SectionDao;
     segmentDAO      = app.SegmentDao;
     portDAO         = app.PortDao;
     groupRailDAO    = app.GroupRailDao;
     railDAO         = app.RailDao;
     pointDAO        = app.PointDao;
     portIconDAO     = app.PortIconDao;
 }
        public void Start(WindownApplication _app)
        {
            app = _app;
            //宣告Timer

            //設定呼叫間隔時間為30ms
            _timer.Interval = TimeSpan.FromMilliseconds(5000);

            //加入callback function
            _timer.Tick += _timer_Tick;

            //開始
            _timer.Start();
        }
        public void Start()
        {
            app             = WindownApplication.getInstance();
            HistoricalReply = app.GetHistoricalReplyService();
            // HistoricalReply.loadVhHistoricalInfo();

            HistoricalReply.PlayScheduleChanged += PlayScheduleChangeHandle;
            HistoricalReply.LoadComplete        += setListBox;

            var vh_ids = app.ObjCacheManager.GetVEHICLEs().Select(vh => vh.VEHICLE_ID);

            cmb_vh_id.Items.Add(KEY_WORD_ALL);
            cmb_vh_id.Items.AddRange(vh_ids.ToArray());
        }
Beispiel #8
0
        public void doWork(string workKey, BackgroundWorkItem item)
        {
            try
            {
                byte[]             bytes = item.Param[1] as byte[];
                WindownApplication app   = item.Param[0] as WindownApplication;

                sc.ProtocolFormat.OHTMessage.VEHICLE_INFO vh_info = sc.BLL.VehicleBLL.Convert2Object_VehicleInfo(bytes);
                app.ObjCacheManager.PutVehicle(vh_info);
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
        //A0.07 Add Start
        public static Boolean doLogout(System.Windows.Forms.IWin32Window window, WindownApplication app)
        {
            string  loginUserID   = app.LoginUserID;
            Boolean hasLogout     = false;
            var     confirmResult = TipMessage_Request_Light.Show("Are you sure to log out now?");

            if (confirmResult != DialogResult.Yes)
            {
                hasLogout = false;
                return(false);
            }
            else
            {
                app.logoff();
                hasLogout = true;
                TipMessage_Type_Light.Show("", "Logout success!", BCAppConstants.INFO_MSG);
            }
            return(hasLogout);
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                Task.Run(() => app = WindownApplication.getInstance());
                //System Version
                lbl_SofwVsion_Val.Text = "Version " + WindownApplication.getMainFormVersion("");

                //System Build Date
                IFormatProvider culture     = new CultureInfo("en-US", true);
                string          dtBuildDate = WindownApplication.GetBuildDateTime().ToString("yyyy.MM.dd hh:mm tt", culture);
                lbl_SofwBuildDate_Val.Text = " Build " + dtBuildDate;

                //System Line ID
                setLineStatus();
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
        /// <summary>
        /// A0.04
        /// </summary>
        /// <param name="app"></param>
        /// <param name="targetFormType"></param>
        public static void UpdateUIDisplayByAuthority(WindownApplication app, object targetFormType)
        {
            //PropertyDescriptorCollection properties =
            //TypeDescriptor.GetProperties(targetFormType);
            BindingFlags flag = BindingFlags.Instance | BindingFlags.NonPublic;

            MemberInfo[] memberInfos = targetFormType.GetType().GetMembers(flag);
            //MemberInfo[] memberInfos = typeof(BCMainForm).GetMembers(flag);

            var typeSwitch = new com.mirle.ibg3k0.ohxc.winform.OHxCMainForm.TypeSwitch()
                             .Case((System.Windows.Forms.ToolStripMenuItem tsm, bool tf) => { tsm.Enabled = tf; })
                             .Case((System.Windows.Forms.ComboBox cb, bool tf) => { cb.Enabled = tf; })
                             //.Case((com.mirle.ibg3k0.bc.winform.UI.Components_New.UserControl_Button bt, bool tf) => { bt.Enabled = tf; })
                             .Case((System.Windows.Forms.Label label, bool tf) => { label.Enabled = tf; })
                             .Case((System.Windows.Forms.PictureBox px, bool tf) => { px.Enabled = tf; })
                             //A0.05 .Case((System.Windows.Forms.Button btn, bool tf) => { btn.Enabled = tf; })
                             .Case((CCWin.SkinControl.SkinButton btn, bool tf) => { btn.Enabled = tf; }) //A0.05
                             .Case((UI.Controller.uc_btn_Custom btn, bool tf) => { btn.Visible = tf; }); //A0.09

            foreach (MemberInfo memberInfo in memberInfos)
            {
                Attribute AuthorityCheck = memberInfo.GetCustomAttribute(typeof(AuthorityCheck));
                if (AuthorityCheck != null)
                {
                    string attribute_FUNName = ((AuthorityCheck)AuthorityCheck).FUNCode;
                    //ToolStripMenuItem tsl = (ToolStripMenuItem)((FieldInfo)memberInfo).GetValue(this);
                    FieldInfo info = (FieldInfo)memberInfo;
                    if (app.UserBLL.OperateDBUser.checkUserAuthority(app.LoginUserID, attribute_FUNName))
                    {
                        typeSwitch.Switch(info.GetValue(targetFormType), true);
                    }
                    else
                    {
                        typeSwitch.Switch(info.GetValue(targetFormType), false);
                    }
                }
            }
        }
Beispiel #12
0
        public void start(WindownApplication _app)
        {
            app = _app;
            var vhs = app.ObjCacheManager.GetVEHICLEs();

            totle_vh_count = vhs.Count;
            progress_bar_vehicle_status.Maximum = totle_vh_count;


            switch (ohxc.winform.App.WindownApplication.OHxCFormMode)
            {
            case ohxc.winform.App.OHxCFormMode.CurrentPlayer:
                app.GetSysExcuteQualityQueryService().SysExcuteQualityImageChanged   += Uctl_Map_SysExcuteQualityImageChanged;
                app.GetSysExcuteQualityQueryService().VehicleIdleStatusChanged       += Uctl_Map_VehicleIdleStatusChanged;
                app.GetSysExcuteQualityQueryService().OhxCExcuteEffectivenessChanged += Uctl_Dashboard_OhxCEffectivenessChanged;;
                app.GetSysExcuteQualityQueryService().CurrnetMCSCommandCountChanged  += Uctl_Dashboard_CurrnetMCSCommandCountChanged;
                break;

            case ohxc.winform.App.OHxCFormMode.HistoricalPlayer:
                //trunOffMonitorAllVhStatus();
                break;
            }
        }
 public static Boolean doLogout(WindownApplication app)
 {
     app.logoff();
     return(true);
 }
 public LineBLL(WindownApplication _app)
 {
     app = _app;
 }
Beispiel #15
0
 public PortStationBLL(WindownApplication _app)
 {
     app       = _app;
     OperateDB = new DB(app.PortStationDao);
 }
Beispiel #16
0
 public SysExcuteQualityBLL(WindownApplication app)
 {
     webClientManager = app.GetWebClientManager();
     OlsonTimeZoneID  = WinFromUtility.TimeZoneInfoIDToOlsonTimeZoneID(TimeZoneInfo.Local);
 }
 public VehicleBLL(WindownApplication _app)
 {
     app        = _app;
     cache      = new Cache(app.ObjCacheManager);
     vehicleDAO = app.VehicleDao;
 }
        //BindingSource TransCMD_BindingSource = new BindingSource();
        #endregion 公用參數設定

        /// <summary>
        /// 建構子
        /// </summary>
        /// <param name="_mainForm"></param>
        public OHxC_Form(OHxCMainForm _form)
        {
            try
            {
                InitializeComponent();
                //initFuncKey();
                setFuncKeyClick();
                mainForm = _form;
                app      = mainForm.app;
                uctl_Map.start(app);

                //vehicleObjToShowBindingSource.DataSource = app.ObjCacheManager.GetVehicleObjToShows();
                //uc_grid_VHStatus1.grid_VH_Status.ItemsSource = vehicleObjToShowBindingSource;
                uc_grid_VHStatus1.grid_VH_Status.ItemsSource     = app.ObjCacheManager.GetVehicleObjToShows();
                uc_grid_VHStatus1.grid_VH_Status.PreviewMouseUp += grid_VH_Status_cell_click;

                uctl_Map.BackColor = Color.FromArgb(9, 0, 45);

                mainForm = _form;
                switch (WindownApplication.OHxCFormMode)
                {
                case OHxCFormMode.HistoricalPlayer:
                    //this.splitContainer2.Panel1.Controls.Remove(tableLayoutPanel4);

                    //tableLayoutPanel1.Controls.Remove(tableLayoutPanel4);
                    //uctlHistoricalReplyPlayer = new uctlHistoricalReplyPlayer();
                    //uctlHistoricalReplyPlayer.Dock = DockStyle.Fill;

                    //this.splitContainer2.Panel1.Controls.Add(uctlHistoricalReplyPlayer);
                    //tableLayoutPanel1.Controls.Add(uctlHistoricalReplyPlayer, 0, 0);
                    //uctlHistoricalReplyPlayer.Start();
                    //uctlHistoricalReplyPlayer.FocusVehicle += uctl_Map.FocusVehicleProcess;
                    uctlHistoricalReplyPlayer1.Start();
                    uctlHistoricalReplyPlayer1.FocusVehicle += uctl_Map.FocusVehicleProcess;
                    uctlHistoricalReplyPlayer1.Visible       = true;
                    //tableLayoutPanel1.
                    //tabControl1.TabPages.RemoveAt(1);
                    break;
                }

                foreach (var vh in uctl_Map.m_objItemNewVhcl)
                {
                    vh.VehicleBeChosen += setMonitorVehicle;
                }
                uctl_Map.MapDoubleClick += setMonitorVehicle;
                //TransCMD_BindingSource.DataSource = app.ObjCacheManager.GetMCS_CMD();
                //uc_grid_TransCMD1.grid_MCS_Command.ItemsSource = TransCMD_BindingSource;
                uc_grid_TransCMD1.grid_MCS_Command.ItemsSource = app.ObjCacheManager.GetMCS_CMD();
                uc_grid_CurAlarm1.grid_Cur_Alarm.ItemsSource   = app.ObjCacheManager.GetAlarms();
                uc_grid_SystemLog1.grid_Sys_Log.ItemsSource    = systemProcLst;

                app.ObjCacheManager.VehicleUpdateComplete    += ObjCacheManager_VehicleUpdateComplete;
                app.ObjCacheManager.MCSCommandUpdateComplete += ObjCacheManager_MCSCMDUpdateComplete;
                app.CurrentAlarmChange += ObjCacheManagerCurAlarmUpdateComplete;

                mainForm.MonitorRoadContorlStatusChanged += MainForm_MonitorRoadContorlStatusChanged;

                splitContainer2.SplitterDistance = 195;
                uctl_Map.Width  = 1719;
                uctl_Map.Height = 695;
                logUtility      = LogUtility.getInstance();

                utilityLog_tcp.start <LogTitle_TCP>(BCAppConstants.LogType.TCP_ForEQ.ToString());
                utilityLog_secs.start <LogTitle_SECS>(BCAppConstants.LogType.SECS_ForHost.ToString());
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
 public AlarmBLL(WindownApplication _app)
 {
     alarm_DAO = _app.AlarmDao;
     cache     = new Cache(_app.ObjCacheManager);
 }
Beispiel #20
0
 public SysExcuteQualityQueryService(WindownApplication _app)
 {
     sysExcuteQualityBLL = _app.SysExcuteQualityBLL;
     app = _app;
 }
 public OperationHistoryBLL(WindownApplication _app)
 {
 }
 public ObjCacheManager(WindownApplication _app)
 {
     app = _app;
     //Vehicles = app.VehicleBLL.loadAllVehicle();
     //Line = new ALINE();
 }
Beispiel #23
0
 public SegmentBLL(WindownApplication _app)
 {
     app       = _app;
     OperateDB = new DB(app.SegmentDao);
     webAPI    = new WebAPI(app.GetWebClientManager());
 }
        public static Boolean doLogin(System.Windows.Forms.IWin32Window window, WindownApplication app, string function_code, bool isForceChack, LoginType loginType)//A0.01
        {
            string  loginUserID = app.LoginUserID;
            Boolean hasAuth     = false;

            if (!isForceChack && !SCUtility.isEmpty(loginUserID))
            {
                hasAuth = app.UserBLL.OperateDBUser.checkUserAuthority(loginUserID, function_code);
            }
            if (hasAuth)
            {
                return(true);
            }
            if (!UASUtility.isLogin(app))
            {
                loginType = LoginType.LogIn;
            }
            else
            {
                loginType = LoginType.ExitCheck;
            }

            Form loginForm = null;

            switch (loginType)
            {
            case LoginType.LogIn:
                loginForm = new LoginPopupForm(function_code, isForceChack ? false : UASUtility.isLogin(app));
                break;

            case LoginType.ExitCheck:
                loginForm = new ExitSystemPopupForm(function_code, isForceChack ? false : UASUtility.isLogin(app));
                break;

            default:
                //todo: Log
                return(false);
            }
            System.Windows.Forms.DialogResult result = loginForm.ShowDialog(window);
            loginUserID = (loginForm as ILoginInfo).getLoginUserID();
            if (result == System.Windows.Forms.DialogResult.OK)
            {
                loginForm.Dispose();
            }
            else
            {
                loginForm.Dispose();
                return(false);
            }
            Boolean loginSuccess  = false;
            string  loginPassword = (loginForm as ILoginInfo).getLoginPassword();

            if (!SCUtility.isEmpty(loginUserID))
            {
                loginSuccess = app.UserBLL.OperateDBUser.checkUserPassword(loginUserID, loginPassword);
            }
            if (loginSuccess)
            {
                hasAuth = app.UserBLL.OperateDBUser.checkUserAuthority(loginUserID, function_code);
                if (hasAuth)
                {
                    app.login(loginUserID);
                }
            }
            return(hasAuth);
        }
 public HistoricalReplyService(WindownApplication _app)
 {
     // HistoricalReplyPlayerTimer = new Timer(HistoricalReplyPlayer);
     app = _app;
 }