Ejemplo n.º 1
0
 public TResult <CQueryResult> ExecuteTaskQuery(string user, string projectname, int workinglayer, string opt, string startobject)
 {
     try
     {
         m_ComosSession.SetCurrentUser(user);
         m_ComosSession.SetCurrentProjectAndWorkingOverlay(projectname, workinglayer);
         string query = null;
         if (m_ComosSession.TryGetLinkQueryFullName(opt, out query))
         {
             TResult <CQueryResult> result = new TResult <CQueryResult>();
             result        = ExecuteQuery(user, projectname, workinglayer, query, startobject);
             result.Status = true;
             return(result);
         }
         else
         {
             TResult <CQueryResult> result = new TResult <CQueryResult>();
             result.Message = query;
             result.Status  = false;
             return(result);
         }
     }
     catch (Exception ex)
     {
         Log.WriteLog(ex.Message + ":ExecuteTaskQuery" + ex.StackTrace, System.Diagnostics.EventLogEntryType.Warning);
         System.Diagnostics.Debug.Assert(false);
         return(new TResult <CQueryResult>()
         {
             Message = ex.Message,
             Status = false,
             data = null,
         });
     }
 }