private void RunUserInput(string input) { switch (input) { case "1": AddAnimal(); RunUserMenus(); return; case "2": RemoveAnimal(); RunUserMenus(); return; case "3": CheckAnimalStatus(); RunUserMenus(); return; case "4": CheckAdoptions(); RunUserMenus(); return; case "5": Console.Clear(); PointOfEntry.Run(); return; default: UserInterface.DisplayUserOptions("Input not accepted please try again"); RunUserMenus(); return; } }
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 CreateNewEmployee() { Console.Clear(); Employee employee = new Employee(); employee.UserName = UserInterface.GetStringData("username", "the employee's"); if (Query.CheckEmployeeUserNameExist(employee.UserName)) { Console.WriteLine("Username already exists"); CreateNewEmployee(); return; } employee.FirstName = UserInterface.GetStringData("first name", "the employee's"); employee.LastName = UserInterface.GetStringData("last name", "the employee's"); employee.EmployeeNumber = UserInterface.GetIntegerData("employee number", "the employee's"); employee.Email = UserInterface.GetStringData("email", "the employee's"); employee.Password = UserInterface.GetStringData("password", "the employee's"); try { Query.AddEmployee(employee); Console.Clear(); Console.WriteLine("Employee created"); } catch { UserInterface.DisplayUserOptions("Employee not found please contact your administrator"); PointOfEntry.Run(); } }
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(); } }
static void Main(string[] args) { //employee.Email = "this is a real email"; //Query.CreateEmployee(employee); PointOfEntry.Run(); }
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; } }
static void Main(string[] args) { //PopulateDB pop = new PopulateDB(); //CSVImporter.CSVImportToDestinationTable("animals.csv", "Animal"); PointOfEntry.Run(); Console.ReadLine(); }
static void Main(string[] args) { FileReader.ReadFile(); FileReader.InitalizeBreedDatabase(); PointOfEntry.Run(); }
static void Main(string[] args) { UserEmployee ue = new UserEmployee(); //ue.UpdateAnimal(); //uie.UpdateAnimal(); PointOfEntry.Run(); }
static void Main(string[] args) { //string filename = "animals.csv"; //Query.ImportAnimalsFromCSV(filename); PointOfEntry.Run(); }
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(); }
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); }
static void Main(string[] args) { PointOfEntry.Run(); //Employee employee = new Employee(); //employee.EmployeeId = 6; //Query.RunEmployeeQueries(Employee employee, string crudOperation); //Query.RemoveEmployee(employee); }
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"); }
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; }
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(); } }
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(); }
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); }
static void Main(string[] args) { PointOfEntry.Run(); //Query.GetAnimalByID(6); }
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(); }
static void Main(string[] args) { CSVReader.AddAnimalsFromFile(CSVReader.ReadFile()); PointOfEntry.Run(); }
static void Main(string[] args) { UserEmployee ue = new UserEmployee(); PointOfEntry.Run(); }
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(); }
static void Main(string[] args) { PointOfEntry.Run(); //Query.AddAnimalWithCsv(); }
static void Main(string[] args) { PointOfEntry.Run(); }
static void Main(string[] args) { var db = new HumaneSocietyDb(); PointOfEntry.Run(); }
static void Main(string[] args) { //good job! PointOfEntry.Run(); }