//public IBRServiceContracts.ComosActivity GetComosActivityBySysUID(string user, string projectname, int workinglayer, string object_sysuid) //{ // Plt.IComosBaseObject device = null; // try // { // m_ComosSession.SetCurrentUser(user); // m_ComosSession.SetCurrentProjectAndWorkingOverlay(projectname, workinglayer); // device = m_ComosSession.GetComosDeviceBySystemUID(object_sysuid); // return ComosSpecsEngine.GetDeviceSpecifications(device); // } // catch (Exception ex) // { // ComosBRWeb.LogHandler.WriteLog(ex.Message + ":GetComosActivityBySysUID"); // System.Diagnostics.Debug.Assert(false); // } // return null; //} //public IBRServiceContracts.ComosActivity GetComosActivityBySysFullName(string user, string projectname, int workinglayer, string object_sysuid) //{ // Plt.IComosBaseObject device = null; // try // { // m_ComosSession.SetCurrentUser(user); // m_ComosSession.SetCurrentProjectAndWorkingOverlay(projectname, workinglayer); // device = m_ComosSession.GetDeviceByFullName(object_sysuid); // return ComosSpecsEngine.GetDeviceSpecifications(device); // } // catch (Exception ex) // { // ComosBRWeb.LogHandler.WriteLog(ex.Message + ":GetComosActivityBySysFullName"); // System.Diagnostics.Debug.Assert(false); // } // return null; //} // @ToDo : Split in Sys and fullname. Avoid exception. public IBRServiceContracts.ComosActivity GetComosActivity(string user, string projectname, int workinglayer, string object_sysuid) { Plt.IComosBaseObject device = null; try { m_ComosSession.SetCurrentUser(user); m_ComosSession.SetCurrentProjectAndWorkingOverlay(projectname, workinglayer); if (object_sysuid.Contains("|")) { device = m_ComosSession.GetDeviceByFullName(object_sysuid); } else { device = m_ComosSession.GetComosDeviceBySystemUID(object_sysuid); if (device == null) { device = m_ComosSession.GetComosDocumentBySystemUID(object_sysuid); } } if (device != null) { } } catch (Exception) { // ComosBRWeb.LogHandler.WriteLog(ex.Message + ":GetComosActivity"); // System.Diagnostics.Debug.Assert(false); } return(null); }
public string GetObjectDetails(string user, string projectname, int workinglayer, string object_sysuid) { try { m_ComosSession.SetCurrentUser(user); m_ComosSession.SetCurrentProjectAndWorkingOverlay(projectname, workinglayer); Plt.IComosBaseObject device = m_ComosSession.GetComosDeviceBySystemUID(object_sysuid); //return ComosSpecsEngine.RetornaHTMLTela(device); } catch (Exception ex) { Log.WriteLog(ex.Message + ":GetObjectDetails", System.Diagnostics.EventLogEntryType.Warning); System.Diagnostics.Debug.Assert(false); } return(""); }
/// <summary> /// /// </summary> /// <param name="user"></param> /// <param name="projectname"></param> /// <param name="workinglayer"></param> /// <param name="query_fullname"></param> /// <param name="startobject_fullname"></param> /// <returns></returns> public TResult <CQueryResult> ExecuteQuery(string user, string projectname, int workinglayer, string query_fullname, string startobject_fullname) { try { if (m_ComosSession == null) { return(new TResult <CQueryResult>() { Status = false, Message = "Session is NULL", }); } m_ComosSession.SetCurrentUser(user); m_ComosSession.SetCurrentProjectAndWorkingOverlay(projectname, workinglayer); var device = m_ComosSession.GetDeviceByFullName(query_fullname); Plt.IComosBaseObject startobject = null; if (!string.IsNullOrEmpty(startobject_fullname)) { startobject = m_ComosSession.GetDeviceByFullName(startobject_fullname); } var table = m_ComosSession.GetQueryData(device, startobject); return(new TResult <CQueryResult>() { data = table, Status = true, }); } catch (Exception ex) { Log.WriteLog(ex.Message + ":ExecuteQuery", System.Diagnostics.EventLogEntryType.Warning); System.Diagnostics.Debug.Assert(false); } return(null); }