Exemplo n.º 1
0
        public ActionResult Edit(CampaignModel model, bool continueEditing)
        {
            var campaign = _campaignService.GetCampaignById(model.Id);

            if (campaign == null)
            {
                return(RedirectToAction("List"));
            }

            if (ModelState.IsValid)
            {
                campaign = model.ToEntity(campaign);
                _campaignService.UpdateCampaign(campaign);

                SaveAclMappings(campaign, model.SelectedCustomerRoleIds);
                SaveStoreMappings(campaign, model.SelectedStoreIds);

                NotifySuccess(T("Admin.Promotions.Campaigns.Updated"));
                return(continueEditing ? RedirectToAction("Edit", new { id = campaign.Id }) : RedirectToAction("List"));
            }

            PrepareCampaignModel(model, campaign);

            return(View(model));
        }
Exemplo n.º 2
0
        public void BindCampaign_ShouldReturnTrue_WhenCategoryExists()
        {
            //Arrange
            var campaignId    = Guid.NewGuid();
            var campaignTitle = "Summer Campaign";
            var amount        = 5;
            var campaignDto   = new CampaignModel
            {
                Id     = campaignId,
                Title  = campaignTitle,
                Amount = amount
            };

            CampaignOperations.CampaignList.Add(campaignDto);

            var categoryId        = Guid.NewGuid();
            var categoryTitle     = "Technology";
            var parentCampaignDto = new CategoryModel
            {
                Id    = categoryId,
                Title = categoryTitle
            };

            //Act
            var result = _campaignOperations.BindCampaignToCategory(campaignId, categoryId);

            //Assert
            Assert.True(result);
        }
Exemplo n.º 3
0
        private async void BtnSave_Clicked(object sender, EventArgs e)
        {
            Overlay.IsVisible = true;

            var campaign = new CampaignModel()
            {
                Organization = EntName.Text,
                Description  = EntDesc.Text,
                Location     = EntLocation.Text,
                EventDate    = EntDate.Date + EntTime.Time,
            };

            var response = await apiServices.AddCampaign(campaign);

            if (!response)
            {
                Overlay.IsVisible = false;
                await DisplayAlert("Oops", "Something went wrong", "Cancel");
            }
            else
            {
                Overlay.IsVisible = false;
                await DisplayAlert("Success", "Campaign added successfully", "Ok");

                EntName.Text     = "";
                EntLocation.Text = "";
                EntDesc.Text     = "";
                await apiServices.SendSms(campaign);

                await Navigation.PushAsync(new Campaigns());
            }
        }
Exemplo n.º 4
0
        public List <CampaignModel> GetDataByCampaignCode(string campaigncode)
        {
            var DetailList = new List <CampaignModel>();
            var c          = new CampaignModel();

            c.campaigncode = campaigncode;

            // Getting all company data
            HttpClient client = new HttpClient();

            //    HttpClient client = new HttpClient();
            var json    = JsonConvert.SerializeObject(c);
            var request = new HttpRequestMessage
            {
                Method = HttpMethod.Post,
                // RequestUri = new Uri("http://localhost:18657/api/CampDetail"),
                RequestUri = new Uri(strpathAPI + "api/CampDetail"),
                Content    = new StringContent(json, Encoding.UTF8, "application/json")
            };

            HttpResponseMessage response = client.SendAsync(request).Result;

            //var response = client.SendAsync(request).ConfigureAwait(false);
            if (response.IsSuccessStatusCode)
            {
                var result = response.Content.ReadAsStringAsync().Result;
                //data
                DetailList = JsonConvert.DeserializeObject <List <CampaignModel> >(result);
            }

            return(DetailList);
        }
Exemplo n.º 5
0
 public CampaignModel Insert(CampaignModel entity)
 {
     using (UnitOfWork.BeginTransasction())
     {
         try
         {
             var campaign = new Campaign();
             campaign.StartDateTime = entity.StartDateTime;
             campaign.EndDateTime   = entity.EndDateTime;
             campaign.Budget        = entity.Budget;
             campaign.Name          = entity.Name;
             campaign.Action        = entity.Action;
             campaign.Country       = entity.Country;
             campaign.ClientId      = entity.ClientId;
             campaign.AddedBy       = entity.AddedBy;
             var obj = _campaignRepository.Insert(campaign);
             UnitOfWork.Commit();
             return(entity);
         }
         catch (Exception ex)
         {
             UnitOfWork.Rollback();
             return(entity);
         }
     }
 }
