コード例 #1
0
    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;
        }
    }
コード例 #2
0
 /**
  * Täyttää komponentit oletusarvoilla.
  */
 protected void FillControls()
 {
     ddlStation.DataSource     = BLRadio.GetStationId();
     ddlStation.DataTextField  = "StationName";
     ddlStation.DataValueField = "StationId";
     ddlStation.DataBind();
 }
コード例 #3
0
    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();
    }
コード例 #4
0
    protected void btnGetStationsByCountry_Click(object sender, EventArgs e)
    {
        if (!IsSelected(ddlCountry))
        {
            return;
        }

        gvData.DataSource = BLRadio.GetStationsByCountry(ddlCountry.SelectedValue.ToString());
        gvData.DataBind();
    }
コード例 #5
0
    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();
    }
コード例 #6
0
    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();
    }
コード例 #7
0
    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;
        }
    }
コード例 #8
0
 protected void btnGetAllStations_Click(object sender, EventArgs e)
 {
     gvData.DataSource = BLRadio.GetStations();
     gvData.DataBind();
 }
コード例 #9
0
 protected void btnGetAllReports_Click(object sender, EventArgs e)
 {
     gvData.DataSource = BLRadio.GetReports();
     gvData.DataBind();
 }