예제 #1
0
        private void CreateNewEmployee()
        {
            Console.Clear();
            string email          = UserInterface.GetStringData("email", "your");
            int    employeeNumber = int.Parse(UserInterface.GetStringData("employee number", "your"));

            try
            {
                employee = Query.RetrieveEmployeeUser(email, employeeNumber);
            }
            catch
            {
                UserInterface.DisplayUserOptions("Employee not found please contact your administrator");
                PointOfEntry.Run();
            }
            if (employee.Password != null)
            {
                UserInterface.DisplayUserOptions("User already in use please log in or contact your administrator");
                LogIn();
                return;
            }
            else
            {
                UpdateEmployeeInfo();
            }
        }
        private void RunUserInput(int input)
        {
            switch (input)
            {
            case 1:
                RunSearch();
                RunUserMenus();
                return;

            case 2:
                UpdateClientInfo();
                RunUserMenus();
                return;

            case 3:
                ApplyForAdoption();
                RunUserMenus();
                return;

            case 4:
                CheckAdoptionStatus();
                RunUserMenus();
                return;

            case 5:
                Console.Clear();
                PointOfEntry.Run();
                return;

            default:
                UserInterface.DisplayUserOptions("Input not accepted please try again");
                return;
            }
        }
예제 #3
0
        private void CreateNewEmployee()
        {
            Console.Clear();
            string firstName      = UserInterface.GetStringData("first name", "your");
            string lastName       = UserInterface.GetStringData("last name", "your");
            string userName       = UserInterface.GetStringData("desired user name", "your");
            string password       = UserInterface.GetStringData("desired CaSe SEnsiTive password", "your");
            int    employeeNumber = int.Parse(UserInterface.GetStringData("employee number", "your"));
            string email          = UserInterface.GetStringData("email address", "your");

            try
            {
                employee = Query.RetrieveEmployeeUser(email, employeeNumber);
            }
            catch
            {
                UserInterface.DisplayUserOptions("Employee not found please contact your administrator");
                PointOfEntry.Run();
            }
            if (employee.pass != null)
            {
                UserInterface.DisplayUserOptions("User already in use please log in or contact your administrator");
                LogIn();
                return;
            }
            else
            {
                UpdateEmployeeInfo();
            }
        }
예제 #4
0
        static void Main(string[] args)
        {
            //string filename = "animals.csv";

            //Query.ImportAnimalsFromCSV(filename);

            PointOfEntry.Run();
        }
예제 #5
0
 static void Main(string[] args)
 {
     //HumaneSocietyDataContext db = new HumaneSocietyDataContext();
     //var tjing = db.Animals.Where(s => s.AnimalId == 1).Single();
     //db.Employees.InsertOnSubmit(new Employee { FirstName = "Mike", EmployeeNumber = 10005 });
     //db.SubmitChanges();
     PointOfEntry.Run();
 }
예제 #6
0
        static void Main(string[] args)
        {
            FileReader.ReadFile();

            FileReader.InitalizeBreedDatabase();

            PointOfEntry.Run();
        }
예제 #7
0
        static void Main(string[] args)
        {
            //PopulateDB pop = new PopulateDB();
            //CSVImporter.CSVImportToDestinationTable("animals.csv", "Animal");
            PointOfEntry.Run();

            Console.ReadLine();
        }
예제 #8
0
        static void Main(string[] args)
        {
            UserEmployee ue = new UserEmployee();

            //ue.UpdateAnimal();
            //uie.UpdateAnimal();
            PointOfEntry.Run();
        }
예제 #9
0
        static void Main(string[] args)
        {
            //Dictionary<int, string> testdict = new Dictionary<int, string>();
            //testdict.Add(7, "90");
            //testdict.Add(1, "Horse");

            //Query.UpdateAnimal(1, testdict);


            PointOfEntry.Run();
            //PointOfEntry.Run();
            //Employee employee = new Employee();
            //Query.RunEmployeeQueries(employee, "create")
            //{

            //Employee employee = new Employee()
            //{
            //    EmployeeId = 6
            //};
            //Query.RunEmployeeQueries(employee, "delete");
            ////};
            //Animal animal = new Animal();
            ////Query.GetAnimalByID(1);
            //Query.UpdateAnimal(1,);

            //Animal animal = new Animal()
            //{
            //    Name = "Bye bye Birdy",
            //    Weight = 1,
            //    Age = 1,
            //    Demeanor = "Happy",
            //    KidFriendly = true,
            //    PetFriendly = true,
            //    Gender = "Female",
            //    AdoptionStatus = null,
            //    CategoryId = 4,
            //    DietPlanId = 1,
            //    EmployeeId = 3
            //};
            //Query.AddAnimal(animal);

            //Animal animal = new Animal()
            //{
            //    AnimalId = 10
            //};
            //Query.RemoveAnimal(animal);
            //Animal animal;
            //Client client;
            //using (var db = new HumaneSocietyDataContext())
            //{
            //    animal = db.Animals.FirstOrDefault();
            //    client = db.Clients.FirstOrDefault();
            //}
            ////Query.Adopt(animal, client);
            //Query.RemoveAdoption(animal.AnimalId, client.ClientId);
        }
