Пример #1
0
        public IActionResult GetDefaultColumnName(Guid rootTenantId, Guid initTenantId)
        {
            HttpRequestMessage request = new HttpRequestMessage();

            try
            {
                var replacer = new InitilizeManager();
                replacer.Test(rootTenantId, initTenantId);
                return(this.Ok("test"));
            }
            catch (Exception ex)
            {
                _log.Error(ExceptionFormatter.SerializeToString(ex));
                return(StatusCode((int)HttpStatusCode.InternalServerError, ApiConstant.CustomErrorMessage));
            }
        }
        WorkFlowProcessMessage IOperation.Execute(dynamic obj)
        {
            IInitilizeManager   _initilizeManager = new InitilizeManager();
            IEntityQueryManager queryManager      = new EntityQueryManager();
            IManagerTenantSubscriptionEntity _managerSubscriptionEntity = new ManagerTenantSubscriptionEntity();
            var objWorkFlowProcessMessage = new WorkFlowProcessMessage();

            try
            {
                objWorkFlowProcessMessage = new WorkFlowProcessMessage {
                    Success = true
                };
                var workFlowProcessProperties = (WorkFlowProcessProperties)obj[0];
                var tenantId = (Guid)obj[2];

                var subscriptionId = queryManager.GetSpecificIdByQuery(tenantId, workFlowProcessProperties.EntityName, workFlowProcessProperties.resultId, "TenantSubscription");
                if (subscriptionId != null)
                {
                    var subscriptionEntities = _managerSubscriptionEntity.TenantSubscriptionEntities(tenantId, new Guid(subscriptionId.ToString()));
                    if (subscriptionEntities.Any())
                    {
                        var entityIds = subscriptionEntities.Select(p => p.EntityId).ToList();
                        var status    = _initilizeManager.Initilize(workFlowProcessProperties.resultId, entityIds, workFlowProcessProperties.UserId, subscriptionId);
                    }
                }


                return(objWorkFlowProcessMessage);
            }
            catch (System.Exception ex)
            {
                _log.Error("TenantInitilization_PostProcess  having exception message" + ex.Message);

                objWorkFlowProcessMessage.Success      = false;
                objWorkFlowProcessMessage.ErrorMessage = new ErrorMessage
                {
                    Code        = WorkFlowMessage.ApplicationError,
                    Description = ex.Message
                };
                return(objWorkFlowProcessMessage);
            }
        }