Exemplo n.º 6
0
        public int Delete(CampaignModel entity)
        {
            var campaign = new Campaign();

            campaign.Id = entity.CampaignModelId;
            return(_campaignRepository.Delete(campaign));
        }
Exemplo n.º 7
0
        public async Task <Message <CampaignModel> > UpdateCampaign(int id, CampaignModel model)
        {
            var requestUrl = CreateRequestUri(string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                            "Campaigns/" + id.ToString()));

            return(await PutAsync <CampaignModel>(requestUrl, model));
        }
Exemplo n.º 8
0
        public DataTable SetStatusOnCampaign(CampaignModel campaign)
        {
            DataTable     dt           = new DataTable();
            List <sqlTbl> sqlParasList = new List <sqlTbl>();

            sqlParasList.Add(new sqlTbl("@INStatus", campaign.Status));
            sqlParasList.Add(new sqlTbl("@INCampaignID", campaign.CampaignID));
            dt = dbConnectionHelper.procedureRequest("SetStatusOnCampaign", sqlParasList, "iqmarket");

            if (dbConnectionHelper.getError() != "")
            {
                //ErrorModel error = new ErrorModel();
                //error.controlerName = "UserController";
                //error.ProcedureName = "GetUserInfoByEmail";
                //error.metodName = methodName;
                //error.formName = formName;
                //error.date = DateTime.Now;
                //error.ErrorMessage = dbConnectionHelper.getError();
                //error.username = userName;
                //foreach (sqlTbl el in sqlParasList)
                //    error.parametarList += el.name + ": " + el.value + ";";

                //errorHandler.errorLogInsert(error);
                dt.TableName = "Error";
                return(dt);
            }
            else
            {
                dt.TableName = "Table";
                return(dt);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Prepare campaign model
        /// </summary>
        /// <param name="model">Campaign model</param>
        /// <param name="campaign">Campaign</param>
        /// <param name="excludeProperties">Whether to exclude populating of some properties of model</param>
        /// <returns>Campaign model</returns>
        public virtual CampaignModel PrepareCampaignModel(CampaignModel model, Campaign campaign, bool excludeProperties = false)
        {
            //fill in model values from the entity
            if (campaign != null)
            {
                model = model ?? campaign.ToModel <CampaignModel>();
                if (campaign.DontSendBeforeDateUtc.HasValue)
                {
                    model.DontSendBeforeDate = _dateTimeHelper.ConvertToUserTime(campaign.DontSendBeforeDateUtc.Value, DateTimeKind.Utc);
                }
            }

            model.AllowedTokens = string.Join(", ", _messageTokenProvider.GetListOfCampaignAllowedTokens());

            //whether to fill in some of properties
            if (!excludeProperties)
            {
                model.EmailAccountId = _emailAccountSettings.DefaultEmailAccountId;
            }

            //prepare available stores
            _baseAdminModelFactory.PrepareStores(model.AvailableStores);

            //prepare available customer roles
            _baseAdminModelFactory.PrepareCustomerRoles(model.AvailableCustomerRoles);

            //prepare available email accounts
            _baseAdminModelFactory.PrepareEmailAccounts(model.AvailableEmailAccounts, false);

            return(model);
        }
Exemplo n.º 10
0
        public virtual IActionResult Create(CampaignModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCampaigns))
            {
                return(AccessDeniedView());
            }

            if (ModelState.IsValid)
            {
                var campaign = model.ToEntity();
                campaign.CreatedOnUtc          = DateTime.UtcNow;
                campaign.DontSendBeforeDateUtc = model.DontSendBeforeDate.HasValue ?
                                                 (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.DontSendBeforeDate.Value) : null;
                _campaignService.InsertCampaign(campaign);

                //activity log
                _customerActivityService.InsertActivity("AddNewCampaign",
                                                        string.Format(_localizationService.GetResource("ActivityLog.AddNewCampaign"), campaign.Id), campaign);

                SuccessNotification(_localizationService.GetResource("Admin.Promotions.Campaigns.Added"));
                return(continueEditing ? RedirectToAction("Edit", new { id = campaign.Id }) : RedirectToAction("List"));
            }

            //If we got this far, something failed, redisplay form
            model.AllowedTokens = string.Join(", ", _messageTokenProvider.GetListOfCampaignAllowedTokens());
            //stores
            PrepareStoresModel(model);
            //customer roles
            PrepareCustomerRolesModel(model);
            //email accounts
            PrepareEmailAccountsModel(model);

            return(View(model));
        }
        public virtual async Task <IActionResult> SendTestEmail(CampaignModel model)
        {
            if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageCampaigns))
            {
                return(AccessDeniedView());
            }

            //try to get a campaign with the specified id
            var campaign = await _campaignService.GetCampaignByIdAsync(model.Id);

            if (campaign == null)
            {
                return(RedirectToAction("List"));
            }

            //prepare model
            model = await _campaignModelFactory.PrepareCampaignModelAsync(model, campaign);

            //ensure that the entered email is valid
            if (!CommonHelper.IsValidEmail(model.TestEmail))
            {
                _notificationService.ErrorNotification(await _localizationService.GetResourceAsync("Admin.Common.WrongEmail"));
                return(View(model));
            }

            try
            {
                var emailAccount = await GetEmailAccountAsync(model.EmailAccountId);

                var subscription = await _newsLetterSubscriptionService
                                   .GetNewsLetterSubscriptionByEmailAndStoreIdAsync(model.TestEmail, (await _storeContext.GetCurrentStoreAsync()).Id);

                if (subscription != null)
                {
                    //there's a subscription. let's use it
                    await _campaignService.SendCampaignAsync(campaign, emailAccount, new List <NewsLetterSubscription> {
                        subscription
                    });
                }
                else
                {
                    //no subscription found
                    await _campaignService.SendCampaignAsync(campaign, emailAccount, model.TestEmail);
                }

                _notificationService.SuccessNotification(await _localizationService.GetResourceAsync("Admin.Promotions.Campaigns.TestEmailSentToCustomers"));

                return(View(model));
            }
            catch (Exception exc)
            {
                await _notificationService.ErrorNotificationAsync(exc);
            }

            //prepare model
            model = await _campaignModelFactory.PrepareCampaignModelAsync(model, campaign, true);

            //if we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 12
