Пример #1
0
        public List <C_INTERFACE> GetInterfaceStatus(string BU, string IP, string Program_Name, string Item_Name, string Emp_No, OleExec DB, DB_TYPE_ENUM DBType)
        {
            string                      Message       = "";
            List <C_INTERFACE>          ListInterface = new List <C_INTERFACE>();
            Dictionary <string, string> Dic_Interface = new Dictionary <string, string>();
            string                      StrSql        = $@"SELECT * from C_INTERFACE where program_name='{Program_Name}' ";
            DataTable                   dt            = DB.ExecSelect(StrSql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    C_INTERFACE Row = GetRow(dr);
                    ListInterface.Add(Row);
                }
                return(ListInterface);
            }
            else
            {
                if (dt.Rows.Count > 1)
                {
                    Message = "配置信息有多筆!";
                }
                else if (dt.Rows.Count == 0)
                {
                    Message = "信息未配置";
                }

                return(null);
            }

            //InsertLog(BU, Program_Name, Item_Name, Message, StrSql, Emp_No, DB, DBType);
        }
Пример #2
0
        /// <summary>
        /// 檢查前台服務器IP與後台服務器IP是否一致
        /// </summary>
        /// <param name="BU"></param>
        /// <param name="IP"></param>
        /// <param name="Program_Name"></param>
        /// <param name="Item_Name"></param>
        /// <param name="Emp_No"></param>
        /// <param name="DB"></param>
        /// <param name="DBType"></param>
        /// <returns></returns>
        public C_INTERFACE CHECK_IP(string BU, string IP, string Program_Name, string Item_Name, string Emp_No, OleExec DB, DB_TYPE_ENUM DBType)
        {
            string             Message       = "";
            List <C_INTERFACE> ListInterface = new List <C_INTERFACE>();

            try
            {
                string    StrSql = $@"SELECT * from C_Program_Server where program_name='{Program_Name}' and server_ip='{IP}' ";
                DataTable dt     = DB.ExecSelect(StrSql).Tables[0];
                if (dt.Rows.Count == 1)
                {
                    C_INTERFACE Row = GetRow(dt.Rows[0]);
                    return(Row);
                }
                else
                {
                    if (dt.Rows.Count > 1)
                    {
                        Message = Item_Name + "配置信息有多筆!";
                    }
                    else if (dt.Rows.Count == 0)
                    {
                        Message = Item_Name + "信息未配置";
                    }
                    return(null);
                }
                //InsertLog(BU, Program_Name, Item_Name, Message, StrSql, Emp_No, DB, DBType);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Пример #3
0
        public C_INTERFACE GetDataObject()
        {
            C_INTERFACE DataObject = new C_INTERFACE();

            DataObject.ID            = this.ID;
            DataObject.PROGRAM_NAME  = this.PROGRAM_NAME;
            DataObject.CLASS_NAME    = this.CLASS_NAME;
            DataObject.FUNCTION_NAME = this.FUNCTION_NAME;
            DataObject.ITEM_NAME     = this.ITEM_NAME;
            DataObject.SEQ_NO        = this.SEQ_NO;
            DataObject.ITEM_STATUS   = this.ITEM_STATUS;
            DataObject.LAST_RUN_DATE = this.LAST_RUN_DATE;
            DataObject.NEXT_RUN_DATE = this.NEXT_RUN_DATE;
            DataObject.RUN_TYPE      = this.RUN_TYPE;
            DataObject.RUN_TIME      = this.RUN_TIME;
            DataObject.DESCRIPTION   = this.DESCRIPTION;
            DataObject.EDIT_EMP      = this.EDIT_EMP;
            DataObject.EDIT_TIME     = this.EDIT_TIME;
            return(DataObject);
        }