protected void OnRowUpdating(object sender, GridViewUpdateEventArgs e) { int id = IdTickets[e.RowIndex]; FlightsService service = Service.getInstanse().flightService; string departure = e.NewValues[0].ToString(); string arrival = e.NewValues[1].ToString(); int price = Convert.ToInt32(e.NewValues[2].ToString()); string name = e.NewValues[3].ToString(); string surname = e.NewValues[4].ToString(); int idFlightPriceId; if (service.GetFlightPriceId(departure, arrival, out idFlightPriceId)) { if (service.UpdateTicket(id, idFlightPriceId, name, surname)) { GridView.EditIndex = -1; LoadData(); } } }