public ActionResult AddPTSession(PTSession pt) { string t = Request.Form["TrainerList"].ToString(); string g = Request.Form["LocationList"].ToString(); string type = Request.Form["TypeList"].ToString(); string hour = Request.Form["HourList"].ToString(); int c = int.Parse(hour) * 20; int count = 0; pt.TrainerID = dao.getTrainerIDFromDropDown(t); pt.MemberID = dao.getMemberIDFromSession(Session["email"].ToString()); pt.SessLocation = g; pt.SessionLength = hour + " hour(s)"; pt.SessType = type; pt.Cost = c; if (ModelState.IsValid) { count = dao.Insert(pt); //Response.Write(dao.message); if (count == 1) { ViewBag.Status = "PT Session has been successfully booked."; } else { ViewBag.Status = "Error! " + dao.message; } return(View("StatusPT")); } return(View(pt)); }
public void UpdateContent(PTSession session) { textName.text = session.senderName + "'s\n" + session.gameName; textReady.text = ""; background.enabled = Random.Range(0, 2) == 0 ? false : true; background.color = new Color(Random.Range(0, 1.0f), Random.Range(0, 1.0f), Random.Range(0, 1.0f), 0.8f); button.onClick.AddListener(() => { PTManager.Connect(session.senderName, session.gameName); }); }