Exemplo n.º 1
0
        // what about localhost or default site address .. saas index page??
        public void SetTenantStatus(SAASType sAASType)
        {
            if (!sAASType.Equals(SAASType.NoSaas))
            {
                RFDB   db      = new RFDB();
                string siteURL = new Http().HttpContext.Request.Host.Value.Split('.')[0];

                if (!string.IsNullOrEmpty(siteURL)) // why i need this at least i will get localhost
                {
                    Tenant tenant       = new Tenant();
                    var    cookieTenant = cookieManager.Get("_tenant");

                    if (!string.IsNullOrEmpty(cookieTenant))
                    {
                        tenant.SubdomainPrefix = cookieTenant;
                    }
                    else
                    {
                        tenant = db.Get <Tenant>(exp => exp.SubdomainPrefix == siteURL, new SaasRoutingContext()).FirstOrDefault();
                    }

                    if (tenant != null)
                    {
                        cookieManager.Set("_tenant", tenant.SubdomainPrefix);
                        CurrentTenant = tenant.SubdomainPrefix;
                        if (tenant.IsPendingUpdate)
                        {
                            db.ExecuteSQLFile(tenant.UpdateSQL, this, siteURL);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
 public DefaultMSSQLContext(SAASType sAASType) : base("DefaultConnection", sAASType)
 {
 }
Exemplo n.º 3
0
 public RFCoreDbContext(string connectionStirng, SAASType sAASType)
 {
     this.sAASType         = sAASType;
     this.connectionStirng = connectionStirng;
     SetTenantStatus(sAASType);
 }
Exemplo n.º 4
0
 public TestBase(SAASType sAASType) : base("MSSQLConnection", sAASType)
 {
 }