public static void EditBoats() { ShowUser.ShowUsers(); Console.WriteLine(""); Console.Write("Vilken medlem vill du ändra en båt hos: "); int userChoice = int.Parse(Console.ReadLine()); string showBoatQuery = "CALL `displayBoat`" + "(" + userChoice + ");"; SQLconnection.DeleteBoatSQL(showBoatQuery); Console.WriteLine("Vilken båt vill ändra..?"); int userBoatChoice = int.Parse(Console.ReadLine()); Console.WriteLine("Ange nya båtvärden.."); Console.WriteLine("Ny båtlängd:"); string newBoatLength = Console.ReadLine(); Console.WriteLine("Ange en ny båttyp:"); Console.WriteLine("1.Segelbåt 2.Motorseglare 3.Motorbåt 4.Kajak/Kanot 5.Övrigt"); string newBoatype = Console.ReadLine(); string editBoatQuery = "UPDATE boat SET boattypeID='" + newBoatype + "'" + ", boatlength='" + newBoatLength + "'" + " WHERE boatID='" + userBoatChoice + "'"; SQLconnection.con(editBoatQuery); Console.Clear(); Presentation.BoatIsEdited(); Program.ContinueOnKeyPressed(); }
public static void AddBoatToMember() { Presentation.AddBoat(); Console.WriteLine("Vill du lägga till båt? J/N"); string userInput = Console.ReadLine(); if (userInput == "J" || userInput == "j") { Console.Clear(); ShowUser.ShowUsers(); Console.WriteLine(""); Console.Write("Hos vem: "); int userChoice = int.Parse(Console.ReadLine()); Console.Write("Hur lång är båten: "); string boatLength = Console.ReadLine(); Console.WriteLine("Vad vill du lägga till för båt?"); Console.WriteLine("1.Segelbåt 2.Motorseglare 3.Motorbåt 4.Kajak/Kanot 5.Övrigt"); string boatType = Console.ReadLine(); string addUserQuery = "INSERT INTO boat (memberID, boattypeID, boatlength) VALUES ( " + "'" + userChoice + "'" + "," + "'" + boatType + "'" + "," + "'" + boatLength + "'" + ")"; SQLconnection.addBoatconn(addUserQuery); Console.Clear(); Presentation.BoatIsAdded(); Console.ReadLine(); } }
public static void EditUserInfo() { Presentation.EditUsers(); ShowUser.ShowUsers(); Console.WriteLine(""); Console.Write("Välj vem du vill editera: "); string userEdit = Console.ReadLine(); Console.Write("Skriv in ett nytt förnamn: "); string fName = Console.ReadLine(); Console.Write("Skriv in ett nytt efternamn: "); string lName = Console.ReadLine(); Console.Write("Skriv in ett nytt personnummer: "); string pNumber = Console.ReadLine(); string editUserQuery = "UPDATE member SET firstname='" + fName + "'" + ", lastname='" + lName + "'" + ", socialsecuritynumber= '" + pNumber + "'" + " WHERE memberID='" + userEdit + "'"; SQLconnection.addBoatconn(editUserQuery); Console.Clear(); Presentation.MemberIsEdit(); Program.ContinueOnKeyPressed(); }
public static void EditUserInfo() { AddInformation addInfo = new AddInformation(); Presentation.EditUsers(); ShowUser.ShowUsers(); Console.WriteLine("Välj vem du vill editera: "); string userEdit = Console.ReadLine(); Console.Write("Skriv in ett nytt förnamn: "); string fName = Console.ReadLine(); Console.Write("Skriv in ett nytt efternamn: "); string lName = Console.ReadLine(); Console.Write("Skriv in ett nytt personnummer: "); string pNumber = Console.ReadLine(); string editUserQuery = "UPDATE member SET firstname='" + fName + "'" + ", lastname='" + lName + "'" + ", socialsecuritynumber= '" + pNumber + "'" + " WHERE memberID='" + userEdit + "'"; SQLconnection.addBoatconn(editUserQuery); Console.WriteLine("Medlemen är ändrad"); Console.ReadLine(); }
public static void AddBoatToMember() { AddInformation addInfo = new AddInformation(); Presentation.EditUsers(); Console.WriteLine("Vill du lägga till båt? J/N"); string userInput = Console.ReadLine(); if (userInput == "J" || userInput == "j") { ShowUser.ShowUsers(); Console.WriteLine("Hos vem?"); int userChoice = int.Parse(Console.ReadLine()); Console.WriteLine("Hur lång är båten "); string boatLength = Console.ReadLine(); Console.WriteLine("Vad vill du lägga till för båt?"); Console.WriteLine("1.Segelbåt 2.Motorseglare 3.Motorbåt 4.Kajak/Kanot 5.Övrigt"); string boatType = Console.ReadLine(); string addUserQuery = "INSERT INTO boat (memberID, boattypeID, boatlength) VALUES ( " + "'" + userChoice + "'" + "," + "'" + boatType + "'" + "," + "'" + boatLength + "'" + ")"; SQLconnection.addBoatconn(addUserQuery); Console.WriteLine("Båten tillagd"); Console.ReadLine(); //Skriv in "WHERE USER = userChoice för att lägga till eller ersätta en båt. } }
public static void DeleteUsers() { Presentation.DeletePresentation(); ShowUser.ShowUsers(); Console.WriteLine("Vilken användare vill du ta bort?: "); int deleteChoice = int.Parse(Console.ReadLine()); string deleteMemberQuery = "CALL `deleteMember`" + "(" + deleteChoice + ");"; SQLconnection.DeleteBoatSQL(deleteMemberQuery); Console.WriteLine("Nu är medlemmen borttagen"); }
public static void DeleteUsers() { Presentation.DeletePresentation(); ShowUser.ShowUsers(); Console.WriteLine(""); Console.Write("Vilken användare vill du ta bort?: "); int deleteChoice = int.Parse(Console.ReadLine()); string deleteMemberQuery = "CALL `deleteMember`" + "(" + deleteChoice + ");"; SQLconnection.DeleteBoatSQL(deleteMemberQuery); Console.Clear(); Presentation.UserIsDeleted(); Program.ContinueOnKeyPressed(); }
public static void DeleteBoats() { ShowUser.ShowUsers(); Console.WriteLine("Vilken medlem vill du ta bort en båt hos..?"); int userChoice = int.Parse(Console.ReadLine()); string showBoatQuery = "CALL `displayBoat`" + "(" + userChoice + ");"; SQLconnection.DeleteBoatSQL(showBoatQuery); Console.WriteLine("Vilken båt vill du ta bort..?"); int userBoatChoice = int.Parse(Console.ReadLine()); string deleteBoatQuery = "CALL `deleteBoat`" + "(" + userBoatChoice + ");"; SQLconnection.DeleteBoatSQL(deleteBoatQuery); Console.WriteLine("Nu är din båt borttagen din jävla sexiga hukk!"); }
public static void DeleteBoats() { ShowUser.ShowUsers(); Console.WriteLine("Vilken medlem vill du ta bort en båt hos..?"); int userChoice = int.Parse(Console.ReadLine()); string showBoatQuery = "CALL `displayBoat`" + "(" + userChoice + ");"; SQLconnection.DeleteBoatSQL(showBoatQuery); Console.WriteLine("Vilken båt vill du ta bort..?"); int userBoatChoice = int.Parse(Console.ReadLine()); string deleteBoatQuery = "CALL `deleteBoat`" + "(" + userBoatChoice + ");"; SQLconnection.DeleteBoatSQL(deleteBoatQuery); Console.Clear(); Presentation.BoatIsDeleted(); Program.ContinueOnKeyPressed(); }
public static void ShowUsers() { ShowUser.ShowUsers(); }
public static void ShowCompleteUser() { ShowUser.ShowCompleteUser(); }
public static void SpecificUserInfo() { ShowUser.SpecificUserInfo(); }