public ActionResult InviteFriends(int eventPageId, int[] customerIds) { if (_workContext.CurrentCustomer.IsGuest()) { return(Json(new { redirect = Url.RouteUrl("Login") }, JsonRequestBehavior.AllowGet)); } var invitedCustomers = _eventPageAttendanceService.InviteFriends(eventPageId, customerIds); var models = new List <object>(); foreach (var customer in invitedCustomers) { models.Add(new { CustomerId = customer.Id, FullName = customer.GetFullName(), PictureUrl = _pictureService.GetPictureUrl( customer.GetAttribute <int>(SystemCustomerAttributeNames.AvatarPictureId), _mobSocialSettings.EventPageAttendanceThumbnailSize, _customerSettings.DefaultAvatarEnabled, defaultPictureType: PictureType.Avatar), ProfileUrl = Url.RouteUrl("CustomerProfileUrl", new { SeName = SeoExtensions.GetSeName(customer, 0) }), }); } return(Json(models)); }
public IHttpActionResult InviteFriends(int eventPageId, int[] customerIds) { if (ApplicationContext.Current.CurrentUser.IsVisitor()) { return(Unauthorized()); } var invitedCustomers = _eventPageAttendanceService.InviteFriends(eventPageId, customerIds); var models = new List <object>(); foreach (var customer in invitedCustomers) { models.Add(customer.ToModel(_mediaService, _mediaSettings)); } return(Json(models)); }