Example #1
0
        /**
         * public virtual bool CreateCampaign(string n, string nl,string email, string description)
         * {
         *  try
         *  {
         *      campCampaign hc = new campCampaign(n,nl ,email,this,DateTime.Now, nwdbConst.minSQLDate,description);
         *      this.GMCampaigns.Add(hc);
         *      return true;
         *  }
         *  catch (Exception e)
         *  {
         *      string t = e.Message;
         *      return false;
         *  }
         *
         *
         * }
         **/



        public virtual void linkFaceBook(hostFacebook fbRecord)
        {
            this.fbID           = fbRecord.ID;
            this.fbGender       = fbRecord.Gender;
            this.fbAccessToken  = fbRecord.AccessToken;
            this.fbFirstName    = fbRecord.FirstName;
            this.fbSurname      = fbRecord.Surname;
            this.fbTokenExpires = fbRecord.Expires;
            if (this.Email == null || this.Email == "")
            {
                this.Email = fbRecord.Email;
            }
        }
        //STATIC Methods
        public static hostFacebook ParseResponse(IDictionary <string, object> response, FacebookOAuthResult authResult)
        {
            if (!authResult.IsSuccess)
            {
                return(null);
            }
            hostFacebook result = new hostFacebook();

            result.Verified    = (bool)response["verified"];
            result.AccessToken = authResult.AccessToken;
            result.FirstName   = (string)response["first_name"];
            result.Surname     = (string)response["last_name"];
            result.Gender      = (string)response["gender"];
            result.Email       = (string)response["email"];
            result.ID          = (string)response["id"];
            result.Expires     = authResult.Expires;
            return(result);
        }
 public static hostUser UserExists(ISession sess, hostFacebook fbRecord)
 {
     return(sess.QueryOver <hostUser>().Where(x => x.fbID == fbRecord.ID).SingleOrDefault());
 }
Example #4
0
 public hostUser(string n, string nl, hostFacebook fbRecord)
     : this(n, nl)
 {
     this.linkFaceBook(fbRecord);
 }