コード例 #1
0
        /// <summary>
        /// 獲取Interface 信息
        /// </summary>
        /// <param name="requestValue"></param>
        /// <param name="Data"></param>
        /// <param name="StationReturn"></param>
        public void GetInterfaceStatus(Newtonsoft.Json.Linq.JObject requestValue, Newtonsoft.Json.Linq.JObject Data, MESStationReturn StationReturn)
        {
            string Program_Name = Data["PROGRAM"].ToString();
            Dictionary <string, object> ListInterfaceObj = new Dictionary <string, object>();

            List <C_INTERFACE>      ListInterface     = new List <C_INTERFACE>();
            List <C_PROGRAM_SERVER> ListProgramServer = new List <C_PROGRAM_SERVER>();
            OleExec Sfcdb = this.DBPools["SFCDB"].Borrow();

            C_Interface   = new T_C_INTERFACE(Sfcdb, DB_TYPE_ENUM.Oracle);
            ListInterface = C_Interface.GetInterfaceStatus(BU, IP, Program_Name, "ALL", LoginUser.EMP_NO, Sfcdb, DB_TYPE_ENUM.Oracle);

            ListInterfaceObj.Add(Program_Name, ListInterface);

            C_Program_Server  = new T_C_PROGRAM_SERVER(Sfcdb, DB_TYPE_ENUM.Oracle);
            ListProgramServer = C_Program_Server.GetProgramServer(BU, IP, Program_Name, "ALL", LoginUser.EMP_NO, Sfcdb, DB_TYPE_ENUM.Oracle);
            ListInterfaceObj.Add(Program_Name + "_SERVER", ListProgramServer);

            StationReturn.Data   = ListInterfaceObj;
            StationReturn.Status = StationReturnStatusValue.Pass;
        }
コード例 #2
0
        /// <summary>
        /// 檢查Interface Item 是否被使用
        /// </summary>
        /// <param name="ProgramName"></param>
        /// <param name="ItemName"></param>
        /// <param name="Sfcdb"></param>
        /// <returns></returns>
        public bool CheckInterfaceRun(string ProgramName, string ItemName, OleExec Sfcdb)
        {
            bool   InUse  = false;
            bool   Flag   = true;
            string EMP_NO = LoginUser.EMP_NO;

            //OleExec Sfcdb = this.DBPools["SFCDB"].Borrow();
            C_Interface      = new T_C_INTERFACE(Sfcdb, DB_TYPE_ENUM.Oracle);
            C_Program_Server = new T_C_PROGRAM_SERVER(Sfcdb, DB_TYPE_ENUM.Oracle);
            IP = Dns.GetHostEntry(Dns.GetHostName()).AddressList.FirstOrDefault <IPAddress>(a => a.AddressFamily.ToString().Equals("InterNetwork")).ToString();
            //C_INTERFACE C_interface = (C_INTERFACE)C_Interface.CHECK_IP(BU, IP, "INTERFACE", ItemName, LoginUser.EMP_NO, Sfcdb, DB_TYPE_ENUM.Oracle);
            C_PROGRAM_SERVER C_program_server = (C_PROGRAM_SERVER)C_Program_Server.CHECK_IP(BU, IP, "INTERFACE", ItemName, EMP_NO, Sfcdb, DB_TYPE_ENUM.Oracle);

            T_R_SYNC_LOCK R_Syn_Lock = new T_R_SYNC_LOCK(Sfcdb, DB_TYPE_ENUM.Oracle);

            InUse = R_Syn_Lock.Check_SYNC_Lock(BU, IP, ProgramName, ItemName, EMP_NO, Sfcdb, DB_TYPE_ENUM.Oracle);

            if (C_program_server == null || InUse)
            {
                Flag = false;
            }

            return(Flag);
        }