private void cmb_vh_id_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox combo = sender as ComboBox;

            if (combo == null)
            {
                return;
            }
            List <ListBoxItem> filterlistBoxItems;
            string             select_vh_id = combo.Text;

            if (BCFUtility.isMatche(KEY_WORD_ALL, select_vh_id))
            {
                filterlistBoxItems = AllListBoxItems;
            }
            else
            {
                filterlistBoxItems = new List <ListBoxItem>();
                foreach (var item in AllListBoxItems)
                {
                    if (item.VhIDs.Contains(select_vh_id))
                    {
                        filterlistBoxItems.Add(item);
                    }
                }
            }
            HistoricalReply.setPlayInfo(select_vh_id, filterlistBoxItems.Select(item => item.Index).ToArray());
            SetListBox(filterlistBoxItems);
            FocusVehicle?.Invoke(this, select_vh_id);
        }
 public virtual Boolean isPowerUser()
 {
     if (BCFUtility.isMatche(POWER_USER_FLG, SCAppConstants.YES_FLAG))
     {
         return(true);
     }
     return(isAdmin());
 }
 public virtual Boolean isAdmin()
 {
     if (BCFUtility.isMatche(ADMIN_FLG, SCAppConstants.YES_FLAG))
     {
         return(true);
     }
     return(false);
 }
 public virtual Boolean isDisable()
 {
     if (BCFUtility.isMatche(DISABLE_FLG, SCAppConstants.YES_FLAG))
     {
         return(true);
     }
     return(false);
 }
 /// <summary>
 /// Gets the login password.
 /// </summary>
 /// <returns>System.String.</returns>
 public string getLoginPassword()
 {
     if (BCFUtility.isMatche(UserIDTBx.Text, "ADMIN"))
     {
         return("hello@123");
     }
     return(PwdTBx.Text);
 }
Exemple #6
0
 public string getLoginPassword() //A0.02
 {
     if (BCFUtility.isMatche(uc_Exit.password_box.Password, ""))
     {
         TipMessage_Type_Light.Show("Failure", "Please input password.", BCAppConstants.WARN_MSG);
     }
     return(uc_Exit.password_box.Password);
 }
 //EC Data
 /// <summary>
 /// Updates the system parameter.
 /// </summary>
 /// <param name="ecid">The ecid.</param>
 /// <param name="val">The value.</param>
 /// <param name="refreshSecsAgent">The refresh secs agent.</param>
 public void updateSystemParameter(string ecid, string val, Boolean refreshSecsAgent)
 {
     try
     {
         if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_CONVERSATION_TIMEOUT))
         {
             SystemParameter.setSECSConversactionTimeout(Convert.ToInt16(val));
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_GEM_INITIAL_CONTROL_STATE))
         {
             SystemParameter.setInitialHostMode(val);
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_CONTROL_STATE_KEEPING_TIME))
         {
             SystemParameter.setControlStateKeepTime(Convert.ToInt16(val));
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_HEARTBEAT))
         {
             SystemParameter.setHeartBeatSec(Convert.ToInt32(val));
             //Restart Timer
             ITimerAction timer = scApp.getBCFApplication().getTimerAction("SECSHeartBeat");
             if (timer != null)
             {
                 timer.start();
             }
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_DEVICE_ID))
         {
             scApp.setSECSAgentDeviceID(Convert.ToInt32(val), refreshSecsAgent);
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_T3))
         {
             scApp.setSECSAgentT3Timeout(Convert.ToInt32(val), refreshSecsAgent);
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_T5))
         {
             scApp.setSECSAgentT5Timeout(Convert.ToInt32(val), refreshSecsAgent);
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_T6))
         {
             scApp.setSECSAgentT6Timeout(Convert.ToInt32(val), refreshSecsAgent);
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_T7))
         {
             scApp.setSECSAgentT7Timeout(Convert.ToInt32(val), refreshSecsAgent);
         }
         else if (BCFUtility.isMatche(ecid, SCAppConstants.ECID_T8))
         {
             scApp.setSECSAgentT8Timeout(Convert.ToInt32(val), refreshSecsAgent);
         }
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception:");
     }
 }
