public IActionResult Settings(string search = "") { var profile = _db.Profiles.Single(b => b.IdentityName == User.Identity.Name); //var emails = Emails(); //if (!string.IsNullOrEmpty(search)) //{ // emails = emails.Where(e => e.Contains(search)).ToList(); //} dynamic settings = new SettingsModel(); settings = _jsonService.JSONStringToObject <SettingsModel>(FirstValue()); var info = new PackageInfo(); var model = new AdminSettingsModel { Profile = profile, Settings = settings, PackageItem = info.GetAttributes() }; return(View("~/Views/Shared/Components/ProjectReference/Settings.cshtml", model)); }
public IActionResult Settings(string search = "") { var profile = _db.Profiles.Single(b => b.IdentityName == User.Identity.Name); var emails = Emails(); if (!string.IsNullOrEmpty(search)) { emails = emails.Where(e => e.Contains(search)).ToList(); } dynamic settings = new { Emails = emails, Pager = new Pager(1) }; var info = new PackageInfo(); var model = new AdminSettingsModel { Profile = profile, Settings = settings, PackageItem = info.GetAttributes() }; return(View("~/Views/Shared/Components/Newsletter/Settings.cshtml", model)); }
public async Task SetValue([FromBody] CustomFieldItem item) { var info = new PackageInfo(); var pck = info.GetAttributes(); var value = FirstValue(); if (value != null) { if (!value.Contains(item.CustomValue)) { value = item.CustomValue; value = _jsonService.ObjectToJSONString(pck); await _db.CustomFields.SetCustomField(CustomType.Application, 0, item.CustomKey, value); } } else { await _db.CustomFields.SetCustomField(CustomType.Application, 0, item.CustomKey, item.CustomValue); } }