protected void sign_in_btn_ServerClick(object sender, EventArgs e)
    {
        try
        {
            user_infoBO      user_creadentails = new user_infoBO();
            UserFunctionsBAL usersignin        = new UserFunctionsBAL();
            user_creadentails.email_id = txtEmail.Value.ToString();
            user_creadentails.password = txtPassword.Value.ToString();

            if (usersignin.UserSigIn(user_creadentails))
            {
                Session["user_id"] = Convert.ToInt32(usersignin.UserIdFetch(user_creadentails.email_id));

                Response.Redirect("~/UserProfileHome.aspx");
            }
            else
            {
                lblErrorMessage.Text = "Username Or Password Incorrect...!";
            }
        }
        catch (Exception ex)
        {
            ErrorReportBAL error = new ErrorReportBAL();
            error.SendErrorReport("SignIn.aspx", ex.ToString());
            Response.Write("<script type='text/javascript'> $(function(){alert('Some Error Occured \n Please try again later')}); </script>");
        }
    }
Exemple #2
0
    protected void sign_in_btn_ServerClick(object sender, EventArgs e)
    {
        try
        {

            user_infoBO user_creadentails = new user_infoBO();
            UserFunctionsBAL usersignin = new UserFunctionsBAL();
            user_creadentails.email_id = txtEmail.Value.ToString();
            user_creadentails.password = txtPassword.Value.ToString();

            if (usersignin.UserSigIn(user_creadentails))
            {
                Session["user_id"] = Convert.ToInt32(usersignin.UserIdFetch(user_creadentails.email_id));
                Response.Redirect("~/UserProfile.aspx");
            }
            else
            {
                lblErrorMessage.Text = "Username Or Password Incorrect...!";
            }

        }
        catch (Exception ex)
        {
            Response.Write("<script type='text/javascript'> $(function(){alert('Some Error Occured \n Please try again later')}); </script>");
        }
    }
    //protected void EnableTb_Click(object sender, EventArgs e)
    //{
    //    tbUserPassword.ReadOnly = false;
    //    tbNewPassword.ReadOnly = false;

    //}
    protected void UpdateData_Click(object sender, EventArgs e)
    {
        try
        {
            user_infoBO      ubo  = new user_infoBO();
            UserFunctionsBAL ubal = new UserFunctionsBAL();

            string filename = "";
            ubo.user_id    = Convert.ToInt32(Session["user_id"]);
            ubo.first_name = tbUserFirstName.Value;
            ubo.last_name  = tbUserLastName.Value;
            ubo.city       = tbUserCity.Value;
            ubo.country    = tbUserCountry.Value;

            if (tbUserPassword.Value.Trim() != "" && tbNewPassword.Value.Trim() != "")
            {
                ubo.password = tbUserPassword.Value;
                if (ubal.PasswordMatch(ubo))
                {
                    ubo.password    = tbNewPassword.Value;
                    filename        = ImgUpload();
                    ubo.profile_pic = "/Images/userprofilepic/" + filename;
                    ubal.ProfileUpdate(ubo);
                    StatusLabel.Text = "Profile Successfuly updated";
                }
                else
                {
                    StatusLabel.Text = "old password not match";
                }
            }
            else
            {
                if (ImgUpload() == null)
                {
                    StatusLabel.Text = "image is not valid";
                }
                else
                {
                    filename        = ImgUpload();
                    ubo.profile_pic = "/Images/userprofilepic/" + filename;

                    ubo.password = ubal.getPassword(ubo);
                    ubal.ProfileUpdate(ubo);
                    StatusLabel.Text = "Profile Successfuly updated";
                }
            }


            Response.Redirect("~/UserProfileEdit.aspx");
        }

        catch (Exception ex)
        {
            ErrorReportBAL error = new ErrorReportBAL();
            error.SendErrorReport("UserProfileEdit.aspx", ex.ToString());
            Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>");
        }
    }
    protected void bntJoinMe_Click(object sender, EventArgs e)
    {
        try
        {
            UserFunctionsBAL registeruser = new UserFunctionsBAL();

            user_infoBO user_info = new user_infoBO();

            String email_id = user_info.email_id = txtEmail.Value.ToString();
            user_info.first_name = txtFname.Value.ToString();
            user_info.last_name  = txtLname.Value.ToString();
            user_info.country    = ListCountry.SelectedValue.ToString();
            user_info.city       = StateLoad.SelectedValue.ToString();
            user_info.password   = txtPassword.Value.ToString();
            if (rdoBlogger.Checked == true)
            {
                user_info.user_type = 1;
            }
            else
            {
                user_info.user_type = 0;
            }

            int check = registeruser.NewUserRegister(user_info);

            if (check == 1)
            {
                Response.Write("<script type='text/javascript'> alert('Email ID Already Registered ... !') </script>");
            }
            else if (check == 2)
            {
                //Response.Write("<script>alert('Thanks For Joining Us ... !'); </script>");
                registeruser.JoinUsMail(email_id);

                String okmessage = "<script type='text/javascript'>  alert('Thank You For Joining Us'); </script>";

                Page.ClientScript.RegisterStartupScript(this.GetType(), "okmessage", okmessage);

                //Response.Redirect("~/sign_in.aspx");
            }

            txtEmail.Value       = "";
            txtFname.Value       = "";
            txtLname.Value       = "";
            rdoBlogger.Checked   = false;
            rdoVolunteer.Checked = false;
        }
        catch (Exception ex)
        {
            ErrorReportBAL error = new ErrorReportBAL();
            error.SendErrorReport("JoinUs.aspx", ex.ToString());
            Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["user_id"] != null)
        {
            UserFunctionsBAL getusername = new UserFunctionsBAL();

            a_signin.InnerText = getusername.UserNameFetch(Convert.ToInt32(Session["user_id"]));
            a_signin.HRef = "UserProfile.aspx";
            a_joinus.InnerText = "Sign Out";
            a_joinus.HRef = "UserLogout.aspx";

        }
    }
