Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Models.Expert expDetails = new Models.Expert();
        // Get Product ID from querystring

        expDetails       = exp.getExpert(Session["Email"].ToString());
        lblExpEmail.Text = exp.ExpEmail;
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        expDetails       = exp.getExpert(Session["Email"].ToString());
        lblUsername.Text = expDetails.ExpUserName;

        if (lblUsername.Text != null)
        {
            //Retrieve username from session
            lblWelcome.Text = "Hi, " + lblUsername.Text + " !";
        }
        else
        {
            //do something else
        }
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Models.Expert aExp = new Models.Expert();
        // Get Product ID from querystring
        int expID = Convert.ToInt32(Session["ExpertId"]);

        //int expID = int.Parse(Request.QueryString["ExpertId"].ToString());
        exp = aExp.getExpert(expID);
        //Display product details on web form
        lblExpUsername.Text  = exp.ExpUserName;
        lblExpFirstName.Text = exp.ExpFName;
        lblExpLastName.Text  = exp.ExpLName;
        //   img_Product.ImageUrl = "~\\Images\\" + prod.Product_Image;
        //Store the value in invsible fields
        lblExpEmail.Text       = exp.ExpEmail;
        lblExpPhoneNumber.Text = exp.ExpHp;
        lblExpGender.Text      = exp.ExpGender.ToString();
        lblExpId.Text          = expID.ToString();
    }
Ejemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Models.Expert expDetails = new Models.Expert();

        expDetails          = exp.getExpert(Session["Email"].ToString());
        lblExpUserName.Text = expDetails.ExpUserName;
        lblExpFName.Text    = expDetails.ExpFName;
        lblExpLName.Text    = expDetails.ExpLName;
        lblExpEmail.Text    = (string)Session["Email"];
        lblExpAddr.Text     = expDetails.ExpAddress;
        lblExpPhone.Text    = expDetails.ExpHp;
        lblExpGender.Text   = expDetails.ExpGender;
        lblWelcome.Text     = expDetails.ExpUserName;

        String        strConn = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection con     = new SqlConnection(strConn);
        SqlCommand    cmd     = new SqlCommand("select Id from Expert where Email=@Email", con);

        //cmd.Parameters.AddWithValue("@Id", lblUserId.Text);
        cmd.Parameters.AddWithValue("@Email", lblExpEmail.Text);
        SqlDataAdapter sda = new SqlDataAdapter(cmd);

        con.Open();
        int i = cmd.ExecuteNonQuery();

        con.Close();

        //check whether session is null or not
        if (lblExpUserName.Text != null)
        {
            //Retrieve username from session
            lblWelcome.Text = "Welcome, " + lblExpUserName.Text;
        }
        else
        {
            //do something else
        }
    }