protected void Page_Load(object sender, EventArgs e) { try { if (Request.Cookies["userId"] == null) { Response.Redirect("My_Account.aspx", false); } else { btnUpdate.Attributes.Add("onclick", "clcontent();"); BindSideLink(); getCompanyName(); if (!IsPostBack) { dropState.bindStateDropdown(drpState);//Bind state into dropdown int userId = 0; userId = Convert.ToInt32(Request.Cookies["userId"].Value); DataSet dsUserDetailsInfo = new DataSet(); dsUserDetailsInfo = dbInfo.GetUserDetailsInfo(userId); if (dsUserDetailsInfo.Tables.Count > 0) { if (dsUserDetailsInfo != null && dsUserDetailsInfo.Tables.Count > 0 && dsUserDetailsInfo.Tables[0].Rows.Count > 0) { txtAddress1.Text = Convert.ToString(dsUserDetailsInfo.Tables[0].Rows[0]["users_baddress1"]); txtAddress2.Text = Convert.ToString(dsUserDetailsInfo.Tables[0].Rows[0]["users_baddress2"]); txtCity.Text = Convert.ToString(dsUserDetailsInfo.Tables[0].Rows[0]["users_bcity"]); if (Convert.ToString(dsUserDetailsInfo.Tables[0].Rows[0]["users_bstate"]) != "") { drpState.SelectedValue = Convert.ToString(dsUserDetailsInfo.Tables[0].Rows[0]["users_bstate"]); } txtZipCode.Text = Convert.ToString(dsUserDetailsInfo.Tables[0].Rows[0]["users_bzip"]); } } dbInfo.dispose(); } } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { try { BindSideLink(); getCompanyName(); if (!IsPostBack) { int intUserId = 0; int intParentId = 0; string strUserFNM = string.Empty; string strUserLNM = string.Empty; string strUserEmail = string.Empty; string strParentEmail = string.Empty; dropState.bindStateDropdown(drpState); GetPaymentOptionInformation(); lblMinAmt.Text = Convert.ToString(ViewState["MinimumDeposit"]); intUserId = Convert.ToInt32(Request.QueryString["userId"]); DataSet dsUserInfo = new DataSet(); dsUserInfo = dbInfo.GetUserDetailsInfo(intUserId); if (dsUserInfo.Tables.Count > 0) { if (dsUserInfo != null && dsUserInfo.Tables.Count > 0 && dsUserInfo.Tables[0].Rows.Count > 0) { strUserFNM = Convert.ToString(dsUserInfo.Tables[0].Rows[0]["users_fname"]); ViewState["strUserNM"] = strUserFNM; strUserLNM = Convert.ToString(dsUserInfo.Tables[0].Rows[0]["users_lname"]); ViewState["strUserLastNM"] = strUserLNM; strUserEmail = Convert.ToString(dsUserInfo.Tables[0].Rows[0]["users_email"]); ViewState["strUserEmail"] = strUserEmail; ViewState["UserAccountValue"] = Convert.ToString(dsUserInfo.Tables[0].Rows[0]["users_accountvalue"]); } } intParentId = Convert.ToInt32(Request.QueryString["parentId"]); DataSet dsParentInfo = new DataSet(); dsParentInfo = dbInfo.GetParentDetailsInfo(intParentId); if (dsParentInfo.Tables.Count > 0) { if (dsParentInfo != null && dsParentInfo.Tables.Count > 0 && dsParentInfo.Tables[0].Rows.Count > 0) { strParentEmail = Convert.ToString(dsParentInfo.Tables[0].Rows[0]["parent_email"]); ViewState["strParentEmail"] = strParentEmail; } } if (Convert.ToString(ViewState["PaymentOption"]) == "1") { pnlAuthorize.Visible = true; pnlAuto.Visible = true; pnlPayPal.Visible = false; } else if (Convert.ToString(ViewState["PaymentOption"]) == "2") { pnlAuthorize.Visible = false; pnlAuto.Visible = false; pnlPayPal.Visible = false; } dbInfo.dispose(); } } catch (Exception ex) { Response.Write(ex.Message); } }