예제 #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 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();
        }
예제 #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 void ShowUserInforSmall()
        {
            List <Member> member = showUser.ShowUsers();
            List <Boat>   boat   = showUser.ShowCompleteUserBoats();

            presentation.displayBoatOutPutQuery(member, boat);
        }
예제 #5
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();
            }
        }
예제 #6
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.
            }
        }
예제 #7
0
파일: Delete.cs 프로젝트: sh222td/Portfolio
        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");
        }
예제 #8
0
파일: Delete.cs 프로젝트: jh222vp/Portfolio
        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();
        }
예제 #9
0
        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!");
        }
예제 #10
0
        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();
        }
예제 #11
0
 public static void ShowUsers()
 {
     ShowUser.ShowUsers();
 }