void getAvaiableSpots() { /* * HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create("http://localhost:8080/ParkingPalsServer/getStallNumber"); * serviceRequest.Method = "GET"; * serviceRequest.ContentLength = 0; * serviceRequest.ContentType = "text/html"; * serviceRequest.Accept = "text/html"; */ try { /* * HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); * String status = serviceResponse.StatusCode.ToString(); * //String avaiableSpot = serviceResponse.GetResponseHeader("####"); * labelGetAvaiableSpots.Text = "####";// avaiableSpot; */ parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); labelGetAvaiableSpots.Text = obj.GetEmptySpots(); } catch (Exception ex) { labelGetAvaiableSpots.Text = "Error: Could get Avaiable Spot count."; } }
protected void DeleteButton_Click(object sender, EventArgs e) { if (deleteBox.Checked) { /* * parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); * string username = userLabel.Text; * obj.DeleteAccount(obj.GetUserID(username)); * Response.Redirect("https://localhost:44373/ParkingPalsPage.aspx"); */ parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); string username = userLabel.Text; string id = obj.GetUserID(username); HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create("https://localhost:44382/delete/" + id); serviceRequest.Method = "DELETE"; serviceRequest.ContentType = "text/html"; HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); String status = serviceResponse.StatusCode.ToString(); Response.Redirect("https://localhost:44373/ParkingPalsPage.aspx"); } else { deleteMessage.Text = "If you really want to delete this account, please check the box above."; } }
void getParkedCost() { /* * HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create("http://localhost:8080/ParkingPalsServer/getTicketCost"); * serviceRequest.Method = "GET"; * serviceRequest.ContentLength = 0; * serviceRequest.ContentType = "text/html"; * serviceRequest.Accept = "text/html"; */ try { /* * HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); * String status = serviceResponse.StatusCode.ToString(); * String totalCost = serviceResponse.GetResponseHeader("ticketCost"); * labelGetParkedCost.Text = totalCost; */ parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); if (Request.QueryString["ticketid"] == null) { string username = Request.QueryString["username"]; labelGetParkedCost.Text = obj.GetCost(obj.GetUserID(username)); } else { string id = Request.QueryString["ticketid"]; labelGetParkedCost.Text = obj.GetCost(id); } } catch (Exception ex) { labelGetParkedCost.Text = "Error: Could not get total cost."; } }
void getTicketNumber() { parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); if (Request.QueryString["ticketid"] == null) { ticketNumberText.Text = "User Name: " + Request.QueryString["username"]; } else { ticketNumberText.Text = "Ticket ID: " + Request.QueryString["ticketid"]; } /* * HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create("http://localhost:8080/ParkingPalsServer/getTicketNumber"); * serviceRequest.Method = "GET"; * serviceRequest.ContentLength = 0; * serviceRequest.ContentType = "text/html"; * serviceRequest.Accept = "text/html"; * * try * { * HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); * String status = serviceResponse.StatusCode.ToString(); * String ticket = serviceResponse.GetResponseHeader("ticketNumber"); * ticketNumberText.Text = ticket; * } catch (Exception ex) * { * ticketNumberText.Text = "Error in DB Call."; * } */ }
protected void Page_Load(object sender, EventArgs e) { parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); userLabel.Text = obj.GetUsername(Request.QueryString["username"]); emailLabel.Text = obj.GetEmail(Request.QueryString["username"]); phoneLabel.Text = obj.GetPhonenumber(Request.QueryString["username"]); statusLabel.Text = obj.GetAccountType(Request.QueryString["username"]); }
protected void Page_Load(object sender, EventArgs e) { for (int i = 0; i < AccountList.Items.Count; i++) { parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); AccountList.Items[i].Attributes.Add("onclick", "MutExChkList(this)"); } }
protected void Button1_Click1(object sender, EventArgs e) { /* * // getTicketNumber * // http://localhost:8080/ParkingPalsServer/ * //ticketNumber.Text = "http://localhost:8080/ParkingPalsServer/ticketNumber/" + TextBox1.Text; * * HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create("http://localhost:8080/ParkingPalsServer/ticketNumber/" + TextBox1.Text); * serviceRequest.Method = "GET"; * serviceRequest.ContentLength = 0; * serviceRequest.ContentType = "text/html"; * serviceRequest.Accept = "text/html"; * try * { * HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); * //ticketNumber.Text = "A valid ticket number has been added."; * //Response.Redirect("http://localhost:8080/ParkingPalServer/ticketNumber/");// * String temp = serviceResponse.StatusCode.ToString(); * String location = serviceResponse.GetResponseHeader("Locaiton"); * } * catch (Exception ex) * { * //ticketNumber.Text = "An invalid ticket number has been added. Please try again."; * Response.Redirect("https://localhost:44373/ErrorPage.aspx"); * * } */ // check ticket parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); string ticketid = TextBox1.Text; bool check = obj.checkTicket(ticketid); if (check) { bool userCheck = obj.checkUser(ticketid); if (userCheck) { ticketNumber.Text = "This is a user ticket ID, please Log in"; } else { Response.Redirect("https://localhost:44373/HomePage.aspx?ticketid=" + ticketid); } } else { ticketNumber.Text = "An invalid ticket number has been added. Please try again."; } }
void getReservedStallNumber() { /* * HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create("http://localhost:8080/ParkingPalsServer/reservation/getReservation"); * serviceRequest.Method = "GET"; * serviceRequest.ContentLength = 0; * serviceRequest.ContentType = "text/html"; * serviceRequest.Accept = "text/html"; */ try { /* * HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); * String status = serviceResponse.StatusCode.ToString(); * String reservationID = serviceResponse.GetResponseHeader("reservationID"); * String reservedSpot = serviceResponse.GetResponseHeader("reservationSpot"); * String userID = serviceResponse.GetResponseHeader("userID"); * String reservedTime = serviceResponse.GetResponseHeader("reservedTime"); * labelReservationID.Text = "Reservation ID: " + reservationID; * labelReservationSpot.Text = "Reservation Spot: " + reservedSpot; * labelReservationTime.Text = "Reservation Time: " + reservedTime; */ parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); if (Request.QueryString["ticketid"] == null) { string username = Request.QueryString["username"]; string userid = obj.GetUserID(username); labelReservationID.Text = "Reservation ID: " + userid; labelReservationSpot.Text = "Reservation Spot: " + obj.GetReservationNumber(userid); labelReservationTime.Text = "Reservation Time: " + obj.GetReservationTime(userid); } else { labelReservationSpot.Text = "Temporary Ticket can not reserve spots."; } } catch (Exception ex) { labelReservationID.Text = "Error: Could not get reservation."; } }
protected void updateButton_Click(object sender, EventArgs e) { /* * * string user = obj1.GetUsername(Request.QueryString["username"]); * string email = newEmailLabel.Text; * string pass = newPasswordLabel.Text; * string phone = newPhoneLabel.Text; * if (!string.Equals(email, "")){ * Uri link = new Uri("https://localhost:44348/update/" + user + "/1/" + email); * HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create(link) ; * serviceRequest.Method = "PUT"; * serviceRequest.ContentType = "text/html"; * serviceRequest.ContentLength = 0; * HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); * } * if (!string.Equals(pass, "")){ * HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create("https://localhost:44348/update/" + user + "/2/" + pass); * serviceRequest.Method = "PUT"; * serviceRequest.ContentType = "text/html"; * serviceRequest.ContentLength = 0; * HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); * } * * if (!string.Equals(phone, "")){ * HttpWebRequest serviceRequest = (HttpWebRequest)WebRequest.Create("https://localhost:44348/update/" + user + "/3/" + phone); * serviceRequest.Method = "PUT"; * serviceRequest.ContentType = "text/html"; * serviceRequest.ContentLength = 0; * HttpWebResponse serviceResponse = (HttpWebResponse)serviceRequest.GetResponse(); * } */ parkingDB.ParkingDBWSSoapClient obj1 = new parkingDB.ParkingDBWSSoapClient(); obj1.PutUser(obj1.GetUsername(Request.QueryString["username"]), newEmailLabel.Text, newPasswordLabel.Text, newPhoneLabel.Text); Response.Redirect("https://localhost:44373/ParkingPalsPage.aspx"); }
protected void Page_Load(object sender, EventArgs e) { parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); userLabel.Text = obj.GetUsername(Request.QueryString["username"]) + ", Update User Information:"; }
protected void signupButton_Click(object sender, EventArgs e) { parkingDB.ParkingDBWSSoapClient obj = new parkingDB.ParkingDBWSSoapClient(); obj.PostUser(UserLabel.Text, FirstnameLabel.Text, LastnameLabel.Text, EmailLabel.Text, PhoneLabel.Text, PasswordLabel.Text, AccountList.SelectedValue); Response.Redirect("https://localhost:44373/PopLogin.aspx"); }