Exemplo n.º 1
0
        public string ObtainApiKey(string username, string password, bool generateKey = true)
        {
            if (generateKey)
            {
                GenerateApiKey(username, password);
            }

            DTIISMNGUser user = DataVault
                                .Get <DTIISMNGUser>(DapperMethod.AuthenticationServices.ObtainApiKey,
                                                    new { @Username = username, @Password = password });

            return(user?.AuthKey);
        }
Exemplo n.º 2
0
        public dynamic SignWithApiKey(string apiKey)
        {
            if (apiKey == null)
            {
                return(null);
            }

            SignedUser user = DataVault
                              .Get <SignedUser>(DapperMethod.AuthenticationServices.SignInWithApiKey,
                                                new { @AuthKey = apiKey });

            if (user == null)
            {
                return(null);
            }

            user.AuthKey = apiKey;

            return(user);
        }
Exemplo n.º 3
0
 public IEnumerable <ADDomain> All()
 {
     return(DataVault
            .Get <IEnumerable <ADDomain> >(DapperMethod.PlatformServices.GetActiveDirectoryDomainsAll));
 }
Exemplo n.º 4
0
 public SiteConnectionString GetSiteConnectionString(int id)
 {
     return(DataVault
            .Get <SiteConnectionString>(DapperMethod.TrackingServices.GetSiteConnectionStringById,
                                        new { @Id = id }));
 }
 public ServiceTimer GetScheduler(int clientId, int serviceId)
 {
     return(DataVault
            .Get <ServiceTimer>(DapperMethod.ManagementServices.GetScheduler,
                                new { @clientId = clientId, @serviceId = serviceId }));
 }
 public Client GetClient(string machineName)
 {
     return(DataVault
            .Get <Client>(DapperMethod.ManagementServices.GetClientByMachineName,
                          new { @machineName = machineName }));
 }
 public Site GetSite(int Id)
 {
     return(DataVault
            .Get <Site>(DapperMethod.CoreServices.GetSiteById,
                        new { @Id = Id }));
 }
 public IEnumerable <SiteLog> GetSiteLogBySiteId(int SiteId)
 {
     return(DataVault
            .Get <IEnumerable <SiteLog> >(DapperMethod.CoreServices.GetSiteEventLogBySiteId,
                                          new { @SiteId = SiteId }));
 }
Exemplo n.º 9
0
 public DateTime GetLastLogDateBySiteId(int SiteId)
 {
     return(DataVault
            .Get <DateTime>(DapperMethod.CoreServices.GetLastLogDateBySiteId,
                            new { @SiteId = SiteId }));
 }
 public IISMailQueue GetMail(int id)
 {
     return(DataVault
            .Get <IISMailQueue>(DapperMethod.MailServices.GetMail,
                                new { @Id = id }));
 }
 public IISMailQueue DequeueMail()
 {
     return(DataVault
            .Get <IISMailQueue>(DapperMethod.MailServices.DequeueMail));
 }
 public ServiceParameter GetServiceParameter(int ServiceId, int ClientId)
 {
     return(DataVault
            .Get <ServiceParameter>(DapperMethod.ManagementServices.GetServiceParameter,
                                    new { @ServiceId = ServiceId, @ClientId = ClientId }));
 }
Exemplo n.º 13
0
 public bool IsValidUser(string username, string password)
 {
     return(DataVault
            .Get <int>(DapperMethod.AuthenticationServices.IsValidUser,
                       new { @Username = username, @Password = password }) != 0);
 }
Exemplo n.º 14
0
 public bool SignUpAgent(string username, string password)
 {
     return(DataVault
            .Get <int>(DapperMethod.AuthenticationServices.SignUpAgent,
                       new { @Username = username, @Password = password }) != -1);
 }
 public SiteWebConfiguration GetSiteWebConfiguration(int id)
 {
     return(DataVault
            .Get <SiteWebConfiguration>(DapperMethod.CoreServices.GetSiteWebConfigBySiteId,
                                        new { @Id = id }));
 }
Exemplo n.º 16
0
 public SiteEndpoint GetSiteEndpoint(int Id)
 {
     return(DataVault
            .Get <SiteEndpoint>(DapperMethod.TrackingServices.GetSiteEndpointById,
                                new { @Id = Id }));
 }
 public SiteLog GetSiteLog(int id)
 {
     return(DataVault
            .Get <SiteLog>(DapperMethod.CoreServices.GetSiteEventLogById,
                           new { @Id = id }));
 }