예제 #10
0
        static void Main(string[] args)
        {
            PointOfEntry.Run();
            //Employee employee = new Employee();
            //employee.EmployeeId = 6;

            //Query.RunEmployeeQueries(Employee employee, string crudOperation);

            //Query.RemoveEmployee(employee);
        }
예제 #11
0
 static void Main(string[] args)
 {
     PointOfEntry.Run();
     //HumaneSocietyDataContext db = new HumaneSocietyDataContext();
     //Employee employee1 = new Employee();
     //employee1.FirstName = "Dark";
     //employee1.LastName = "Law";
     //employee1.UserName = "******";
     //employee1.Password = "******";
     //employee1.EmployeeNumber = 1;
     //employee1.Email = "*****@*****.**";
     //Query.CreateNewEmployee(employee1,"create");
     //Console.WriteLine("Hold");
 }
예제 #12
0
        static void Main(string[] args)
        {
            //Animal[] animals = new Animal[]
            //{
            //    new Animal {ID = 1001, name = "Murdock", breed = null, weight = 15, age = 2, diet = null, location = null, demeanor = "skittish", kidFriendly = true, petFriendly = false, gender = null, adoptionStatus = "adopted", Employee_ID = null },
            //    new Animal {ID = 1002, name = "Loki", breed = null, weight = 18, age = 3, diet = null, location = null, demeanor = "cuddly", kidFriendly = true, petFriendly = true, gender = null, adoptionStatus = "adopted", Employee_ID = null },
            //    new Animal {ID = 1003, name = "Rowdy", breed = null, weight = 20, age = 8, diet = null, location = null, demeanor = "deceased", kidFriendly = true, petFriendly = true, gender = null, adoptionStatus = "not adopted", Employee_ID = null },
            //};

            //PointOfEntry.Run();

            Import.PopulateAnimals(Import.ImportCSV());

            PointOfEntry.Run();
        }
        public static string GetUserInput()
        {
            string input = Console.ReadLine();
            switch (input.ToLower())
            {
                case "reset":
                    PointOfEntry.Run();
                    Environment.Exit(1);
                    break;
                case "exit":
                    Environment.Exit(1);
                    break;
                default:
                    break;
            }

            return input;
        }
예제 #14
0
 protected void RunInput(string input)
 {
     if (input == "1" || input.ToLower() == "create")
     {
         AddEmployee();
         RunUserMenus();
     }
     else if (input == "2" || input.ToLower() == "delete")
     {
         RemoveEmployee();
         RunUserMenus();
     }
     else if (input == "3" || input.ToLower() == "read")
     {
         ReadEmployee();
         RunUserMenus();
     }
     else if (input == "4" || input.ToLower() == "update")
     {
         UpdateEmployee();
         RunUserMenus();
     }
     else if (input == "5" || input.ToLower() == "import")
     {
         ImportCSVFile();
         RunUserMenus();
     }
     else if (input == "6" || input.ToLower() == "return")
     {
         Console.Clear();
         PointOfEntry.Run();
     }
     else
     {
         UserInterface.DisplayUserOptions("Input not recognized please try again or type exit");
         RunUserMenus();
     }
 }
예제 #15
0
        static void Main(string[] args)
        {
            PointOfEntry.Run();
            //HumaneSocietyDataContext db = new HumaneSocietyDataContext();

            //Query.SearchForAnimalsByMultipleTraits(UserInterface.GetAnimalSearchCriteria());

            //test.AnimalId = 3;
            //test.Name = "Bud";
            //Query.RemoveAnimal(test);
            //Query.UpdateAnimal(7, UserInterface.GetAnimalSearchCriteria());
            //Animal newAnimal = new Animal();
            //newAnimal.AnimalId = 5;

            //Query.UpdateShot("Rabies", newAnimal);



            //Query.Adopt()


            //Console.ReadLine();
        }
