예제 #1
0
        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();
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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();
        }
예제 #4
0
        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.
            }
        }