protected void editButtonClicked(object sender, EventArgs e) { if (Page.IsValid) { DBSaver saver = new DBSaver(); saver.EditCompany(companiesList.SelectedValue, attributesList.SelectedValue, newValue.Text); editLabel.Text = "Attribute successfully edited"; } else { editLabel.Text = ""; } newValue.Text = ""; }
protected void scheduleButtonClicked(object sender, EventArgs e) { if (Page.IsValid) { DBSaver saver = new DBSaver(); saver.RegisterTravel(companiesList.SelectedValue, startCity.Text, DateTime.ParseExact(startTime.Text, "MM/dd/yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture), intermediaryStop.Text, endCity.Text, DateTime.ParseExact(endTime.Text, "MM/dd/yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture), Int32.Parse(ticketPrice.Text)); scheduleLabel.Text = "Travel successfully scheduled"; ClearFields(); } else { scheduleLabel.Text = ""; } }
protected void registerButtonClicked(object sender, EventArgs e) { if (Page.IsValid) { DBSaver saver = new DBSaver(); saver.RegisterCompany(name.Text, city.Text, address.Text, phone.Text, email.Text); registerLabel.Text = "Company successfully registered."; registerLabel.CssClass = "successLabel"; } else { registerLabel.Text = ""; } ClearFields(); }
protected void deleteButtonClicked(object sender, EventArgs e) { DBSaver saver = new DBSaver(); saver.DeleteCompany(companiesList.SelectedValue); Response.Redirect(Request.RawUrl); }