Beispiel #1
0
        public async Task <bool> DeleteData(string[] ids, string partition, string userId)
        {
            try
            {
                if (ids.Any())
                {
                    foreach (var id in ids)
                    {
                        ServicePlanModel servicePlan = await _cosmosDBOperationsRepository.GetItemFromCollectionAsync(id, partition, collectionId);

                        if (servicePlan != null)
                        {
                            servicePlan.IsDeleted  = true;
                            servicePlan.ModifiedBy = userId;
                            servicePlan.ModifiedOn = DateTime.Now;
                            var response = await _cosmosDBOperationsRepository.UpdateDocumentFromCollection(id, servicePlan, partition, collectionId);
                        }
                    }
                }

                return(true);
            }
            catch (Exception e)
            {
                Inseego.Utils.Shared.ExceptionHandler.LogException("DeleteData had an issue", e);
                throw;
            }
        }
Beispiel #2
0
        public LicenseTypesResponse UpdateLicenseTypes(LicenseTypeUpdateRequest request, string UserId, string TenantId)
        {
            LicenseTypesResponse responseModel = new LicenseTypesResponse();

            LicenseTypesModel licenseTypesModel = GetLicenseTypeById(request, TenantId, out LicenseTypesStatusModel licenseTypesStatus);

            if (licenseTypesStatus.IsLicenseTypesFound)
            {
                licenseTypesModel.licenseTypeName = request.LicenseTypeName;
                licenseTypesModel.modifiedBy      = UserId;
                licenseTypesModel.modifiedDate    = DateTime.UtcNow;

                LicenseTypesModel result = _cosmosDBOperationsRepository.UpdateDocumentFromCollection(licenseTypesModel.id, licenseTypesModel, TenantId, licenseTypeCollectionId).Result;
                CommonFunctions.CopyProperties(result, responseModel);
            }
            return(responseModel);
        }
        public ServiceTypesResponse UpdateServiceTypes(ServiceTypeUpdateRequest request, string UserId, string TenantId)
        {
            ServiceTypesResponse responseModel = new ServiceTypesResponse();

            ServiceTypesModel serviceTypesModel = GetServiceTypeById(request, TenantId, out ServiceTypesStatusModel serviceTypesStatus);

            if (serviceTypesStatus.IsServiceTypesFound)
            {
                serviceTypesModel.serviceTypeName = request.ServiceTypeName;
                serviceTypesModel.modifiedBy      = UserId;
                serviceTypesModel.modifiedDate    = DateTime.UtcNow;

                ServiceTypesModel result = _cosmosDBOperationsRepository.UpdateDocumentFromCollection(serviceTypesModel.id, serviceTypesModel, TenantId, servicePlanTypeCollectionId).Result;
                CommonFunctions.CopyProperties(result, responseModel);
            }
            return(responseModel);
        }