Esempio n. 1
0
        private EZDiscuss.Classes.Member FillMemberInfo(DataTable dt)
        {
            EZDiscuss.Classes.Member member = new EZDiscuss.Classes.Member();

            try
            {
                member.memberId   = (long)dt.Rows[0]["MemberId"];
                member.email      = dt.Rows[0]["Email"].ToString();
                member.password   = dt.Rows[0]["Password"].ToString();
                member.firstName  = dt.Rows[0]["Firstname"].ToString();
                member.lastName   = dt.Rows[0]["Lastname"].ToString();
                member.dateJoined = (DateTime)dt.Rows[0]["DateJoined"];
                if (dt.Rows[0]["DateUpdated"] != null)
                {
                    member.dateUpdated = (DateTime)dt.Rows[0]["DateUpdated"];
                }

                member.IsDeleted  = (int)dt.Rows[0]["IsDeleted"];
                member.IsLogin    = (bool)dt.Rows[0]["IsLogin"];
                member.DateLogin  = (DateTime)dt.Rows[0]["DateLogin"];
                member.IsLogout   = (bool)dt.Rows[0]["IsLogout"];
                member.DateLogout = (DateTime)dt.Rows[0]["DateLogout"];
                member.photo      = dt.Rows[0]["Photo"].ToString();
            }
            catch (Exception ex)
            {
                EZDiscuss.Classes.Helper.LogError("Member.cs", "FillMemberInfo", ex.Message, memberId);
            }

            return(member);
        }
Esempio n. 2
0
        //protected void btnLogout_Click(object sender, EventArgs e)
        //{
        //    member = (EZDiscuss.Classes.Member)Session["member"];
        //    if (member != null)
        //    {
        //         EZDiscuss.Classes.Member memLogout = member.MemberLogout(member.email, member.password);
        //        if (memLogout.IsLogout == true)
        //        {
        //            Session.Remove("member");
        //            Response.Redirect("~/Home.aspx", true);
        //        }
        //    }
        //    Session.Remove("member");
        //}

        //protected void btnProfile_Click(object sender, EventArgs e)
        //{
        //    RedirectToPage("MemberProfile.aspx");
        //}

        //protected void btnGroup_Click(object sender, EventArgs e)
        //{
        //    RedirectToPage("MemberHome.aspx");
        //}

        private void RedirectToPage(string url)
        {
            try
            {
                if (url == "")
                {
                    return;
                }

                member = (EZDiscuss.Classes.Member)Session["member"];
                if (member != null)
                {
                    if (member.memberId > 0)
                    {
                        memberId       = Convert.ToInt64(member.memberId);
                        paddedMemberId = EZDiscuss.Classes.Helper.PadMemberId(memberId);
                        Response.Redirect(url + "?memberId=" + paddedMemberId.ToString());
                    }
                }
                else
                {
                    Response.Redirect(url + "?memberId=");
                }
            }
            catch (Exception ex)
            {
                EZDiscuss.Classes.Helper.LogError("SiteMember.Master", "RedirectToPage", ex.Message, memberId);
            }
        }
Esempio n. 3
0
 protected void lnkLogout_Click(object sender, EventArgs e)
 {
     member = (EZDiscuss.Classes.Member)Session["member"];
     if (member != null)
     {
         EZDiscuss.Classes.Member memLogout = member.MemberLogout(member.email, member.password);
         if (memLogout.IsLogout == true)
         {
             Session.Remove("member");
             Response.Redirect("~/Home.aspx", true);
         }
     }
     Session.Remove("member");
 }
Esempio n. 4
0
        //long memberId = 0;

        protected void Page_Load(object sender, EventArgs e)
        {
            Session["CurrentPage"] = "MemberHome.aspx";

            if (Session["member"] != null)
            {
                EZDiscuss.Classes.Member member = (EZDiscuss.Classes.Member)Session["member"];

                lWelcome.Text = "Congratulations and Welcome " + member.firstName.ToString() + "! You can now create Group(s) and invite people to join you in the discussion.";
            }
            else
            {
                // Redirect to the Login page
                Response.Redirect("~/Home.aspx", true);
            }
        }