Exemplo n.º 1
0
        public JsonResult GetTenantInfo()
        {
            var tenant = CurrentTenant;

            if (tenant == null)
            {
                return(Json(false));
            }
            var model = new AppTenantViewModel
            {
                Name    = tenant.Name,
                Address = tenant.Address,
                Phone   = tenant.Phone
            };

            return(Json(model));
        }
Exemplo n.º 2
0
 public JsonResult UpdateTenantInfo(AppTenantViewModel model)
 {
     try
     {
         var tenant = CurrentTenant;
         if (tenant == null)
         {
             return(Json(false));
         }
         tenant.Name    = model.Name;
         tenant.Address = model.Address;
         tenant.Phone   = model.Phone;
         _cloudOfficeContext.SaveChanges();
         return(Json(true));
     }
     catch (Exception e)
     {
         _logger.LogError(e.Message);
         throw;
     }
 }