protected void GridView1_Sorting(object sender, GridViewSortEventArgs e) { GridViewSortExpression = e.SortExpression; autoLista = BLAutot.jarjestaLista(autoLista, GridViewSortExpression, GetSortDirection()); contentToGridView(autoLista); }
protected void btnUusiAuto_Click(object sender, EventArgs e) { if ((String)Session["logged"] == "true") { Regex rekkari = new Regex(@"^[A-Z]{3}-[0-9]{3}$"); if (rekkari.IsMatch(txtRekkari.Text)) { try { Auto a = new Auto(); a.Aid = txtAid.Text; a.Rekkari = txtRekkari.Text; a.Merkki = txtMerkki.Text; a.Malli = txtMalli.Text; a.Vm = int.Parse(txtVm.Text); a.MyyntiHinta = int.Parse(txtMyyntiHinta.Text); a.SisaanOstoHinta = int.Parse(txtSisaanOstoHinta.Text); autoLista.Add(a); autoLista = BLAutot.jarjestaLista(autoLista, "Malli", "ASC"); contentToGridView(autoLista); } catch (Exception) { } } } else { Response.Redirect("logon.aspx"); } }