protected void Page_Load(object sender, EventArgs e) { RequestViewContactInfo requestViewContactInfo = new RequestViewContactInfo(); requestViewContactInfo.Username = Session["Username"].ToString(); DataTable dt = DAT.ViewContactInfo(requestViewContactInfo); if (dt.Rows.Count > 0) { LabelHomeNum.Text = dt.Rows[0]["HomeNum"].ToString(); LabelCellphoneNum.Text = dt.Rows[0]["CellphoneNum"].ToString(); LabelHomeAddress.Text = dt.Rows[0]["HomeAddress"].ToString(); LabelEmail.Text = dt.Rows[0]["Email"].ToString(); } else { Response.Redirect("GM_UpdateContactInfo.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { RequestViewContactInfo request = new RequestViewContactInfo(); request.Username = Session["Username"].ToString(); DataTable dt = DAT.ViewContactInfo(request); if (dt.Rows.Count > 0) { LabelHomeNum.Text = dt.Rows[0]["HomeNum"].ToString(); LabelCellphoneNum.Text = dt.Rows[0]["CellphoneNum"].ToString(); LabelHomeAddress.Text = dt.Rows[0]["HomeAddress"].ToString(); LabelEmail.Text = dt.Rows[0]["Email"].ToString(); } else { Response.Write("<script>alert('No Records Found! Please supply records.');</script>"); Response.Redirect("Employee_UpdateContactInfo.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { RequestViewContactInfo request = new RequestViewContactInfo(Session["Username"].ToString()); DataTable dt = DAT.ViewContactInfo(request); if (!IsPostBack) { if (dt.Rows.Count == 0) { Response.Redirect("GM_ViewContactInfo.aspx"); } else { txtHomeNum.Text = dt.Rows[0]["HomeNum"].ToString(); txtCellphoneNum.Text = dt.Rows[0]["CellphoneNum"].ToString(); txtHomeAddress.Text = dt.Rows[0]["HomeAddress"].ToString(); txtEmail.Text = dt.Rows[0]["Email"].ToString(); } } }