protected void btnCreateNew_Click(object sender, EventArgs e) { if (!IsSelected(ddlStation)) { return; } if (!IsNotEmpty(txtSINPO.Text, txtSINPO)) { return; } int stationId = Int32.Parse(ddlStation.SelectedValue); String sinpo = txtSINPO.Text.ToString(); DateTime date = cldDate.SelectedDate; String text = txtReport.Text.ToString(); if (sinpo.Length > 80) { return; } if (BLRadio.AddReport(stationId, sinpo, date, text)) { lblMessages.Text = "Raportin lisäys onnistui."; txtSINPO.Text = String.Empty; } }
/** * Täyttää komponentit oletusarvoilla. */ protected void FillControls() { ddlStation.DataSource = BLRadio.GetStationId(); ddlStation.DataTextField = "StationName"; ddlStation.DataValueField = "StationId"; ddlStation.DataBind(); }
protected void btnGetReportsByDate_Click(object sender, EventArgs e) { DateTime date_1 = cldDate_1.SelectedDate; DateTime date_2 = cldDate_2.SelectedDate; gvData.DataSource = BLRadio.GetReportsByDate(date_1, date_2); gvData.DataBind(); }
protected void btnGetStationsByCountry_Click(object sender, EventArgs e) { if (!IsSelected(ddlCountry)) { return; } gvData.DataSource = BLRadio.GetStationsByCountry(ddlCountry.SelectedValue.ToString()); gvData.DataBind(); }
protected void btnGetReportsFromStation_Click(object sender, EventArgs e) { if (!IsSelected(ddlStation)) { return; } int id = Int32.Parse(ddlStation.SelectedValue); gvData.DataSource = BLRadio.GetReportsByStation(id); gvData.DataBind(); }
protected void btnGetStationsByFrequency_Click(object sender, EventArgs e) { if (!IsDouble(txtFreq_1.Text, txtFreq_1)) { return; } if (!IsDouble(txtFreq_2.Text, txtFreq_2)) { return; } double frequency_1 = Double.Parse(txtFreq_1.Text); double frequency_2 = Double.Parse(txtFreq_2.Text); gvData.DataSource = BLRadio.GetStationsByFrequency(frequency_1, frequency_2); gvData.DataBind(); }
protected void btnCreateNew_Click(object sender, EventArgs e) { if (!IsNotEmpty(txtName.Text, txtName)) { return; } if (!IsDouble(txtFreq.Text, txtFreq)) { return; } if (!IsSelected(ddlCountry)) { return; } if (!IsSelected(ddlLocation)) { return; } String name = txtName.Text; double frequency = Double.Parse(txtFreq.Text); String country = ddlCountry.SelectedValue.ToString(); String location = ddlLocation.SelectedValue.ToString(); if (name.Length > 50) { return; } if (country.Length > 50) { return; } if (location.Length > 50) { return; } if (BLRadio.AddStation(name, frequency, country, location)) { lblMessages.Text = "Aseman lisäys onnistui."; txtName.Text = String.Empty; txtFreq.Text = String.Empty; } }
protected void btnGetAllStations_Click(object sender, EventArgs e) { gvData.DataSource = BLRadio.GetStations(); gvData.DataBind(); }
protected void btnGetAllReports_Click(object sender, EventArgs e) { gvData.DataSource = BLRadio.GetReports(); gvData.DataBind(); }