0
        public virtual async Task <CampaignModel> PrepareCampaignModel()
        {
            var model = new CampaignModel();

            model.AllowedTokens = _messageTokenProvider.GetListOfCampaignAllowedTokens();
            //stores
            await PrepareStoresModel(model);

            //languages
            await PrepareLanguagesModel(model);

            //Tags
            await PrepareCustomerTagsModel(model);

            //Roles
            await PrepareCustomerRolesModel(model);

            //Newsletter categories
            await PrepareNewsletterCategoriesModel(model);

            //email
            await PrepareEmailAccounts(model);

            return(model);
        }
Exemplo n.º 13
0
        public ApiResponse Add(CampaignModel campaignModel, string userId)
        {
            var campaign = _mapper.Map <CampaignModel, Campaign>(campaignModel);

            try
            {
                campaign.AppUserId = userId;
                campaign.ID        = default;

                _ctx.Campaigns.Add(MapValues(campaign));
                _ctx.SaveChanges();

                return(new ApiResponse
                {
                    StatusCode = ApiCodes.Ok,
                    InsertedID = campaign.ID
                });
            }
            catch (Exception e)
            {
                _logger.LogError(e.Message);
                return(new ApiResponse
                {
                    StatusCode = ApiCodes.Error
                });
            }
        }
