|
@@ -13,7 +13,7 @@ namespace BenQGuru.eMES.DLLService
|
|
|
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
|
|
public interface IMESHelper
|
|
|
{
|
|
|
- [DispId(14)]
|
|
|
+ [DispId(17)]
|
|
|
bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
|
|
|
bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
|
|
|
bool GetMaster(out string Master);
|
|
@@ -43,7 +43,7 @@ namespace BenQGuru.eMES.DLLService
|
|
|
//用于存放批量执行的SQL
|
|
|
List<string> sqls = new List<string>();
|
|
|
//系统默认的的连接字符串
|
|
|
- private string ConnectionStrings = "Data Source=117.25.180.218/orcl;User ID=MES;PassWord=select!#%*(;";
|
|
|
+ private string ConnectionStrings = "Data Source=192.168.230.200/orcl;User ID=MES;PassWord=select!#%*(;";
|
|
|
//用户选择的数据库的连接字符串
|
|
|
private OracleConnection connection;
|
|
|
//用户选择的数据库的连接字符串
|
|
@@ -1192,21 +1192,19 @@ namespace BenQGuru.eMES.DLLService
|
|
|
[Description("设置账套信息")]
|
|
|
public bool SetMaster(string iMaster)
|
|
|
{
|
|
|
- for (int i = 0; i < MasterDB.Rows.Count; i++)
|
|
|
+ DataTable dt = (DataTable)ExecuteSql("select ms_pwd,ma_user,ma_inneraddress from master where ma_user='" + iMaster + "'", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- if (MasterDB.Rows[i]["ma_user"].ToString() == iMaster)
|
|
|
+ ConnectionStrings = "Data Source=" + dt.Rows[0]["ma_inneraddress"].ToString() + "/orcl;User ID=" + iMaster + ";PassWord=" + dt.Rows[0]["ms_pwd"].ToString() + ";";
|
|
|
+ try
|
|
|
{
|
|
|
- ConnectionStrings = "Data Source="+ MasterDB.Rows[i]["ma_inneraddress"].ToString() + "/orcl;User ID=" + iMaster + ";PassWord=" + MasterDB.Rows[i]["ms_pwd"].ToString();
|
|
|
- try
|
|
|
- {
|
|
|
- connection = new OracleConnection(ConnectionStrings);
|
|
|
- }
|
|
|
- catch (Exception)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
+ connection = new OracleConnection(ConnectionStrings);
|
|
|
}
|
|
|
+ catch (Exception)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|