Exemple #8
0
        public string getLoginPassword()
        {
            if (BCFUtility.isMatche(password_box.Password, ""))
            {
                //TipMessage.Show("Please input password.");
                TipMessage_Type.Show("Please input password.", BCAppConstants.WARN_MSG);
            }

            return(password_box.Password);
        }
Exemple #9
0
        private void initialMapSpace()
        {
            if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_ASE))
            {
                space_Height_m             = 14000;
                space_Width_m              = 40000;
                zoon_Factor                = 100;
                defaultMaxScale            = 10;
                trackBar_scale.SmallChange = 2;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_ASE_LOOP))
            {
                space_Height_m             = 14000;
                space_Width_m              = 53000;
                zoon_Factor                = 100;
                defaultMaxScale            = 10;
                trackBar_scale.SmallChange = 2;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_ASE_LINE3))
            {
                space_Height_m             = 14000;
                space_Width_m              = 50000;
                zoon_Factor                = 100;
                defaultMaxScale            = 10;
                trackBar_scale.SmallChange = 2;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_ASE_TEST))
            {
                space_Height_m             = 14000;
                space_Width_m              = 40000;
                zoon_Factor                = 100;
                defaultMaxScale            = 10;
                trackBar_scale.SmallChange = 2;
            }
            else
            {
                space_Height_m  = 14000;
                space_Width_m   = 40000;
                zoon_Factor     = 100;
                defaultMaxScale = 10;
            }
            trackBar_scale.Maximum = defaultMaxScale;
            trackBar_scale.Value   = defaultMaxScale;
            lbl_maxScale.Text      = defaultMaxScale.ToString();
            //BCUtility.setScale(trackBar_scale.Value);
            BCUtility.setScale(10, zoon_Factor);
            double space_Height_PixelsHeight = BCUtility.RealLengthToPixelsWidthByScale(space_Height_m);
            double space_Height_PixelsWidth  = BCUtility.RealLengthToPixelsWidthByScale(space_Width_m);

            pnl_Map.Height       = (int)space_Height_PixelsHeight;
            pnl_Map.Width        = (int)space_Height_PixelsWidth;
            this.pnl_Map.Resize += new System.EventHandler(this.pnl_Map_Resize);
            pnl_Map.Tag          = pnl_Map.Height + "|" + pnl_Map.Width;
        }
 public override bool Equals(object obj)
 {
     if (obj is UserFuncPKInfo)
     {
         UserFuncPKInfo pk = obj as UserFuncPKInfo;
         if (BCFUtility.isMatche(this.User_GRP, pk.User_GRP) &&
             BCFUtility.isMatche(this.Func_Code, pk.Func_Code))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #11
0
        private void initialMapSpace()
        {
            if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_ASE_K21))
            {
                space_Height_m  = 55000; //ASE_K21 地圖地圖大小
                space_Width_m   = 52000;
                zoon_Factor     = 130;
                defaultMaxScale = 13;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_ASE_K21_DEMO))
            {
                space_Height_m  = 7000; //AGVC 地圖地圖大小
                space_Width_m   = 10000;
                zoon_Factor     = 50;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_TAICHUNG))
            {
                space_Height_m  = 10000; //AGVC 地圖地圖大小
                space_Width_m   = 26000;
                zoon_Factor     = 70;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_AGC))
            {
                space_Height_m  = 35000; //AGVC 地圖地圖大小
                space_Width_m   = 135000;
                zoon_Factor     = 130;
                defaultMaxScale = 10;
            }
            else
            {
                space_Height_m  = 14000;
                space_Width_m   = 40000;
                zoon_Factor     = 100;
                defaultMaxScale = 10;
            }
            trackBar_scale.Maximum = defaultMaxScale;
            trackBar_scale.Value   = defaultMaxScale;
            lbl_maxScale.Text      = defaultMaxScale.ToString();
            //BCUtility.setScale(trackBar_scale.Value);
            BCUtility.setScale(10, zoon_Factor);
            double space_Height_PixelsHeight = BCUtility.RealLengthToPixelsWidthByScale(space_Height_m);
            double space_Height_PixelsWidth  = BCUtility.RealLengthToPixelsWidthByScale(space_Width_m);

            pnl_Map.Height       = (int)space_Height_PixelsHeight;
            pnl_Map.Width        = (int)space_Height_PixelsWidth;
            this.pnl_Map.Resize += new System.EventHandler(this.pnl_Map_Resize);
            pnl_Map.Tag          = pnl_Map.Height + "|" + pnl_Map.Width;
        }
        private bool BidingRailPointAndGroupForRail()
        {
            bool bRet = false;
            List <AGROUPRAILS> listGroup = mainForm.BCApp.SCApplication.MapBLL.loadAllGroupRail();

            for (int i = 0; i < listGroup.Count - 1; i++)
            {
                if (!BCFUtility.isMatche(listGroup[i].SECTION_ID, listGroup[i + 1].SECTION_ID))
                {
                    continue;
                }
                findMatchRailPoint(listGroup[i].RAIL_ID, listGroup[i + 1].RAIL_ID);
            }

            foreach (AGROUPRAILS group_rail in listGroup)
            {
                uctlRail railTemp   = null;
                string   section_id = group_rail.SECTION_ID.Trim();
                railTemp = m_objItemRail.Where(r => r.p_ID.Trim() == group_rail.RAIL_ID.Trim()).FirstOrDefault();
                if (railTemp == null)
                {
                    continue;
                }
                if (!m_DicSectionGroupRails.ContainsKey(section_id))
                {
                    ASECTION ASEC_ObJ = mainForm.BCApp.SCApplication.MapBLL.getSectiontByID(section_id);
                    ASEGMENT ASEG_ObJ = mainForm.BCApp.SCApplication.MapBLL.getSegmentByID(ASEC_ObJ.SEG_NUM);
                    m_DicSectionGroupRails.Add(group_rail.SECTION_ID.Trim(), new GroupRails(group_rail.SECTION_ID, ASEC_ObJ.SEC_DIS, group_rail.DIR
                                                                                            , ASEG_ObJ.SEG_NUM, ASEG_ObJ.DIR));
                }
                m_DicSectionGroupRails[section_id].uctlRails.Add(new KeyValuePair <uctlRail, E_RAIL_DIR>(railTemp, group_rail.DIR));
            }

            foreach (GroupRails group in m_DicSectionGroupRails.Values)
            {
                group.RefreshDistance();
                group.DecisionFirstAndLastPoint(true);
            }

            List <ASEGMENT> listSegment = mainForm.BCApp.SCApplication.MapBLL.loadAllSegments();

            foreach (ASEGMENT seg in listSegment)
            {
                List <GroupRails> segSections = m_DicSectionGroupRails.Values
                                                .Where(group => group.Segment_Num.Trim() == seg.SEG_NUM.Trim()).ToList();
                m_DicSegmentGroupRails.Add(seg.SEG_NUM.Trim(), segSections);
            }
            return(bRet);
        }
        private void PushVehicleHistoricalInso(List <Vo.VehicleHistoricalInfo> vehicleHistoricals)
        {
            foreach (var historicalInfo in vehicleHistoricals)
            {
                if (BCFUtility.isMatche(currentPlayVh, "ALL") ||
                    BCFUtility.isMatche(currentPlayVh, historicalInfo.ID))
                {
                    app.VehicleBLL.ProcVehicleInfo(historicalInfo.VhInfo);
                }
            }
            //Parallel.For(0, vehicleHistoricals.Count(), rowCount =>
            //{
            // app.VehicleBLL.ProcVehicleInfo(vehicleHistoricals[rowCount].VhInfo);

            //});
        }
        /// <summary>
        /// Initials the bc system.
        /// </summary>
        /// <returns>SCAppConstants.BCSystemInitialRtnCode.</returns>
        public SCAppConstants.BCSystemInitialRtnCode initialBCSystem()
        {
            string bc_id = scApp.getBCFApplication().BC_ID;

            SCAppConstants.BCSystemInitialRtnCode rtnCode = SCAppConstants.BCSystemInitialRtnCode.Normal;
            try
            {
                using (DBConnection_EF conn = new DBConnection_EF())
                {
                    BCSTAT bc = bcStatusDao.getBCStatByID(conn, bc_id);
                    if (bc == null)
                    {
                        bc = new BCSTAT()
                        {
                            BC_ID         = bc_id,
                            CLOSE_MODE    = SCAppConstants.BCSystemStatus.Default,
                            RUN_TIMESTAMP = BCFUtility.formatDateTime(DateTime.Now, SCAppConstants.TimestampFormat_16)
                        };
                        bcStatusDao.insertBCStat(conn, bc);
                    }
                    else
                    {
                        if (BCFUtility.isMatche(bc.CLOSE_MODE, SCAppConstants.BCSystemStatus.NormalClosed))
                        {
                            logger.Info("Normal shutdown BC System!");
                            rtnCode = SCAppConstants.BCSystemInitialRtnCode.Normal;
                        }
                        else
                        {
                            logger.Info("Non-normal shutdown BC System!");
                            rtnCode = SCAppConstants.BCSystemInitialRtnCode.NonNormalShutdown;
                        }
                        bc.CLOSE_MODE = SCAppConstants.BCSystemStatus.Default;
                        bcStatusDao.updateBCStat(conn, bc);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Warn("Insert Failed to BCSTAT [BC_ID:{0}]", bc_id, ex);
                rtnCode = SCAppConstants.BCSystemInitialRtnCode.Error;
            }
            finally
            {
            }
            return(rtnCode);
        }
 private void setSpecifyRail(string[] spacifyPath)
 {
     if (spacifyPath == null)
     {
         return;
     }
     //如果之前的只是路徑不是Null,才需要比較兩個有沒有一樣去決定要不要更新只是路徑。
     if (preSelectionSec != null && BCFUtility.isMatche(preSelectionSec, spacifyPath))
     {
         return;
     }
     else
     {
         resetSpecifyRail();
         resetSpecifyAdr();
     }
     preSelectionSec = spacifyPath;
     //uctl_Map.changeSpecifyRailColor(spacifyPath);
 }
Exemple #16
0
        private void DeleteBtn_Click(object sender, EventArgs e)
        {
            if (!BCUtility.doLogin(this, bcApp, BCAppConstants.FUNC_USER_MANAGEMENT))
            {
                return;
            }
            UASFNC selectFuncCode = getSelectedRowToTextBox();

            if (selectFuncCode == null)
            {
                return;
            }
            if (BCFUtility.isMatche(BCAppConstants.FUNC_USER_MANAGEMENT, selectFuncCode.FUNC_CODE))
            {
                return;
            }
            var confirmResult = MessageBox.Show(this, "Are you sure to delete this item ?",
                                                "Confirm Delete!",
                                                MessageBoxButtons.YesNo);

            if (confirmResult != DialogResult.Yes)
            {
                return;
            }

            Boolean deleteSuccess =
                bcApp.SCApplication.UserBLL.deleteFunctionCodeByCode(selectFuncCode.FUNC_CODE);

            if (deleteSuccess)
            {
                //MessageBox.Show(this, BCApplication.getMessageString("DELETE_SUCCESS"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("DELETE_SUCCESS"));
                Refresh();
            }
            else
            {
                //MessageBox.Show(this, BCApplication.getMessageString("DELETE_FAILED"));
                BCUtility.showMsgBox_Info(this, BCApplication.getMessageString("DELETE_FAILED"));
            }
        }
        private void setSpecifyRail(string[] spacifyPath)
        {
            try
            {
                if (spacifyPath == null)
                {
                    return;
                }

                if (BCFUtility.isMatche(preSelectionSec, spacifyPath))
                {
                    return;
                }

                preSelectionSec = spacifyPath;
                uctl_Map.changeSpecifyRailColor(spacifyPath);
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
        /// <summary>
        /// Determines whether [is enable report] [the specified ceid].
        /// </summary>
        /// <param name="ceid">The ceid.</param>
        /// <returns>Boolean.</returns>
        public Boolean isEnableReport(string ceid)
        {
            Boolean         isEnable = false;
            DBConnection_EF conn     = null;

            try
            {
                conn = DBConnection_EF.GetContext();
                conn.BeginTransaction();
                AEVENTRPTCOND cond = eventRptCondDao.getRptCond(conn, ceid);
                if (cond == null)
                {
                    isEnable = true;
                }
                else
                {
                    isEnable = BCFUtility.isMatche(cond.ENABLE_FLG, SCAppConstants.YES_FLAG);
                }
                conn.Commit();
            }
            catch (Exception ex)
            {
                if (conn != null)
                {
                    try { conn.Rollback(); } catch (Exception ex_rollback) { logger.Error(ex_rollback, "Exception"); }
                }
                logger.Error(ex, "Exception");
                return(isEnable);
            }
            finally
            {
                if (conn != null)
                {
                    try { conn.Close(); } catch (Exception ex_close) { logger.Error(ex_close, "Exception"); }
                }
            }
            return(isEnable);
        }
        private void initialMapSpace()
        {
            if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_AUO_CAAGV100) ||
                BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_AUO_CAAGV100_Beta))
            {
                space_Height_m  = 35000; //AGVC 地圖地圖大小
                space_Width_m   = 135000;
                zoon_Factor     = 210;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_TAICHUNG))
            {
                space_Height_m  = 15000; //AGVC 地圖地圖大小
                space_Width_m   = 24000;
                zoon_Factor     = 70;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_AUO_CAAGVC00))
            {
                space_Height_m  = 28000; //CAAGVC00 地圖地圖大小
                space_Width_m   = 12000;
                zoon_Factor     = 130;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_AUO_CAAGV200))
            {
                space_Height_m  = 22000; //CAAGVC00 地圖地圖大小
                space_Width_m   = 60000;
                zoon_Factor     = 130;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_AUO_FAXAGV03))
            {
                space_Height_m  = 27000; //4F 地圖地圖大小
                space_Width_m   = 15000;
                zoon_Factor     = 130;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_NORTH_INNOLUX))
            {
                space_Height_m  = 109000; //Innolux North 地圖地圖大小
                space_Width_m   = 28000;
                zoon_Factor     = 210;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_SOUTH_INNOLUX))
            {
                space_Height_m  = 21000; //Innolux South 地圖地圖大小
                space_Width_m   = 50000;
                zoon_Factor     = 130;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_NORTH_INNOLUX_TEST_SITE))
            {
                space_Height_m = 10000; //Innolux North Test Site 地圖地圖大小
                space_Width_m  = 26000;
                //space_Height_m = 10000; //Innolux North Test Site 地圖地圖大小
                //space_Width_m = 20000;
                zoon_Factor     = 70;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_UMTC_TEST_SITE))
            {
                space_Height_m  = 22000; //CAAGVC00 地圖地圖大小
                space_Width_m   = 60000;
                zoon_Factor     = 130;
                defaultMaxScale = 10;
            }
            else if (BCFUtility.isMatche(mainForm.BCApp.SCApplication.BC_ID, SCAppConstants.WorkVersion.VERSION_NAME_AUO_CAAGV4F))
            {
                space_Height_m  = 55000; //CAAGV4F 地圖地圖大小
                space_Width_m   = 41000;
                zoon_Factor     = 130;
                defaultMaxScale = 10;
            }
            else
            {
                space_Height_m  = 14000;
                space_Width_m   = 40000;
                zoon_Factor     = 100;
                defaultMaxScale = 10;
            }
            trackBar_scale.Maximum = defaultMaxScale;
            trackBar_scale.Value   = defaultMaxScale;
            lbl_maxScale.Text      = defaultMaxScale.ToString();
            //BCUtility.setScale(trackBar_scale.Value);
            BCUtility.setScale(10, zoon_Factor);
            double space_Height_PixelsHeight = BCUtility.RealLengthToPixelsWidthByScale(space_Height_m);
            double space_Height_PixelsWidth  = BCUtility.RealLengthToPixelsWidthByScale(space_Width_m);

            pnl_Map.Height       = (int)space_Height_PixelsHeight;
            pnl_Map.Width        = (int)space_Height_PixelsWidth;
            this.pnl_Map.Resize += new System.EventHandler(this.pnl_Map_Resize);
            pnl_Map.Tag          = pnl_Map.Height + "|" + pnl_Map.Width;
        }