Exemple #1
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            Polazak polazak = new Polazak();
            Label   lblID   = (Label)GvRedVoznje.Rows[e.RowIndex].FindControl("lblID");

            polazak.LinijaStajalisteID = Convert.ToInt32(lblID.Text);
            TextBox txtVreme = (TextBox)GvRedVoznje.Rows[e.RowIndex].FindControl("TextBox1");

            polazak.Vreme = txtVreme.Text;

            if (polazak.UpdatePolazak())
            {
                LblRedVoznje.Text = "Podatak je izmenjen";
            }
            else
            {
                LblRedVoznje.Text = "Greska pri izmeni";
            }
            GvRedVoznje.EditIndex = -1;
            GvRedVoznje.DataBind();
        }
Exemple #2
0
        private void BindRedVoznje()
        {
            Polazak polazak = new Polazak();
            string  linija;

            if (DdlLinije.SelectedValue == "")
            {
                linija = "5";
            }
            else
            {
                linija = DdlLinije.SelectedValue;
            }

            List <Polazak> redVoznje = polazak.RedVoznje(linija, DdlSmer.SelectedValue, DdlDan.SelectedValue, -1, -1);

            if (redVoznje.Count != 0)
            {
                LinijaStajaliste.Value = redVoznje[0].LinijaStajalisteID.ToString();
            }

            GvRedVoznje.DataSource = redVoznje;
            GvRedVoznje.DataBind();
        }
Exemple #3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     GvRedVoznje.DataBind();
 }
Exemple #4
0
 protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
 {
     GvRedVoznje.EditIndex = -1;
     GvRedVoznje.DataBind();
 }