protected void Page_Load(object sender, EventArgs e) { siteUser theUser = Session["offerUser"] as siteUser; offer theOffer = Session["myOffer"] as offer; nmeBTN.Text = theUser.outputName(); infoTXT.Text = theOffer.ToString() + "\n\n" + theUser.outputInfo(); roomTXT.Text = theOffer.offerRoom.ToString(); }
protected void nmeBTN_Click(object sender, EventArgs e) { siteUser theUser = Session["offerUser"] as siteUser; if (theUser is customer) { Session["Customer"] = theUser; Response.Redirect("~//custPGE.aspx"); } else { Session["Hotel"] = theUser; Response.Redirect("~//HotPGE.aspx"); } }
public static bool add(siteUser thisUser) //Add user { lock (lockOb) { if (instance != null) { foreach (siteUser theUser in instance.userLST) { if (theUser.returnId == thisUser.returnId) { return(false); } } } else { instance = new userManager(); } instance.userLST.Add(thisUser); return(true); } }
protected void Page_Load(object sender, EventArgs e) { thisRm = Session["Room"] as room; System.Drawing.Image mainImage = thisRm.getMainPic; roomNMELBL.Text = thisRm.ToString(); url = "~/TempImages/" + Path.GetRandomFileName(); url = Path.ChangeExtension(url, ".jpg"); mainImage.Save(Server.MapPath(url)); rmPC.ImageUrl = url; descTXT.Text = thisRm.description; priceLBL.Text = "$" + string.Format("{0:0.00}", thisRm.getAskedPrice.ToString()); if (Session["User"] is customer) { LinkButton newBtn = new LinkButton(); newBtn.Text = "(" + thisRm.roomHotel.getName + ")"; newBtn.Click += (a, t) => { Session["Hotel"] = thisRm.roomHotel; Response.Redirect("~//HotPGE.aspx"); }; hotelLBL.Text = string.Empty; hotelLBL.Controls.Add(newBtn); theUser = Session["User"] as customer; setupCustomer(); } else if (Session["User"] is hotel) { hotelLBL.Text = "(" + thisRm.roomHotel.getName + ")"; theUser = Session["User"] as hotel; setupHotel((theUser as hotel).returnId == thisRm.roomHotel.returnId); } else { subtractOffers(); } }