Exemplo n.º 14
0
        public ActionResult Create(CampaignModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCampaigns))
            {
                return(AccessDeniedView());
            }

            if (ModelState.IsValid)
            {
                var campaign = model.ToEntity();
                campaign.CreatedOnUtc = DateTime.UtcNow;
                _campaignService.InsertCampaign(campaign);

                UpdateLocales(campaign, model);
                SuccessNotification(_localizationService.GetResource("Admin.Promotions.Campaigns.Added"));
                return(continueEditing ? RedirectToAction("Edit", new { id = campaign.Id }) : RedirectToAction("List"));
            }

            //If we got this far, something failed, redisplay form
            model.AllowedTokens = FormatTokens(_messageTokenProvider.GetListOfCampaignAllowedTokens());

            model.CategoriesTree = new List <TreeViewItemModel>();
            model.CategoriesTree = PrepareTreeView(model.CategoriesTree, 0);
            return(View(model));
        }
Exemplo n.º 15
0
 public CampaignModel Update(CampaignModel entity)
 {
     using (UnitOfWork.BeginTransasction())
     {
         try
         {
             var campaign = _campaignRepository.GetById(entity.CampaignModelId);
             campaign.Name          = entity.Name;
             campaign.Budget        = entity.Budget;
             campaign.StartDateTime = entity.StartDateTime;
             campaign.EndDateTime   = entity.EndDateTime;
             campaign.Country       = entity.Country;
             campaign.Action        = entity.Action;
             campaign.ClientId      = entity.ClientId;
             campaign.ModifiedBy    = entity.ModifiedBy;
             _campaignRepository.Update(campaign);
             UnitOfWork.Commit();
             return(entity);
         }
         catch
         {
             UnitOfWork.Rollback();
             return(entity);
         }
     }
 }
Exemplo n.º 16
0
        public ActionResult Create()
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCampaigns))
            {
                return(AccessDeniedView());
            }

            var model    = new CampaignModel();
            var compaign = new Campaign();

            model.Locales = new List <CompaignLocalizedModel>();
            AddLocales(_languageService, model.Locales, (locale, languageId) =>
            {
                locale.Subject = compaign.GetLocalized(x => x.Subject, languageId, false, false);
                locale.Body    = compaign.GetLocalized(x => x.Body, languageId, false, false);
            });
            model.CompaignLanguages = _languageService.GetAllLanguages()
                                      .Select(x => new CompaignLanguage()
            {
                LanguageId   = x.Id,
                LanguageName = x.Name,
                Selected     = false
            }).ToList();
            model.CategoriesTree = new List <TreeViewItemModel>();
            model.CategoriesTree = PrepareTreeView(model.CategoriesTree, 0);
            model.AllowedTokens  = FormatTokens(_messageTokenProvider.GetListOfRecentProductsTokens());
            return(View(model));
        }
