public List <C_PROGRAM_SERVER> GetProgramServer(string BU, string IP, string Program_Name, string Item_Name, string Emp_No, OleExec DB, DB_TYPE_ENUM DBType) { string Message = ""; List <C_PROGRAM_SERVER> ListProgramServer = new List <C_PROGRAM_SERVER>(); string StrSql = $@"SELECT * from C_PROGRAM_SERVER where program_name='{Program_Name}' "; DataTable dt = DB.ExecSelect(StrSql).Tables[0]; if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { C_PROGRAM_SERVER Row = GetRow(dr); ListProgramServer.Add(Row); } return(ListProgramServer); } 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); }
public C_PROGRAM_SERVER 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_PROGRAM_SERVER> ListInterface = new List <C_PROGRAM_SERVER>(); Dictionary <string, string> Dic_Interface = new Dictionary <string, string>(); 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_PROGRAM_SERVER 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); }
public C_PROGRAM_SERVER GetDataObject() { C_PROGRAM_SERVER DataObject = new C_PROGRAM_SERVER(); DataObject.ID = this.ID; DataObject.PROGRAM_NAME = this.PROGRAM_NAME; DataObject.SERVER_IP = this.SERVER_IP; DataObject.PORT = this.PORT; DataObject.SERVICE_NAME = this.SERVICE_NAME; DataObject.EDIT_EMP = this.EDIT_EMP; DataObject.EDIT_TIME = this.EDIT_TIME; return(DataObject); }