Esempio n. 1
0
        public ActionResult UpdatePrivacy(PrivacyViewModel model, string Property)
        {
            Entity.User user = new User();
            user = aService.GetUser(User.Identity.GetUserId <int>(), "PrivacySetting");

            switch (Property)
            {
            case "ReceiveMail":
                user.PrivacySetting.ReceiveEmail = model.ReceiveEmail;
                break;

            case "SendRequest":
                user.PrivacySetting.SendRequest = model.SendRequest;
                break;

            case "ChatPrivacy":
                user.PrivacySetting.ChatPrivacy = model.ChatPrivacy;
                break;

            case "Notification":
                user.PrivacySetting.Notification = model.Notification;
                break;

            default:
                break;
            }
            aService.UpdateUser(user);
            return(RedirectToAction("Privacy"));
        }
Esempio n. 2
0
        public PrivacyView()
        {
            InitializeComponent();

            PrivacyViewModel vm = new PrivacyViewModel(new PrivacyModel());

            this.DataContext = this.ViewModel = vm;
        }
Esempio n. 3
0
        public IActionResult Privacy()
        {
            PrivacyViewModel model = new PrivacyViewModel();

            model.Message = "This is the privacy page.";

            return(View(model));
        }
Esempio n. 4
0
        public ActionResult Privacy()
        {
            Entity.User user = new User();
            user = aService.GetUser(User.Identity.GetUserId <int>(), "PrivacySetting");
            PrivacyViewModel model = Mapper.Map <User, PrivacyViewModel>(user);

            ViewBag.System = Constant.String.ProfileSystem;
            return(View("Views/PrivacyView", model));
        }
        public IActionResult Privacy()
        {
            var model = new PrivacyViewModel
            {
                UserEmail = User.Identity.Name
            };

            return(View(model));
        }
Esempio n. 6
0
        public IActionResult Privacy()
        {
            var privacyModel = new PrivacyViewModel
            {
                Email = "*****@*****.**"
            };

            return(this.View(privacyModel));
        }
Esempio n. 7
0
        public async Task <IActionResult> Privacy()
        {
            var response = await _finalSpaceClient.GetAllQuotes();

            var viewModel = new PrivacyViewModel();

            viewModel.Quotes = response
                               .Select(response => new QuoteVM()
            {
                Quote = response.quote, ImageUrl = response.image
            })
                               .ToList();

            return(View(viewModel));
        }
Esempio n. 8
0
        public ActionResult Privacy()
        {
            const string assetsPrefix = "site.privacy";

            var metadata = MetadataService.GetMetadataForPage(HttpContext);

            var viewModel = new PrivacyViewModel(assetsPrefix, metadata)
            {
                InlineHeadScript = AssetService.GetInlineHeadScript(),
                InlineHeadStyles = AssetService.GetInlineHeadStyles(assetsPrefix),
                TrackMeta        = new TrackMeta(metadata)
            };

            return(View("Privacy", viewModel));
        }
        public IActionResult Privacy(int?id)
        {
            var model = new PrivacyViewModel
            {
                PolicyVerbiage = "Some super sweet verbiage!",
                AsOf           = DateTime.UtcNow
            };

            //ViewData["Display"] = true;
            //ViewData["Title"] = "Privacy";

            ViewBag.Display = true;
            ViewBag.Title   = "Privacy";

            return(View(model));
        }
Esempio n. 10
0
        public ActionResult Index()
        {
            var model = new PrivacyViewModel();

            if (!IsDemoEnabled())
            {
                model.DemoDisabled = true;
            }
            else if (CurrentContact != null)
            {
                model.Constents = GetAgreedConsentsForCurrentContact();
            }

            model.ShowSavedMessage = TempData[SUCCESS_RESULT] != null;
            model.ShowErrorMessage = TempData[ERROR_RESULT] != null;

            return(View(model));
        }
Esempio n. 11
0
        public ActionResult PrivacyPolicy(PrivacyViewModel model)
        {
            try
            {
                var response = AsyncHelpers.RunSync <JObject>(() => ApiCall.CallApi("api/Settings/SetPrivacyPolicy", User, model));

                if (response is Error || response == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "Internal Server Error"));
                }

                return(Json("Success"));
            }
            catch (Exception ex)
            {
                return(new HttpStatusCodeResult(Utility.LogError(ex), "Internal Server Error"));
            }
        }
Esempio n. 12
0
 public async Task <IHttpActionResult> SetPrivacyPolicy(PrivacyViewModel model)
 {
     try
     {
         using (RiscoContext ctx = new RiscoContext())
         {
             ctx.Settings.FirstOrDefault().PrivacyPolicy = model.PrivacyPolicy;
             ctx.SaveChanges();
             BasketSettings.Settings.PrivacyPolicy = model.PrivacyPolicy;
             return(Ok(new CustomResponse <string> {
                 Message = Global.ResponseMessages.Success, StatusCode = (int)HttpStatusCode.OK
             }));
         }
     }
     catch (Exception ex)
     {
         return(StatusCode(Utility.LogError(ex)));
     }
 }
Esempio n. 13
0
        public ActionResult PrivacyPolicy()
        {
            try
            {
                var response = AsyncHelpers.RunSync <JObject>(() => ApiCall.CallApi("api/Settings/GetSettings", User, null, true));

                if (response is Error)
                {
                    return(new HttpStatusCodeResult((int)HttpStatusCode.InternalServerError, (response as Error).ErrorMessage));
                }

                SettingsViewModel model     = response.GetValue("Result").ToObject <SettingsViewModel>();
                PrivacyViewModel  viewModel = new PrivacyViewModel();
                viewModel.PrivacyPolicy = model.PrivacyPolicy == null ? "" : model.PrivacyPolicy;
                viewModel.SetSharedData(User);
                return(View(viewModel));
            }
            catch (Exception ex)
            {
                return(new HttpStatusCodeResult(Utility.LogError(ex), "Internal Server Error"));
            }
        }
        public IActionResult Privacy()
        {
            var model = new PrivacyViewModel();

            return(View(model));
        }
 public PrivacyFlyout()
 {
     this.InitializeComponent();
     PrivacyViewModel = new PrivacyViewModel();
     this.DataContext = this;
 }
Esempio n. 16
0
 public PrivacyFlyout()
 {
     this.InitializeComponent();
     PrivacyViewModel = new PrivacyViewModel();
     this.DataContext = this;
 }
Esempio n. 17
0
        public ActionResult Edit(Guid id)
        {
            AlbumDto album = readModel.GetAlbums().FirstOrDefault(a => a.Id == id);
            UserDto user = (UserDto)Session["user"];

            PrivacyViewModel pr = new PrivacyViewModel();
            pr.Level = album.Privacy.Level;
            pr.GroupNames = user.Groups.Select(g => new SelectListItem()
            {
                Text = g.Name,
                Value = g.Id.ToString(),
                Selected = album.Privacy.Level == PrivacyLevel.Group ? ((ImageHoster.CQRS.ReadModel.Dto.GroupPrivacy)(album.Privacy)).GroupsEligible.FirstOrDefault(group => g.Id == group.Id) != null : false
            });
            pr.OnlyLoggedInUsers = album.Privacy.OnlyLoggedIn;
            pr.Publish = album.Privacy.Publicized;

            if (user.Equals(album.Owner))
            {
                EditAlbumViewModel model = new EditAlbumViewModel() { Id = id, Description = album.Description, Title = album.Title, Privacy = pr };
                return View(model);
            }
            else
            {
                return new HttpUnauthorizedResult();
            }
        }