private void btnSave_Click(object sender, EventArgs e) { Car car = GetEditedCar(); CarBusiness carBusiness = new CarBusiness(); carBusiness.Update(car); PopulateDataGridViewDefault(); ResetSelect(); ToggleSaveUpdate(); ClearTextBoxes(); }
public bool Update(Car car) { try { using (var u = new CarBusiness()) { return(u.Update(car)); } } catch (Exception ex) { Console.WriteLine(ex); return(false); } }
public IHttpActionResult Put([FromBody] Car car) { try { using (var c = new CarBusiness()) { if (c.Update(car)) { return(Ok()); } return(NotFound()); } } catch (Exception ex) { return(BadRequest($"{ex}")); } }