Exemplo n.º 1
0
        public IActionResult Update(string id, [FromBody] OaTenant oaTenant)
        {
            if (oaTenant == null)
            {
                return(BadRequest());
            }

            Tenant.Update(_setting, Request, oaTenant);

            return(Ok());
        }
Exemplo n.º 2
0
        public IActionResult Create([FromBody] OaTenant oaTenant)
        {
            if (oaTenant == null)
            {
                return(BadRequest());
            }

            // Call Models
            var tenantId = Tenant.Create(_setting, Request, oaTenant);

            return(CreatedAtRoute(
                       "Root",
                       null,
                       new { tenantId }
                       ));
        }
Exemplo n.º 3
0
        public static Tenant GetObject(Setting setting, HttpRequest request, OaTenant oaTenant)
        {
            var oaApplication = Oa.GetResource <OaApplication>(setting, request, oaTenant.AppLink.ApsLink.Id);
            var oaAccount     = Oa.GetResource <OaAccount>(setting, request, oaTenant.AccountLink.ApsLink.Id);

            return(new Tenant
            {
                Id = oaTenant.Aps.Id,
                CompanyName = oaAccount.CompanyName,
                App = Application.GetObject(oaApplication),

                // resources
                UsersLimit = oaTenant.UsersLimit.Limit,
                DiskspaceLimit = oaTenant.DiskspaceLimit.Limit,
                DevicesLimit = oaTenant.DevicesLimit.Limit
            });
        }
Exemplo n.º 4
0
        public static void Update(Setting setting, HttpRequest request, OaTenant oaTenant)
        {
            var tenant = GetObject(setting, request, oaTenant);

            FbClient.Update(setting, tenant);
        }
Exemplo n.º 5
0
        public static string Create(Setting setting, HttpRequest request, OaTenant oaTenant)
        {
            var tenant = GetObject(setting, request, oaTenant);

            return(FbClient.Create(setting, tenant));
        }