Exemplo n.º 17
0
        /// <summary>
        /// Check model locales
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        protected bool CheckLocales(CampaignModel model)
        {
            foreach (var lang in model.CompaignLanguages.Where(x => x.Selected))
            {
                var locale = model.Locales.Where(x => x.LanguageId == lang.LanguageId).FirstOrDefault();
                if (locale == null)
                {
                    lang.LanguageName = "locale";
                    return(false);
                }
                if (locale.Subject == null)
                {
                    lang.LanguageName = _localizationService.GetResource("Admin.Promotions.Campaigns.Fields.Subject", _workContext.WorkingLanguage.Id);
                    return(false);
                }

                if (locale.Body == null)
                {
                    lang.LanguageName = _localizationService.GetResource("Admin.Promotions.Campaigns.Fields.Body", _workContext.WorkingLanguage.Id);
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 18
0
        // Create CampaignModel
        public CampaignModel createCampaignModel(Dictionary <string, object> campaign)
        {
            var utmSource       = new object();
            var utmMedium       = new object();
            var utmCampaign     = new object();
            var utmTerm         = new object();
            var utmContent      = new object();
            var referrer        = new object();
            var referringDomain = new object();
            var gclid           = new object();

            var campaignModel = new CampaignModel()
            {
                UtmSource       = campaign.TryGetValue("utm_source", out utmSource) ? utmSource.ToString() : null,
                UtmMedium       = campaign.TryGetValue("utm_medium", out utmMedium) ? utmMedium.ToString() : null,
                UtmCampaign     = campaign.TryGetValue("utm_campaign", out utmCampaign) ? utmCampaign.ToString() : null,
                UtmTerm         = campaign.TryGetValue("utm_term", out utmTerm) ? utmTerm.ToString() : null,
                UtmContent      = campaign.TryGetValue("utm_content", out utmContent) ? utmContent.ToString() : null,
                Referrer        = campaign.TryGetValue("referrer", out referrer) ? referrer.ToString() : null,
                ReferringDomain = campaign.TryGetValue("referring_domain", out referringDomain) ? referringDomain.ToString() : null,
                Gclid           = campaign.TryGetValue("gclid", out gclid) ? gclid.ToString() : null
            };

            return(campaignModel);
        }
Exemplo n.º 19
0
        public ActionResult Edit(CampaignModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCampaigns))
            {
                return(AccessDeniedView());
            }

            var campaign = _campaignService.GetCampaignById(model.Id);

            if (campaign == null)
            {
                return(RedirectToAction("List"));
            }

            if (ModelState.IsValid)
            {
                campaign = model.ToEntity(campaign);
                _campaignService.UpdateCampaign(campaign);

                _storeMappingService.SaveStoreMappings <Campaign>(campaign, model.SelectedStoreIds);

                NotifySuccess(_localizationService.GetResource("Admin.Promotions.Campaigns.Updated"));
                return(continueEditing ? RedirectToAction("Edit", new { id = campaign.Id }) : RedirectToAction("List"));
            }

            //If we got this far, something failed, redisplay form
            PrepareCampaignModel(model, campaign, true);

            return(View(model));
        }
Exemplo n.º 20
0
        public virtual IActionResult Create(CampaignModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCampaigns))
            {
                return(AccessDeniedView());
            }

            if (ModelState.IsValid)
            {
                var campaign = model.ToEntity <Campaign>();

                campaign.CreatedOnUtc          = DateTime.UtcNow;
                campaign.DontSendBeforeDateUtc = model.DontSendBeforeDate.HasValue ?
                                                 (DateTime?)_dateTimeHelper.ConvertToUtcTime(model.DontSendBeforeDate.Value) : null;

                _campaignService.InsertCampaign(campaign);

                //activity log
                _customerActivityService.InsertActivity("AddNewCampaign",
                                                        string.Format(_localizationService.GetResource("ActivityLog.AddNewCampaign"), campaign.Id), campaign);

                _notificationService.SuccessNotification(_localizationService.GetResource("Admin.Promotions.Campaigns.Added"));

                return(continueEditing ? RedirectToAction("Edit", new { id = campaign.Id }) : RedirectToAction("List"));
            }

            //prepare model
            model = _campaignModelFactory.PrepareCampaignModel(model, null, true);

            //if we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 21
0
        protected virtual void PrepareStoresModel(CampaignModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            #region Extensions by QuanNH
            //stores
            var _workContext = Nop.Core.Infrastructure.EngineContext.Current.Resolve <Nop.Core.IWorkContext>();
            var AllStores    = _storeService.GetAllStoresByEntityName(_workContext.CurrentCustomer.Id, "Stores");
            if (AllStores.Count <= 0)
            {
                AllStores = _storeService.GetAllStores();
                model.AvailableStores.Add(new SelectListItem {
                    Text = _localizationService.GetResource("Admin.Common.All"), Value = "0"
                });
            }
            foreach (var s in AllStores)
            {
                model.AvailableStores.Add(new SelectListItem {
                    Text = s.Name, Value = s.Id.ToString()
                });
            }

            #endregion
        }
