/// <summary> /// Update a computer by another one /// </summary> /// <param name="t">Computer to be replaced</param> /// <param name="u">Computer to replace</param> /// <returns>True if the computer is updated, false if not</returns> public static bool UpdateComputer(Computer t, Computer u) { try { u.ID = t.ID; if (u.ComputerState == State.Reparada) { string loading = "Reparaste la computadora, ¡excelente!"; for (int i = 0; i < loading.Length; i++) { RepairComputerEvent.Invoke(loading[i]); Thread.Sleep(100); } } UpdateComputerEvent.Invoke(u); LoadComputers(); return(true); } catch (ComputerException ex) { throw ex; } catch (Exception) { throw; } }
/// <summary> /// Update a computer by another one /// </summary> /// <param name="t">Computer to be replaced</param> /// <param name="u">Computer to replace</param> /// <returns>True if the computer is updated, false if not</returns> public static bool UpdateComputer(Computer t, Computer u) { try { u.ID = t.ID; UpdateComputerEvent.Invoke(u); LoadComputers(); return(true); } catch (ComputerException ex) { throw ex; } catch (Exception) { throw; } }