Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
yscom-git committed Oct 17, 2023
1 parent 1bf63df commit 1581a7c
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 96 deletions.
4 changes: 2 additions & 2 deletions YMES.DEPLOY/Config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<CORCD>5200</CORCD><!--Corporation Code-->
<BIZCD>5210</BIZCD><!--Business Code-->

<DB_CONNECTION>WCF</DB_CONNECTION><!--DB Type : ORACLE, MSSQL, WCF, ACCESS-->
<SVR>http://wcf.yscom.co.kr:1818/wcf</SVR><!--DB Server IP-->
<DB_CONNECTION>WCF</DB_CONNECTION><!--DB Type : ORACLE, MSSQL, WCF, ACCESS-->
<DBSVR>http://wcf.yscom.co.kr:1818/wcf</DBSVR><!--DB Server IP : http://wcf.yscom.co.kr:1818/wcf-->
<DBUID></DBUID><!--DB User ID-->
<DBPWD></DBPWD><!--DB User Password-->
<DBSERVICE></DBSERVICE><!--DB Service(Oracle)-->
Expand Down
11 changes: 5 additions & 6 deletions YMES.DEPLOY/CustomizedMainFrm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 6 additions & 15 deletions YMES.DEPLOY/CustomizedMainFrm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,19 @@ namespace YMES.DEPLOY
{
public partial class CustomizedMainFrm : BaseMainForm
{
private const string CN_LOGIC_APP_NAME = "YMES.Logics";
public CustomizedMainFrm()
{
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{

base.OnLoad(e);
StartBC();

StatusBarMsg(FX.MainForm.Base.Common.MsgTypeEnum.Alarm, "TEST");

{
base.OnLoad(e);
}
private void StartBC()
protected override void StartBC()
{
string pgmClassName = "";
if (GetXMLConfig("DEBUG_CLIENT").Contains("@"))
{
pgmClassName = CN_LOGIC_APP_NAME + "." + GetXMLConfig("DEBUG_CLIENT").Substring(1) +", " + CN_LOGIC_APP_NAME;
}
ChildBC = (YMES.FX.MainForm.BaseContainer)Activator.CreateInstance(Type.GetType(pgmClassName));
base.StartBC();

}

}
}
8 changes: 8 additions & 0 deletions YMES.FX.DB/Base/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ namespace YMES.FX.DB.Base
{
public class Util
{
public static string GetRealIP(string httpAddress)
{
string ip = httpAddress.ToLower().Replace("http://", "").Replace("https://", "");
ip = ip.Split(':')[0];
ip = ip.Split('/')[0];
ip = System.Net.Dns.GetHostEntry(ip).AddressList[0].ToString();
return ip;
}
public static bool WriteTxtLog(string log, string writeDIR = ".\\DB_LOG")
{
bool bRet = true;
Expand Down
28 changes: 27 additions & 1 deletion YMES.FX.DB/OracleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,37 @@ public int ExecuteNonQuery(string query, Dictionary<string, string> param = null
}
return ExecuteNonQuery(query, dicRet);
}

private bool ConnectTest(string ip, int port, int millisecondsTimeout)
{
bool result = false;
System.Net.Sockets.Socket socket = null;

try
{
ip = Base.Util.GetRealIP(ip);
socket = new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp);
socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel.Socket, System.Net.Sockets.SocketOptionName.DontLinger, false);
IAsyncResult ret = socket.BeginConnect((new System.Net.IPEndPoint(System.Net.IPAddress.Parse(ip), port)), null, null);

result = ret.AsyncWaitHandle.WaitOne(millisecondsTimeout, false);
}
catch (Exception eLog)
{
System.Diagnostics.Debug.WriteLine(eLog.Message);
}
finally
{
if (socket != null)
{
socket.Close();
}
}
return result;
}
public bool IsOpen()
{
if (m_Conn.State == ConnectionState.Closed)
if (ConnectTest(m_DBConnInfor.SVR, Convert.ToInt32(m_DBConnInfor.PORT), 500) == false)
{
return false;
}
Expand Down
4 changes: 3 additions & 1 deletion YMES.FX.DB/WCF/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ public bool IsConnected()
{
return ConnectTest(m_IP, Convert.ToInt32(m_Port), m_timeOutMilsec);
}

private bool ConnectTest(string ip, int port, int millisecondsTimeout)
{
bool result = false;
System.Net.Sockets.Socket socket = null;

try
{
ip = System.Net.Dns.GetHostEntry(ip).AddressList[0].ToString();

ip = Base.Util.GetRealIP(ip);
socket = new System.Net.Sockets.Socket(System.Net.Sockets.AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.Tcp);
socket.SetSocketOption(System.Net.Sockets.SocketOptionLevel.Socket, System.Net.Sockets.SocketOptionName.DontLinger, false);
IAsyncResult ret = socket.BeginConnect((new System.Net.IPEndPoint(System.Net.IPAddress.Parse(ip), port)), null, null);
Expand Down
51 changes: 37 additions & 14 deletions YMES.FX.Forms/Base/MainFormDesign.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@ namespace YMES.FX.MainForm.Base
public class MainFormDesign : MainFormComponent
{
private const string CN_CATEGORY_APP = "_YMES.Appearance";
private const string CN_CATEGORY_MOV = "_YMES.Movement";
private const string CN_CATEGORY_DB = "_YMES.DataBase";
private Image m_LogoImg = Properties.Resources.PB_LOGO;
private Icon m_AppIcon;

private string m_XMLConfigFile = @".\Config.xml";
private string m_XMLDebugModeEleName = "DEBUG_MODE";


private string m_MsgTy_WARNING = "WARNING";
private string m_MsgTy_ALARM = "NOTICE";
private string m_MsgTy_ERROR = "ERROR";
private string m_MsgTy_TRACE = "TRACE";


private string m_XMLConfigFile = @".\Config.xml";
private string m_XMLDebugModeEleName = "DEBUG_MODE";
private string m_XMLDebugClientEleName = "DEBUG_CLIENT";
private string m_LogicAppNameSpace = "YMES.Logics";

private Common.DateFormatEnum m_TIT_DateFormat = Common.DateFormatEnum.YYYYMMDD;
private DateTime m_CurrentTime = DateTime.Now;
private IMainFormDesign m_Parent;
Expand All @@ -54,7 +58,7 @@ public class MainFormDesign : MainFormComponent

private string m_TIT_Config;
private Font m_TIT_Config_FONT;

private bool m_AllowDuplicatedRun = false;
private string m_DuplicatedRunMsg = "Duplicated Application";
private string m_DuplicatedRunTitle = "Violated Run";
private string m_Exit_Dlg_Title= "Exit of Program";
Expand All @@ -67,26 +71,38 @@ public class MainFormDesign : MainFormComponent
private string m_Xml_DBPWD_NM = "DBPWD";
private string m_Xml_DBSID_NM = "DBSERVICE";
private string m_Xml_DBPort_NM = "DBPORT";

[Category(CN_CATEGORY_DB)]
public string Error_DB_Connection
[Category(CN_CATEGORY_MOV)]
public string LogicAppNameSpace
{
get { return m_Error_DB_Connection; }
set { m_Error_DB_Connection = value; }
get { return m_LogicAppNameSpace; }
set { m_LogicAppNameSpace = value; }
}

[Category(CN_CATEGORY_DB)]
[Category(CN_CATEGORY_MOV)]
public string XMLDebugModeEleName
{
get { return m_XMLDebugModeEleName; }
set { m_XMLDebugModeEleName = value; }
}
[Category(CN_CATEGORY_MOV)]
public string XMLDebugClientEleName
{
get { return m_XMLDebugClientEleName; }
set { m_XMLDebugClientEleName = value; }
}
[Category(CN_CATEGORY_MOV)]
public string XMLConfigFile
{
get { return m_XMLConfigFile; }
set { m_XMLConfigFile = value; }
}
[Category(CN_CATEGORY_DB)]
public string XMLDebugModeEleName
public string Error_DB_Connection
{
get { return m_XMLDebugModeEleName; }
set { m_XMLDebugModeEleName = value; }
get { return m_Error_DB_Connection; }
set { m_Error_DB_Connection = value; }
}


[System.ComponentModel.Category(CN_CATEGORY_DB)]
public string Xml_DBKind_NM
{
Expand Down Expand Up @@ -123,6 +139,13 @@ public string Xml_DBPort_NM
get { return m_Xml_DBPort_NM; }
set { m_Xml_DBPort_NM = value; }
}
[System.ComponentModel.Category(CN_CATEGORY_APP)]
public bool AllowDuplicatedRun
{
get { return m_AllowDuplicatedRun; }
set { m_AllowDuplicatedRun = value; }
}

[System.ComponentModel.Category(CN_CATEGORY_APP)]
public string Exit_Dlg_Title
{
Expand Down
71 changes: 43 additions & 28 deletions YMES.FX.Forms/BaseMainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1581a7c

Please sign in to comment.