Exemple #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["user_id"] != null)
        {
            UserFunctionsBAL getusername = new UserFunctionsBAL();

            a_signin.InnerText = getusername.UserNameFetch(Convert.ToInt32(Session["user_id"]));
            a_signin.HRef      = "UserProfileHome.aspx";
            a_joinus.InnerText = "Sign Out";
            a_joinus.HRef      = "UserLogout.aspx";

            // a_verticalmenu_home.HRef = "UserProfileHome.aspx";
        }
    }
Exemple #7
0
    protected void bntJoinMe_Click(object sender, EventArgs e)
    {
        try
        {

            UserFunctionsBAL registeruser = new UserFunctionsBAL();

            user_infoBO user_info = new user_infoBO();

            String email_id = user_info.email_id = txtEmail.Value.ToString();
            user_info.first_name = txtFname.Value.ToString();
            user_info.last_name = txtLname.Value.ToString();
            user_info.country = sltCountry.Value.ToString();
            user_info.city = sltCity.Value.ToString();
            user_info.password = txtPassword.Value.ToString();
            if (rdoBlogger.Checked == true)
            {
                user_info.user_type = true;
            }
            else
            {
                user_info.user_type = false;
            }

            int check = registeruser.NewUserRegister(user_info);

            if ( check == 1)
            {
                Response.Write("<script type='text/javascript'> alert('Email ID Already Registered ... !') </script>");
            }
            else if (check == 2)
            {
                //Response.Write("<script>alert('Thanks For Joining Us ... !'); </script>");
                registeruser.JoinUsMail(email_id);

                Response.Redirect("~/HopeInTomorrow/sign_in.aspx");
            }

            txtEmail.Value = "";
            txtFname.Value = "";
            txtLname.Value = "";
            rdoBlogger.Checked = false;
            rdoVolunteer.Checked = false;
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }
Exemple #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string  socialType  = Request["socialType"];
        string  txtEmail    = Request["email"];
        string  name        = Request["name"];
        Boolean social      = Request["social"].ToString() == "yes" ? true : false;
        string  profile_pic = Request["image"];

        Response.Write(socialType + txtEmail + name + social + profile_pic);



        try
        {
            user_infoBO      social_login_info = new user_infoBO();
            UserFunctionsBAL usersignup        = new UserFunctionsBAL();
            social_login_info.email_id    = txtEmail;
            social_login_info.first_name  = name;
            social_login_info.social_type = socialType;
            social_login_info.social      = social;
            social_login_info.profile_pic = profile_pic;

            if (usersignup.UserSignUp(social_login_info))
            {
                Session["user_id"]           = Convert.ToInt32(usersignup.UserIdFetch(social_login_info.email_id));
                Session["user_login_social"] = "yes";
                Session["user_login_type"]   = socialType;
                Session["user_pp"]           = profile_pic;
                //Response.Write(Session["user_pp"].ToString());
                Response.Redirect("~/UserProfileHome.aspx");
            }
            //else
            //{
            //    lblErrorMessage.Text = "Username Or Password Incorrect...!";
            //}
        }
        catch (Exception ex)
        {
            ErrorReportBAL error = new ErrorReportBAL();
            error.SendErrorReport("SocialLogin.aspx", ex.ToString());
            Response.Write("<script type='text/javascript'> alert('Some Error Occured \n Please try again later'); </script>");
        }
    }
    protected void load_default_user_value()
    {
        try
        {
            user_infoBO      ubo  = new user_infoBO();
            UserFunctionsBAL ubal = new UserFunctionsBAL();
            ubo.user_id = Convert.ToInt32(Session["user_id"]);
            DataTable dt = new DataTable();
            dt = ubal.getAllUserInfo_bal(ubo);
            DataView dv = dt.DefaultView;
            tbUserFirstName.Value = Convert.ToString(dv[0]["first_name"]);
            tbUserLastName.Value  = Convert.ToString(dv[0]["last_name"]);
            tbUserCity.Value      = Convert.ToString(dv[0]["city"]);
            tbUserCountry.Value   = Convert.ToString(dv[0]["country"]);
        }

        catch (Exception ex)
        {
            ErrorReportBAL error = new ErrorReportBAL();
            error.SendErrorReport("UserProfileEdit.aspx", ex.ToString());
            Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>");
        }
    }