Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Id"] != null)
            {
                LinkButton2.Text = "SignOut";

                //get member name to display on Welcome
                Guest guest = new Guest();
                GuestController guestController = new GuestController();
                guest = guestController.getByMemberId(Session["Id"].ToString());
                string name = guest.Salutation + guest.FirstName + guest.FamilyName;
                lblWelcome.Text = "Welcome, " + name;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Id"] == null)
            {
                Response.Redirect("SignIn.aspx");
            }

            else
            {
                string id = Session["Id"].ToString();
                lblMemberId.Text = id;

                Guest guest = new Guest();
                GuestController guestController = new GuestController();
                guest = guestController.getByMemberId(id);
                string points = Convert.ToString(guest.Points);
                if (points == null)
                {
                    points = "0";
                }
                lblPoints.Text = points;

                string name = guest.Salutation + guest.FirstName + guest.FamilyName;
                lblName.Text = name;

                //to populate the gridview
                ThreeHotelEntities ctx = new ThreeHotelEntities();
                List<PastTransaction> tl = ctx.PastTransactions.Where(x => x.Member_No == id).ToList();
                if (tl != null)
                {
                    GridView1.DataSource = tl;
                    GridView1.DataBind();
                }
                else
                {
                    lblPastTransaction.Text = "No reservations with the hotel has been made.";
                }

            }
        }
        private void loadMemberInfo()
        {
            guestController = new GuestController();
            guest = guestController.getByMemberId(Session["Id"].ToString());

            ddlSalutation.Items[0].Text = guest.Salutation;
            txtFamilyName.Text = guest.FamilyName;
            txtFirstName.Text = guest.FirstName;
            txtEmail.Text = guest.Email;
            txtAddress.Text = guest.Address;
            txtPhoneNo.Text = guest.PhoneNo;
            ddlCountry.Items[0].Text = guest.Country;

            ddlSalutation.Enabled = false;
            txtFamilyName.Enabled = false;
            txtFirstName.Enabled = false;
            txtEmail.Enabled = false;
            txtAddress.Enabled = false;
            txtPhoneNo.Enabled = false;
            ddlCountry.Enabled = false;
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["Id"] == null)
                {
                    Response.Redirect("SignIn.aspx");
                }
                else
                {
                    Guest guest = new Guest();
                    guestController = new GuestController();
                    guest = guestController.getByMemberId(Session["Id"].ToString());

                    lblMemberID.Text = guest.GuestId.ToString().Trim();
                    ddlSalutation.Items[0].Text = guest.Salutation;
                    ddlSalutation.SelectedValue = guest.Salutation.ToString().Trim();
                    txtFamilyName.Text = guest.FamilyName.ToString().Trim();
                    txtFirstName.Text = guest.FirstName.ToString().Trim();
                    txtEmail.Text = guest.Email.ToString().Trim();
                    txtAddress.Text = guest.Address.ToString().Trim();
                    txtPhoneNo.Text = guest.PhoneNo.ToString().Trim();

                    ddlCountry.SelectedValue = guest.Country.ToString().Trim();

                }
            }
        }