public ContentResult GetMemberSocialNetworksBySignInEmail(String Email)
        {
            var _Networks = MemberSocialNetworks.GetBySignInEmail(Email);

            String Json = MemberSocialNetworks.JsonItem(_Networks);

            return(Content(Json, TypeJson));
        }
        public ContentResult GetMemberSocialNetwork(long MemberID)
        {
            var _Networks = MemberSocialNetworks.GetByMemberID(MemberID);

            String Json = MemberSocialNetworks.JsonItem(_Networks);

            return(Content(Json, TypeJson));
        }
Пример #3
0
        protected MemberSocialNetwork GetMemberSocialNetwork()
        {
            MemberSocialNetwork _memberNetwork = new MemberSocialNetwork();

            Connection _connection =
                new Connection
                (
                    System.Configuration.ConfigurationManager.AppSettings["ssoAPIUrl"],
                    System.Configuration.ConfigurationManager.AppSettings["ssoAPIMemberName"],
                    System.Configuration.ConfigurationManager.AppSettings["ssoAPIMemberToken"]
                );

            MemberSocialNetworks.Connection = _connection;
            return(MemberSocialNetworks.GetMemberSocialNetworksBySignInEmail(User.Identity.Name));
        }
Пример #4
0
        public ActionResult ResetAvatarImage(long MemberID = 0)
        {
            RequestResultModel _model = new RequestResultModel();

            try
            {
                if (MemberID > 0 && MemberID == Profile.Member.MemberID && Profile.Member.Avatar != null && Profile.Member.Avatar.Length > 0)
                {
                    string Path = String.Format("{0}/{1}.jpg", Server.MapPath("~/Avatar"), Profile.Member.Avatar);
                    if (System.IO.File.Exists(Path))
                    {
                        System.IO.File.Delete(Path);
                    }

                    Profile.Member.Avatar = null;
                    Profile.Member.UpdateAvatar();
                }
                else if ((MemberID > 0 && MemberID != Profile.Member.MemberID && AppSession.IsMemberInAdminRole))
                {
                    Member Member = Members.GetBy(MemberID);
                    string Path   = String.Format("{0}/{1}.jpg", Server.MapPath("~/Avatar"), Member.Avatar);
                    if (System.IO.File.Exists(Path))
                    {
                        System.IO.File.Delete(Path);
                    }

                    Member.Avatar = null;
                    Member.UpdateAvatar();
                }

                _model.Title    = GetLabel("Account.Controller.Congrat");
                _model.InfoType = RequestResultInfoType.Success;
                _model.Message  = "Avatar image has been reset.";
            }
            catch (Exception ex)
            {
                _model.Title    = GetLabel("Account.Controller.Warning");
                _model.InfoType = RequestResultInfoType.ErrorOrDanger;
                _model.Message  = "Avatar image has noot been reset: " + ex.Message;
            }

            String Message = this.RenderPartialView(@"_RequestResultPageInLine", _model);
            String FileURL = Url.Content("~/Content/images/no-photo.png");

            MemberSocialNetwork _memberNetwork = MemberSocialNetworks.GetByMemberID(MemberID);

            if (_memberNetwork.MemberSocialNetworkID > 0 && _memberNetwork.SocialNetworkID == 1)
            {
                FileURL = String.Format("https://graph.facebook.com/{0}/picture?type=large", _memberNetwork.SocialNetworkUserID);
            }
            else if (_memberNetwork.MemberSocialNetworkID > 0 && _memberNetwork.SocialNetworkID == 2)
            {
                FileURL = String.Format("http://api.twitter.com/1/users/profile_image?screen_name={0}&size=bigger", _memberNetwork.SocialNetworkUserID);
            }
            ;

            return(Json(new
            {
                NotifyType = NotifyType.PageInline,
                Html = Message,
                FileURL = FileURL
            }, JsonRequestBehavior.AllowGet));
        }
        static void Main(string[] args)
        {
            Connection Connection =
                new Connection
                (
                    "http://*****:*****@demo.com",
                    "HYXMvDsQWhGhbShE7yS1"
                );

            Tools.Connection                = Connection;
            Roles.Connection                = Connection;
            Members.Connection              = Connection;
            AuditEvents.Connection          = Connection;
            AuditEventDatails.Connection    = Connection;
            MemberSocialNetworks.Connection = Connection;

            // General
            Console.WriteLine(Tools.Ping().Data);

            // Roles
            List <Role> _Roles = Roles.GetRoles();

            _Roles = Roles.GetMemberRoles(102);
            _Roles = Roles.GetMemberRoles("*****@*****.**");

            // Members
            List <Member> _Members = Members.GetMembers(new CollectionFilter()
            {
                CurrentPage = 1, ItemsPerPage = 30
            });

            _Members = Members.GetMembers(new CollectionFilter()
            {
                CurrentPage = 2, ItemsPerPage = 30
            });

            Member _Member = Members.GetMember(130);

            _Member = Members.GetMember("*****@*****.**");

            // Audit items
            List <AuditEvent> _Events = AuditEvents.GetEvents(new CollectionFilter()
            {
                CurrentPage = 1, ItemsPerPage = 30
            });

            _Events = AuditEvents.GetEvents(new CollectionFilter()
            {
                CurrentPage = 2, ItemsPerPage = 30
            });

            // Audit Item Details
            foreach (AuditEvent Event in _Events)
            {
                List <AuditEventDetail> _EventDetails = AuditEventDatails.GetEventDatails(Event.EventID);
            }


            MemberSocialNetwork _socilaNetwork = MemberSocialNetworks.GetMemberSocialNetworks(31);

            Console.WriteLine(_socilaNetwork.AccessToken);
            Console.ReadLine();
        }