示例#1
0
 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 = "";
 }
示例#2
0
 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 = "";
     }
 }
示例#3
0
 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();
 }
示例#4
0
 protected void deleteButtonClicked(object sender, EventArgs e)
 {
     DBSaver saver = new DBSaver();
     saver.DeleteCompany(companiesList.SelectedValue);
     Response.Redirect(Request.RawUrl);
 }