public void Execute() { try { System.Console.Write("ID:"); string id_z = System.Console.ReadLine(); System.Console.Write("ID-ul userului:"); string id_user = System.Console.ReadLine(); System.Console.Write("Tip:"); string tip = System.Console.ReadLine(); System.Console.Write("Destinatie:"); string destiantie = System.Console.ReadLine(); System.Console.Write("Data plecare:"); System.Console.Write("Introdu anul:"); string an = System.Console.ReadLine(); System.Console.Write("Introdu luna:"); string luna = System.Console.ReadLine(); System.Console.Write("Introdu ziua:"); string ziua = System.Console.ReadLine(); DateTime data_plecare = new DateTime(Int32.Parse(an), Int32.Parse(luna), Int32.Parse(ziua)); System.Console.Write("Pret:"); string pret = System.Console.ReadLine(); try { service.AddOffer(Int32.Parse(id_z), Int32.Parse(id_user), tip, destiantie, data_plecare, Int32.Parse(pret)); System.Console.WriteLine("Adaugare reusita!"); } catch (ValidationException ex) { System.Console.WriteLine("Validation failed " + ex.Message); } catch (RepositoryException ex) { System.Console.WriteLine("Unable to persist data " + ex.Message); } } catch { System.Console.WriteLine("Date invalide!"); } System.Console.WriteLine(); }