예제 #16
0
        public static string GetUserInputWithOutput(string words)
        {
            Console.WriteLine(words);
            string input = Console.ReadLine();

            switch (input.ToLower())

            {
            case "reset":
                PointOfEntry.Run();
                Environment.Exit(1);
                break;

            case "exit":
                Environment.Exit(1);
                break;

            default:
                break;
            }
            string output = CapitalizeFirstLetter(input);

            return(input);
        }
예제 #17
0
        static void Main(string[] args)
        {
            //Employee greg = new Employee { FirstName = "Greg", LastName = "Smithy", UserName = "******", Password = "******", EmployeeNumber = 10, Email = "*****@*****.**" };
            //Animal dog = new Animal
            //{
            //    Name = "benny",
            //    Weight = 20,
            //    Age = 5,
            //    Demeanor = "passive",
            //    KidFriendly = true,
            //    PetFriendly = true,
            //    Gender = "male",
            //    AdoptionStatus = "available",
            //    CategoryId = 1,
            //    DietPlanId = 1,
            //    EmployeeId = 1
            //};
            //Dictionary<int, string> traits = new Dictionary<int, string> { { 1, "cat" }, { 2, "Frisky" }, { 5, "1" } };
            //Dictionary<int, string> updates = new Dictionary<int, string> { { 1, "dog" }, { 2, "Jeff" }, { 3, "50" },{ 4, "2000" }, { 5, "right" } };
            //Animal frisky = Query.GetAnimalByID(Query.SearchForAnimalsByMultipleTraits(traits).FirstOrDefault().AnimalId);
            //Animal nemo = Query.GetAnimalByID(2);
            //Animal wrex = Query.GetAnimalByID(3);
            //Query.UpdateAnimal(wrex.AnimalId,updates);
            //Client stjohn = Query.GetClient("stjohn", "iliketurtles");

            //Query.UpdateAnimal(4, updates);


            //Query.Adopt(frisky, stjohn);
            //Query.Adopt(nemo, stjohn);
            //Query.Adopt(wrex, stjohn);

            //Query.UpdateAdoption(true, Query.GetPendingAdoptions().FirstOrDefault());
            //Query.UpdateAdoption(false, Query.GetPendingAdoptions().FirstOrDefault());
            //Query.UpdateAdoption(false, Query.GetPendingAdoptions().FirstOrDefault());

            //Query.RunEmployeeQueries(greg, "create");
            //Query.RunEmployeeQueries(new Employee { FirstName = "Gregory", LastName = "Smithy", Email = "*****@*****.**", EmployeeNumber = 10 }, "update");
            //Query.RunEmployeeQueries(new Employee { FirstName = "", LastName = "", Email = "" }, "update");
            //Query.RunEmployeeQueries(greg, "delete");



            //Query.UpdateShot("rabies", wrex);
            //Query.UpdateShot("malaria", wrex);

            //Query.RunEmployeeQueries(greg, "read");
            //Query.AddAnimal(dog);

            //var result = Query.SearchForAnimalsByMultipleTraits(traits).ToList();

            //result.ForEach(x => Console.WriteLine(x.Name));

            //Parse.CSVFile("animals.csv");

            //Console.ReadLine();

            PointOfEntry.Run();
            //Query.RemoveAnimal(Query.GetAnimalByID(12));
            //Query.RemoveAnimal(Query.GetAnimalByID(4));
            //Query.RemoveAnimal(Query.GetAnimalByID(14));

            //Console.ReadLine();
        }
예제 #18
0
        static void Main(string[] args)
        {
            PointOfEntry.Run();

            //Query.AddAnimalWithCsv();
        }
예제 #19
0
 static void Main(string[] args)
 {
     //good job!
     PointOfEntry.Run();
 }
예제 #20
0
 static void Main(string[] args)
 {
     CSVReader.AddAnimalsFromFile(CSVReader.ReadFile());
     PointOfEntry.Run();
 }
예제 #21
0
        static void Main(string[] args)
        {
            UserEmployee ue = new UserEmployee();

            PointOfEntry.Run();
        }
예제 #22
0
 static void Main(string[] args)
 {
     // use below for csv file remeber to change file location in CSVreadwr class before running
     // CSVreader.AddAnimalsFromFile(CSVreader.ReadFile());
     PointOfEntry.Run();
 }
예제 #23
0
 static void Main(string[] args)
 {
     PointOfEntry.Run();
 }
예제 #24
0
        static void Main(string[] args)
        {
            var db = new HumaneSocietyDb();

            PointOfEntry.Run();
        }
예제 #25
0
 static void Main(string[] args)
 {
     PointOfEntry.Run();
     //Query.GetAnimalByID(6);
 }