protected void edit_Click(object sender, EventArgs e)
    {
        string newpassword = newpass.Value;
        string email       = Session["Email"].ToString();
        Login1 loginclass  = new Login1();
        int    userid      = loginclass.GetuserID(email);

        loginclass.ChangePass(newpassword, userid);
        Response.Redirect("Cust_ViewProfile.aspx");
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Email"] == null)
        {
            Response.Redirect("Login.aspx");
        }
        else
        {
            string email = Session["Email"].ToString();
            Login1 user  = new Login1();
            userid = user.GetuserID(email);
            if (!Page.IsPostBack)
            {
                /*
                 * Get email logged in using session. Session converted to string to match with the email
                 * Access class Login1 to get function
                 * Pass email variable to the function to get the ID
                 *
                 */



                /*
                 * creating a variable named current user which contains the user id which will be passed to the function GetUser
                 * to get the user id which is logged in using the email
                 *
                 */

                User currentuser = user.GetUser(userid);
                fname.Value           = currentuser.fullName;
                cname.Value           = currentuser.companyName;
                email1.Value          = currentuser.email;
                country.SelectedValue = currentuser.country;
            }
        }
    }
Ejemplo n.º 3
0
    private Payment createPayment()
    {
        Payment  pay        = new Payment();
        string   email      = Session["Email"].ToString(); //get session email to get the user id
        Login1   login      = new Login1();
        int      userid     = login.GetuserID(email);
        int      productid  = Convert.ToInt32(Request.QueryString["prodid"]);
        int      planid     = Convert.ToInt32(Request.QueryString["planid"]);
        string   prodprice  = Request.QueryString["prodprice"];
        string   planprice  = Request.QueryString["planprice"];
        double   totalprice = Convert.ToDouble(prodprice) + Convert.ToDouble(planprice);
        DateTime now        = DateTime.Now;

        pay.datePayment  = now;
        pay.userId       = userid;
        pay.productId    = productid;
        pay.planId       = planid;
        pay.Price        = Convert.ToString(totalprice);
        pay.CardNumber   = cnumb.Value;
        pay.ExpiryDate   = month.Value + year.Value;
        pay.SecurityCode = code.Value;
        pay.NameCard     = namecard.Value;
        return(pay);
    }