Exemplo n.º 1
0
        public async Task <XDesign_DesignInfo> GetDesignInfo(XDesign_Design design, int designSize, int layoutSize, int blockSize)
        {
            using var log = BeginFunction(nameof(DesignAjaxService), nameof(GetDesignInfo), design);
            try
            {
                await Task.CompletedTask.ConfigureAwait(false);

                var projectObject = BusinessDataFactory.CreateDesign(design);

                var result = Create.XDesign_DesignInfo(projectObject, designSize, layoutSize, blockSize);

                log.Result(result);
                return(result);
            }
            catch (Exception ex)
            {
                log.Exception(ex);
                throw;
            }
        }
Exemplo n.º 2
0
        public async Task <Guid> SaveDesignAsync(string userId, XDesign_Design design)
        {
            using var log = BeginFunction(nameof(DesignAjaxService), nameof(SaveDesignAsync), userId, design);
            try
            {
                var ownerReference = CreateOwnerReference.FromUserId(userId);
                var ownerId        = await DesignMicroService.AllocateOwnerAsync(ownerReference).ConfigureAwait(false);

                var result = string.IsNullOrEmpty(design.designId)
                    ? await DesignMicroService.CreateDesignAsync(ownerId, design.designName, BusinessDataFactory.Create_MDesign_DesignSpecification(design), GetUtcNow()).ConfigureAwait(false)
                    : await DesignMicroService.UpdateDesignAsync(Guid.Parse(design.designId), BusinessDataFactory.Create_MDesign_DesignSpecification(design), GetUtcNow()).ConfigureAwait(false);

                log.Result(result);
                return(result);
            }
            catch (Exception ex)
            {
                log.Exception(ex);
                throw;
            }
        }