Example #1
0
        public override void DoJob(dynamic data)
        {
            var operationGuid = string.Empty;

            try
            {
                DeleteCompanyData json = JsonConvert.DeserializeObject <DeleteCompanyData>(data);
                operationGuid = json.OrderDemandGuid;

                var diskSpaces = _diskSpaceRepository.GetCustomersDiskSpace(json.ExternalId);
                diskSpaces.ForEach(i =>
                {
                    _sTaaSSoap.RenamePhysicalFolder(i.Identifier.ToString("N"));
                });

                _CompanyRepository.DeleteCompany(json.ExternalId, 0);  //unjeti usera

                _orderDemandRepository.ChangeOrderDemandState(operationGuid, (int)OrderDemandStates.Finished);
            }

            catch (Exception ex)
            {
                _orderDemandRepository.ChangeOrderDemandState(operationGuid, (int)OrderDemandStates.FinishedError);
                _logRepository.InsertLogoRecord(nameof(Create), nameof(LogLevel.Error), ex.Message + " " + ex.StackTrace, operationGuid, data);
            }
        }
Example #2
0
        public override void DoJob(dynamic data)
        {
            var operationGuid = string.Empty;

            try
            {
                DeleteDiskSpaceData json = JsonConvert.DeserializeObject <DeleteDiskSpaceData>(data);
                operationGuid = json.OrderDemandGuid;

                var diskSpace = _diskSpaceRepository.GetDiskSpaceInfo(json.UserId, json.DiskSpaceId, true);
                _sTaaSSoap.RenamePhysicalFolder(diskSpace.Identifier.ToString("N"));
                _diskSpaceRepository.DeleteDiskSpace(diskSpace.DiskSpaceID, json.UserId);

                _orderDemandRepository.ChangeOrderDemandState(operationGuid, (int)OrderDemandStates.Finished);

                SendNotification(json, diskSpace.DiskSpaceName);
            }

            catch (Exception ex)
            {
                _orderDemandRepository.ChangeOrderDemandState(operationGuid, (int)OrderDemandStates.FinishedError);
                _logRepository.InsertLogoRecord(nameof(DeleteDiskSpace), nameof(LogLevel.Error), ex.Message + " " + ex.StackTrace, operationGuid, data);
            }
        }