Exemplo n.º 22
0
        public ActionResult Edit(CampaignModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCampaigns))
            {
                return(AccessDeniedView());
            }

            var campaign = _campaignService.GetCampaignById(model.Id);

            if (campaign == null)
            {
                //No campaign found with the specified id
                return(RedirectToAction("List"));
            }

            if (ModelState.IsValid)
            {
                campaign = model.ToEntity(campaign);
                _campaignService.UpdateCampaign(campaign);

                SuccessNotification(_localizationService.GetResource("Admin.Promotions.Campaigns.Updated"));
                return(continueEditing ? RedirectToAction("Edit", new { id = campaign.Id }) : RedirectToAction("List"));
            }

            //If we got this far, something failed, redisplay form
            model.AllowedTokens = FormatTokens(_messageTokenProvider.GetListOfCampaignAllowedTokens());
            return(View(model));
        }
Exemplo n.º 23
0
        public async Task <IActionResult> UpdateCampaign([FromBody] CampaignModel data)
        {
            var service  = new CampaignService(new HttpService($"{urlService}"));
            var response = await service.UpdateCampaign(data);

            return(this.Ok(response));
        }
Exemplo n.º 24
0
        public IActionResult Create(CampaignModel model, bool continueEditing)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageCampaigns))
            {
                return(AccessDeniedView());
            }

            if (ModelState.IsValid)
            {
                var campaign = model.ToEntity();
                campaign.CreatedOnUtc = DateTime.UtcNow;
                _campaignService.InsertCampaign(campaign);

                SuccessNotification(_localizationService.GetResource("Admin.Promotions.Campaigns.Added"));
                return(continueEditing ? RedirectToAction("Edit", new { id = campaign.Id }) : RedirectToAction("List"));
            }

            //If we got this far, something failed, redisplay form
            model.AllowedTokens = FormatTokens(_messageTokenProvider.GetListOfCampaignAllowedTokens());
            //stores
            PrepareStoresModel(model);
            //Tags
            PrepareCustomerTagsModel(model);
            //Newsletter categories
            PrepareNewsletterCategoriesModel(model);
            //Roles
            PrepareCustomerRolesModel(model);
            //email
            PrepareEmailAccounts(model);

            return(View(model));
        }
Exemplo n.º 25
0
        public ActionResult Create()
        {
            var model = new CampaignModel();

            PrepareCampaignModel(model, null, false);
            return(View(model));
        }
Exemplo n.º 26
0
        public ActionResult SendMassEmail(CampaignModel model)
        {
            var campaign = _campaignService.GetCampaignById(model.Id);

            if (campaign == null)
            {
                return(RedirectToAction("List"));
            }

            PrepareCampaignModel(model, campaign, false);

            try
            {
                var subscriptions   = _newsLetterSubscriptionService.GetAllNewsLetterSubscriptions(null, 0, int.MaxValue, false);
                var totalEmailsSent = _campaignService.SendCampaign(campaign, subscriptions);

                NotifySuccess(string.Format(T("Admin.Promotions.Campaigns.MassEmailSentToCustomers"), totalEmailsSent), false);
                return(View(model));
            }
            catch (Exception exc)
            {
                NotifyError(exc, false);
            }

            // If we got this far, something failed, redisplay form
            return(View(model));
        }
Exemplo n.º 27
0
 protected virtual void PrepareEmailAccounts(CampaignModel model)
 {
     //available email accounts
     foreach (var ea in _emailAccountService.GetAllEmailAccounts())
     {
         model.AvailableEmailAccounts.Add(ea.ToModel());
     }
 }
Exemplo n.º 28
0
        public virtual Campaign InsertCampaignModel(CampaignModel model)
        {
            var campaign = model.ToEntity();

            campaign.CreatedOnUtc = DateTime.UtcNow;
            _campaignService.InsertCampaign(campaign);
            return(campaign);
        }
        //An action result that actually deletes the information from the database
        public ActionResult DeleteConfirmed(int id)
        {
            CampaignModel campaignModel = db.CampaignModels.Find(id);

            db.CampaignModels.Remove(campaignModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 30
0
        public async Task <ResponseBase <bool> > UpdateCampaign(CampaignModel data)
        {
            var response = new ResponseBase <bool>();

            response = await httpService.Send <bool, CampaignModel>(data, BodyMethod.Put);

            return(await Task.Run(() => response));
        }