Exemplo n.º 1
0
        public string userId()
        {
            GxConnection gxconn = _ds.Connection as GxConnection;

            if (gxconn != null && !String.IsNullOrEmpty(gxconn.InternalUserId))
            {
                return(gxconn.InternalUserId);
            }
            else
            {
                GXLogging.Debug(log, "UserId method");
                string stmt = ((GxDataRecord)_ds.Db).GetServerUserIdStmt();
                if (string.IsNullOrEmpty(stmt))
                {
                    return(string.Empty);
                }
                else
                {
                    GxCommand cmd = new GxCommand(_ds.Db, stmt, _ds, 0, false, true, _errorHandler);
                    cmd.ErrorMask = GxErrorMask.GX_NOMASK | GxErrorMask.GX_MASKLOOPLOCK;
                    IDataReader reader;
                    cmd.FetchData(out reader);
                    string s = string.Empty;
                    if (reader != null)
                    {
                        s = reader.GetString(0);
                        reader.Close();
                    }
                    return(s);
                }
            }
        }
Exemplo n.º 2
0
 public WMIConnection(GxConnection connection)
 {
     try
     {
         this.connection = connection;
         Instrumentation.Publish(this);
     }
     catch (Exception e)
     {
         GXLogging.Error(log, "WMI Error", e);
     }
 }
Exemplo n.º 3
0
 public WMIConnection(GxConnection gxConnection)
 {
     this.gxConnection = gxConnection;
 }