public void Init() { DataBase.DataBaseManagement db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel addSpecyPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Ajouter une espèce"; addSpecyPanel.Controls.Add(title); // intitule TextBox specy = new TextBox(); specy.Size = new Size(150, 30); specy.Location = new Point(205, 100); specy.Text = "Intitulé"; addSpecyPanel.Controls.Add(specy); // bouton confirmer Button confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 350); confirmButton.Text = "Confirmer"; confirmButton.Click += (sender, eventArgs) => { db.insertSpecy(specy.Text); }; confirmButton.Click += new EventHandler(homePage); addSpecyPanel.Controls.Add(confirmButton); // bouton annuler Button cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 350); cancelButton.Text = "Annuler"; cancelButton.Click += new EventHandler(homePage); addSpecyPanel.Controls.Add(cancelButton); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel displayClientsPanel.Controls.Clear(); // titre title= new Label(); title.Size = new Size(500, 30); title.Size = new Size(90, 30); title.Font = new Font("Arial", 15); title.Location = new Point(170, 20); title.Text = "Clients"; displayClientsPanel.Controls.Add(title); // liste des clients clientsList = new Label(); clientsList.Location = new Point(60, 80); clientsList.Size = new Size(75, 1000); completeClientsList(); displayClientsPanel.Controls.Add(clientsList); // bouton ajouter client addClientButton = new Button(); addClientButton.Location = new Point(260, 10); addClientButton.Text = "Ajouter client"; addClientButton.Size = new Size(150, 30); displayClientsPanel.Controls.Add(addClientButton); addClientButton.Click += new EventHandler(addClient_Click); // barre de recherche search = new TextBox(); search.Location = new Point(450, 0); search.Text = "Rechercher"; search.Size = new Size(150, 30); displayClientsPanel.Controls.Add(search); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel displayCareAnimalPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(150, 20); title.Text = "Soins de cet animal"; displayCareAnimalPanel.Controls.Add(title); int y = 100; // ordonnee labels // rendez-vous en rapport avec l'animal foreach (String s in db.getCaresAnimal(animal_id)) { Label care = new Label(); care.Size = new Size(500, 30); care.Font = new Font("Arial", 20); care.Location = new Point(145, y); care.Text = s; y += 50; } // bouton retour Button backButton = new Button(); backButton.Size = new Size(100, 30); backButton.Location = new Point(150, 310); backButton.Text = "Retour"; backButton.Click += new EventHandler(displayAnimals); displayCareAnimalPanel.Controls.Add(backButton); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel addClientPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Ajouter un client"; addClientPanel.Controls.Add(title); // nom name = new TextBox(); name.Size = new Size(100, 30); name.Location = new Point(230, 100); name.Text = "Nom"; addClientPanel.Controls.Add(name); // prénom firstName = new TextBox(); firstName.Size = new Size(100, 30); firstName.Location = new Point(230, 130); firstName.Text = "Prénom"; addClientPanel.Controls.Add(firstName); // city city = new TextBox(); city.Size = new Size(100, 30); city.Location = new Point(230, 160); city.Text = "Ville"; addClientPanel.Controls.Add(city); // adresse adress = new TextBox(); adress.Size = new Size(100, 30); adress.Location = new Point(230, 190); adress.Text = "Adresse"; addClientPanel.Controls.Add(adress); // mail mail = new TextBox(); mail.Size = new Size(100, 30); mail.Location = new Point(230, 220); mail.Text = "Mail"; addClientPanel.Controls.Add(mail); // bouton confirmer confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 310); confirmButton.Text = "Confirmer"; addClientPanel.Controls.Add(confirmButton); confirmButton.Click += new EventHandler(confirm_Click); // bouton annuler cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 310); cancelButton.Text = "Annuler"; addClientPanel.Controls.Add(cancelButton); cancelButton.Click += new EventHandler(cancel_Click); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel displayRemindersPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Size = new Size(90, 30); title.Font = new Font("Arial", 15); title.Location = new Point(170, 20); title.Text = "Rappels"; displayRemindersPanel.Controls.Add(title); // bouton ajouter rappel Button addReminderButton = new Button(); addReminderButton.Location = new Point(260, 10); addReminderButton.Text = "Ajouter rappel"; addReminderButton.Size = new Size(150, 30); addReminderButton.Click += new EventHandler(addReminder); displayRemindersPanel.Controls.Add(addReminderButton); // barre de recherche TextBox search = new TextBox(); search.Location = new Point(450, 0); search.Text = "Rechercher"; search.Size = new Size(150, 30); displayRemindersPanel.Controls.Add(search); // liste des rappels Label remindersList = new Label(); remindersList.Location = new Point(60, 80); remindersList.Size = new Size(75, 1000); int y = 75; // ordonnee boutons pour chaque rappels foreach (string s in db.getReminders()) { remindersList.Text += s.Split(':')[2] + "\n\n"; int reminder_id = Int32.Parse(s.Split(':')[0]); // bouton modifier rappel Button modReminderButton = new Button(); modReminderButton.Location = new Point(145, y); modReminderButton.Text = "Modifier rappel"; modReminderButton.Size = new Size(75, 20); modReminderButton.Click += (sender, eventArgs) => modifyReminder(sender, eventArgs, reminder_id); displayRemindersPanel.Controls.Add(modReminderButton); // bouton supprimer rappel Button delReminderButton = new Button(); delReminderButton.Location = new Point(230, y); delReminderButton.Text = "Supprimer rappel"; delReminderButton.Size = new Size(75, 20); delReminderButton.Click += (sender, eventArgs) => { db.deleteReminder(reminder_id); }; delReminderButton.Click += new EventHandler(refreshReminders); displayRemindersPanel.Controls.Add(delReminderButton); y += 27; } displayRemindersPanel.Controls.Add(remindersList); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel modifyClientPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Modifier un client"; modifyClientPanel.Controls.Add(title); // client client = new ComboBox(); client.Size = new Size(100, 30); client.Location = new Point(230, 100); client.Text = "Nom Client"; client.SelectedIndexChanged += new EventHandler(client_SelectedIndexChanged); modifyClientPanel.Controls.Add(client); // city city = new TextBox(); city.Size = new Size(100, 30); city.Location = new Point(230, 160); city.Text = "Ville"; modifyClientPanel.Controls.Add(city); // adresse adress = new TextBox(); adress.Size = new Size(100, 30); adress.Location = new Point(230, 190); adress.Text = "Adresse"; modifyClientPanel.Controls.Add(adress); // mail mail = new TextBox(); mail.Size = new Size(100, 30); mail.Location = new Point(230, 220); mail.Text = "Mail"; modifyClientPanel.Controls.Add(mail); // bouton confirmer confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 310); confirmButton.Text = "Confirmer"; modifyClientPanel.Controls.Add(confirmButton); confirmButton.Click += new EventHandler(confirm_Click); // bouton annuler cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 310); cancelButton.Text = "Annuler"; modifyClientPanel.Controls.Add(cancelButton); cancelButton.Click += new EventHandler(cancel_Click); completeClient(); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel ModifyAppointementPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Modifier rendez-vous"; ModifyAppointementPanel.Controls.Add(title); // nom client = new ComboBox(); client.Size = new Size(150, 30); client.Location = new Point(205, 100); client.Text = "Nom"; client.SelectedIndexChanged += new EventHandler(Client_SelectedIndexChanged); ModifyAppointementPanel.Controls.Add(client); // animal animal = new ComboBox(); animal.Size = new Size(150, 30); animal.Location = new Point(205, 130); animal.Text = "Animal"; animal.SelectedIndexChanged += new EventHandler(Animal_SelectedIndexChanged); ModifyAppointementPanel.Controls.Add(animal); // Date calendar = new MonthCalendar(); calendar.Location = new Point(165, 170); ModifyAppointementPanel.Controls.Add(calendar); // raison reason = new TextBox(); reason.Size = new Size(150, 30); reason.Location = new Point(205, 350); reason.Text = "Objet du rendez-vous"; ModifyAppointementPanel.Controls.Add(reason); // bouton confirmer confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 400); confirmButton.Text = "Confirmer"; ModifyAppointementPanel.Controls.Add(confirmButton); confirmButton.Click += new EventHandler(confirm_Click); // bouton annuler cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 400); cancelButton.Text = "Annuler"; ModifyAppointementPanel.Controls.Add(cancelButton); cancelButton.Click += new EventHandler(cancel_Click); completeClient(); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel addReminderPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Ajouter un rappel"; addReminderPanel.Controls.Add(title); // intitule TextBox name = new TextBox(); name.Size = new Size(150, 30); name.Location = new Point(205, 100); name.Text = "Intitulé"; addReminderPanel.Controls.Add(name); // animal ComboBox animal = new ComboBox(); animal.Size = new Size(150, 30); animal.Location = new Point(205, 130); animal.Text = "Animal"; List<string> animals = db.getAnimals(); foreach (string a in animals) { animal.Items.Add(a); } addReminderPanel.Controls.Add(animal); // Date DateTimePicker date = new DateTimePicker(); date.Format = DateTimePickerFormat.Short; date.Size = new Size(150, 30); date.Location = new Point(205, 160); addReminderPanel.Controls.Add(date); // bouton confirmer Button confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 350); confirmButton.Text = "Confirmer"; confirmButton.Click += (sender, eventArgs) => { db.insertReminder(date.Text, name.Text); }; confirmButton.Click += new EventHandler(displayReminders); addReminderPanel.Controls.Add(confirmButton); // bouton annuler Button cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 350); cancelButton.Text = "Annuler"; cancelButton.Click += new EventHandler(homePage); addReminderPanel.Controls.Add(cancelButton); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); animals = db.getAnimalsClient(code); // suppression de tout les objets du panel DisplayAppointmentsPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Afficher rendez-vous"; DisplayAppointmentsPanel.Controls.Add(title); // client client = new Label(); client.Size = new Size(150, 30); client.Location = new Point(205, 100); client.Text = "Nom"; DisplayAppointmentsPanel.Controls.Add(client); // animal animal = new ComboBox(); animal.Size = new Size(150, 30); animal.Location = new Point(205, 130); animal.Text = "Animal"; animal.SelectedIndexChanged += new EventHandler(animal_SelectedIndexChanged); DisplayAppointmentsPanel.Controls.Add(animal); // Date calendar = new MonthCalendar(); calendar.Location = new Point(165, 170); DisplayAppointmentsPanel.Controls.Add(calendar); // raison reason = new Label(); reason.Size = new Size(150, 30); reason.Location = new Point(205, 350); reason.Text = "Objet du rendez-vous"; DisplayAppointmentsPanel.Controls.Add(reason); // bouton retour backButton = new Button(); backButton.Size = new Size(100, 30); backButton.Location = new Point(205, 380); backButton.Text = "Retour"; DisplayAppointmentsPanel.Controls.Add(backButton); backButton.Click += new EventHandler(back_Click); completeAnimals(); clientData = db.detailsClient(code); client.Text = clientData.Split(':')[1] +" "+ clientData.Split(':')[2]; }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel AddProductPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Ajouter un produit"; AddProductPanel.Controls.Add(title); // référence reference = new TextBox(); reference.Size = new Size(150, 30); reference.Location = new Point(205, 100); reference.Text = "Référence"; AddProductPanel.Controls.Add(reference); // quantité quantite = new TextBox(); quantite.Size = new Size(150, 30); quantite.Location = new Point(205, 135); quantite.Text = "Quantité"; AddProductPanel.Controls.Add(quantite); // prix prix = new TextBox(); prix.Size = new Size(150, 30); prix.Location = new Point(205, 170); prix.Text = "Prix"; AddProductPanel.Controls.Add(prix); // bouton confirmer confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 220); confirmButton.Text = "Confirmer"; AddProductPanel.Controls.Add(confirmButton); confirmButton.Click += new EventHandler(confirm_Click); // bouton annuler cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 220); cancelButton.Text = "Annuler"; AddProductPanel.Controls.Add(cancelButton); cancelButton.Click += new EventHandler(cancel_Click); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel AddLeavePeriodPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Ajouter un client"; AddLeavePeriodPanel.Controls.Add(title); // employee employee = new ComboBox(); employee.Size = new Size(100, 30); employee.Location = new Point(230, 100); employee.Text = "Employé"; AddLeavePeriodPanel.Controls.Add(employee); // nb jours de congés nbDays = new ComboBox(); nbDays.Size = new Size(100, 30); nbDays.Location = new Point(230, 130); nbDays.Text = "Nombre de jours"; AddLeavePeriodPanel.Controls.Add(nbDays); // Date calendar = new MonthCalendar(); calendar.Location = new Point(165, 170); AddLeavePeriodPanel.Controls.Add(calendar); // bouton confirmer confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 310); confirmButton.Text = "Confirmer"; AddLeavePeriodPanel.Controls.Add(confirmButton); confirmButton.Click += new EventHandler(confirm_Click); // bouton annuler cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 310); cancelButton.Text = "Annuler"; AddLeavePeriodPanel.Controls.Add(cancelButton); cancelButton.Click += new EventHandler(cancel_Click); }
private void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel displayUsersPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 15); title.Location = new Point(170, 20); title.Text = "Utilisateurs"; displayUsersPanel.Controls.Add(title); // liste des utilisateurs Label usersList = new Label(); usersList.Location = new Point(60, 80); usersList.Size = new Size(75, 1000); int x = 145; // abscisse boutons int y = 75; // ordonnee boutons pour chaque utilisateur foreach (string s in db.displayUsers()) { usersList.Text += s.Split(':')[1] + "\n\n"; int user_id = Int32.Parse(s.Split(':')[0]); // bouton modifier Button modUserButton = new Button(); modUserButton.Location = new Point(x, y); modUserButton.Text = "Modifier"; modUserButton.Size = new Size(75, 20); modUserButton.Click += (sender, eventArgs) => modifyUser(sender, eventArgs, user_id); displayUsersPanel.Controls.Add(modUserButton); x += 85; // bouton supprimer Button delUserButton = new Button(); delUserButton.Location = new Point(x, y); delUserButton.Text = "Supprimer"; delUserButton.Size = new Size(75, 20); delUserButton.Click += (sender, eventArgs) => { db.deleteUser(user_id); }; delUserButton.Click += new EventHandler(refreshUsers); displayUsersPanel.Controls.Add(delUserButton); x = 145; y += 27; } displayUsersPanel.Controls.Add(usersList); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel deleteProductPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Retirer un produit"; deleteProductPanel.Controls.Add(title); // produit product = new ComboBox(); product.Size = new Size(100, 30); product.Location = new Point(230, 100); product.Text = "Produit"; product.SelectedIndexChanged += new EventHandler(product_SelectedIndexChanged); deleteProductPanel.Controls.Add(product); // quantité quantity = new Label(); quantity.Size = new Size(100, 30); quantity.Location = new Point(230, 160); quantity.Text = "Quantité"; deleteProductPanel.Controls.Add(quantity); // bouton confirmer confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 310); confirmButton.Text = "Confirmer"; deleteProductPanel.Controls.Add(confirmButton); confirmButton.Click += new EventHandler(confirm_Click); // bouton annuler cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 310); cancelButton.Text = "Annuler"; deleteProductPanel.Controls.Add(cancelButton); cancelButton.Click += new EventHandler(cancel_Click); completeProducts(); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel DisplayProductsPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Size = new Size(90, 30); title.Font = new Font("Arial", 15); title.Location = new Point(170, 20); title.Text = "Produits"; DisplayProductsPanel.Controls.Add(title); // liste des clients productsList = new Label(); productsList.Location = new Point(60, 80); productsList.Size = new Size(75, 1000); completeProductsList(); DisplayProductsPanel.Controls.Add(productsList); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel modifyAnimalPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Modifier un animal"; modifyAnimalPanel.Controls.Add(title); int y = 100; // ordonnee labels String details = db.displayAnimalDetails(code_animal); // nom TextBox name = new TextBox(); name.Size = new Size(100, 30); name.Location = new Point(230, y); name.Text = details.Split(':')[0]; modifyAnimalPanel.Controls.Add(name); y += 30; // poids TextBox weight = new TextBox(); weight.Size = new Size(100, 30); weight.Location = new Point(230, y); weight.Text = details.Split(':')[1].Remove(details.Split(':')[1].Length - 3); // pour éviter qu'il y ait plusieurs "kg" modifyAnimalPanel.Controls.Add(weight); y += 30; // proprietaire owner = new ComboBox(); owner.Size = new Size(100, 30); owner.Location = new Point(230, y); owner.SelectedText = details.Split(':')[3] + " " + details.Split(':')[4]; person_id = db.findPersonIdByName(details.Split(':')[3], details.Split(':')[4]); people = db.getPeople(); foreach (string p in people) { owner.Items.Add(p.Split(':')[1] + " " + p.Split(':')[2]); } owner.SelectedIndexChanged += new EventHandler(ownerChange); modifyAnimalPanel.Controls.Add(owner); y += 30; // date de naissance DateTimePicker date = new DateTimePicker(); date.Format = DateTimePickerFormat.Short; date.Size = new Size(100, 30); date.Location = new Point(230, y); date.Text = details.Split(':')[2]; modifyAnimalPanel.Controls.Add(date); y += 30; // espece specy = new ComboBox(); specy.Size = new Size(100, 30); specy.Location = new Point(230, y); specy.SelectedText = details.Split(':')[5]; specy_id = db.findSpecyIdByName(specy.SelectedText); species = db.getSpecies(); foreach (string s in species) { specy.Items.Add(s.Split(':')[1]); } specy.SelectedIndexChanged += new EventHandler(specyChange); modifyAnimalPanel.Controls.Add(specy); y += 30; // race breed = new ComboBox(); breed.Size = new Size(100, 30); breed.Location = new Point(230, y); breed.SelectedText = details.Split(':')[6]; breed_id = db.findBreedIdByName(details.Split(':')[6]); breed.SelectedIndexChanged += new EventHandler(breedChange); modifyAnimalPanel.Controls.Add(breed); // bouton confirmer Button confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 310); confirmButton.Text = "Confirmer"; confirmButton.Click += (sender, eventArgs) => { db.UpdateAnimal(name.Text, weight.Text + " kg", date.Text, person_id, breed_id, this.code_animal); }; confirmButton.Click += new EventHandler(displayAnimals); modifyAnimalPanel.Controls.Add(confirmButton); // bouton retour Button backButton = new Button(); backButton.Size = new Size(100, 30); backButton.Location = new Point(310, 310); backButton.Text = "Retour"; backButton.Click += new EventHandler(displayAnimals); modifyAnimalPanel.Controls.Add(backButton); /* // bouton proprietaire Button ownerButton = new Button(); ownerButton.Size = new Size(100, 30); ownerButton.Location = new Point(470, 310); ownerButton.Text = "Propriétaire"; modifyAnimalPanel.Controls.Add(ownerButton); // bouton soins Button careButton = new Button(); careButton.Size = new Size(100, 30); careButton.Location = new Point(580, 310); careButton.Text = "Soins"; modifyAnimalPanel.Controls.Add(careButton); */ }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel displayAnimalsPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Size = new Size(90, 30); title.Font = new Font("Arial", 15); title.Location = new Point(170, 20); title.Text = "Animaux"; displayAnimalsPanel.Controls.Add(title); // bouton afficher rendez-vous Button displayRemindersButton = new Button(); displayRemindersButton.Location = new Point(0, 0); displayRemindersButton.Text = "Afficher rendez-vous"; displayRemindersButton.Size = new Size(150, 30); displayRemindersButton.Click += new EventHandler(displayReminders); displayAnimalsPanel.Controls.Add(displayRemindersButton); // bouton ajouter animal Button addAnimalButton = new Button(); addAnimalButton.Location = new Point(260, 10); addAnimalButton.Text = "Ajouter animal"; addAnimalButton.Size = new Size(150, 30); addAnimalButton.Click += new EventHandler(addAnimal); displayAnimalsPanel.Controls.Add(addAnimalButton); // barre de recherche TextBox search = new TextBox(); search.Location = new Point(450, 0); search.Text = "Rechercher"; search.Size = new Size(150, 30); displayAnimalsPanel.Controls.Add(search); // liste des animaux Label animalsList = new Label(); animalsList.Location = new Point(60, 80); animalsList.Size = new Size(75, 1000); int x = 145; // abscisse boutons int y = 75; // ordonnee boutons pour chaque animal foreach (string s in db.DisplayAnimals()) { animalsList.Text += s.Split(':')[1] + "\n\n"; int animal_id = Int32.Parse(s.Split(':')[0]); // bouton modifier animal Button modAnimalButton = new Button(); modAnimalButton.Location = new Point(x, y); modAnimalButton.Text = "Modifier animal"; modAnimalButton.Size = new Size(75, 20); modAnimalButton.Click += (sender, eventArgs) => modifyAnimal(sender, eventArgs, animal_id); displayAnimalsPanel.Controls.Add(modAnimalButton); x += 85; // bouton supprimer animal Button delAnimalButton = new Button(); delAnimalButton.Location = new Point(x, y); delAnimalButton.Text = "Supprimer animal"; delAnimalButton.Size = new Size(75, 20); delAnimalButton.Click += (sender, eventArgs) => { db.DeleteAnimal(animal_id); }; delAnimalButton.Click += new EventHandler(refreshAnimals); displayAnimalsPanel.Controls.Add(delAnimalButton); x += 85; // bouton afficher rendez-vous Button displayRemindersAnimalButton = new Button(); displayRemindersAnimalButton.Location = new Point(x, y); displayRemindersAnimalButton.Text = "Rendez-vous"; displayRemindersAnimalButton.Size = new Size(80, 20); displayRemindersAnimalButton.Click += (sender, eventArgs) => displayAppointmentsAnimal(sender, eventArgs, animal_id); displayAnimalsPanel.Controls.Add(displayRemindersAnimalButton); x += 90; // bouton soins Button careButton = new Button(); careButton.Location = new Point(x, y); careButton.Text = "Soins"; careButton.Size = new Size(75, 20); careButton.Click += (sender, eventArgs) => displayCareAnimal(sender, eventArgs, animal_id); displayAnimalsPanel.Controls.Add(careButton); x += 85; // bouton details Button detailsButton = new Button(); detailsButton.Location = new Point(x, y); detailsButton.Text = "Details"; detailsButton.Size = new Size(75, 20); detailsButton.Click += (sender, eventArgs) => displayAnimalDetails(sender, eventArgs, animal_id); displayAnimalsPanel.Controls.Add(detailsButton); x = 145; y += 27; } displayAnimalsPanel.Controls.Add(animalsList); }
private void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel addUserPanel.Controls.Clear(); int y = 100; // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Ajouter un utilisateur"; addUserPanel.Controls.Add(title); // nom TextBox name = new TextBox(); name.Size = new Size(150, 30); name.Location = new Point(205, y); name.Text = "Nom"; addUserPanel.Controls.Add(name); y += 30; // prenom TextBox first_name = new TextBox(); first_name.Size = new Size(150, 30); first_name.Location = new Point(205, y); first_name.Text = "Prénom"; addUserPanel.Controls.Add(first_name); y += 30; // adresse mail TextBox mail = new TextBox(); mail.Size = new Size(150, 30); mail.Location = new Point(205, y); mail.Text = "Adresse e-mail"; addUserPanel.Controls.Add(mail); y += 30; // rang ComboBox rank = new ComboBox(); rank.Size = new Size(150, 30); rank.Location = new Point(205, y); rank.Text = "Rang"; List<string> ranks = new List<string>(); ranks.Add("Administrateur"); ranks.Add("Vétérinaire"); ranks.Add("Assistant(e)"); foreach (string r in ranks) { rank.Items.Add(r); } addUserPanel.Controls.Add(rank); y += 30; // nom d'utilisateur TextBox user_login = new TextBox(); user_login.Size = new Size(150, 30); user_login.Location = new Point(205, y); user_login.Text = "Nom d'utilisateur"; addUserPanel.Controls.Add(user_login); y += 30; // mot de passe TextBox user_password = new TextBox(); user_password.Size = new Size(150, 30); user_password.Location = new Point(205, y); user_password.Text = "Mot de passe"; addUserPanel.Controls.Add(user_password); y += 30; // confirmation mot de passe TextBox user_password_confirm = new TextBox(); user_password_confirm.Size = new Size(150, 30); user_password_confirm.Location = new Point(205, y); user_password_confirm.Text = "Confirmation mot de passe"; addUserPanel.Controls.Add(user_password_confirm); // bouton confirmer Button confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 350); confirmButton.Text = "Ajouter"; confirmButton.Click += (sender, eventArgs) => { db.insertUser(rank.Text, user_login.Text, user_password.Text); }; confirmButton.Click += new EventHandler(displayUsers); addUserPanel.Controls.Add(confirmButton); // bouton annuler Button cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 350); cancelButton.Text = "Annuler"; cancelButton.Click += new EventHandler(userHomePage); addUserPanel.Controls.Add(cancelButton); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel modifyUserPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Modifier un utilisateur"; modifyUserPanel.Controls.Add(title); int y = 100; // ordonnee labels //String details = db.displayAnimalDetails(user_id); // nom TextBox name = new TextBox(); name.Size = new Size(100, 30); name.Location = new Point(230, y); name.Text = "Nom"; modifyUserPanel.Controls.Add(name); y += 30; // prenom TextBox first_name = new TextBox(); first_name.Size = new Size(100, 30); first_name.Location = new Point(230, y); first_name.Text = "Prénom"; modifyUserPanel.Controls.Add(first_name); y += 30; // mail TextBox mail = new TextBox(); mail.Size = new Size(100, 30); mail.Location = new Point(230, y); mail.Text = "Mail"; modifyUserPanel.Controls.Add(mail); y += 30; // rang rank = new ComboBox(); rank.Size = new Size(100, 30); rank.Location = new Point(230, y); rank.SelectedText = "Rang"; rank_id = db.findSpecyIdByName(rank.SelectedText); ranks = new List<String>(); ranks.Add("Administrateur"); ranks.Add("Vétérinaire"); ranks.Add("Assistant(e)"); foreach (string r in ranks) { rank.Items.Add(r); } //rank.SelectedIndexChanged += new EventHandler(rankChange); modifyUserPanel.Controls.Add(rank); y += 30; // identifiant TextBox login = new TextBox(); login.Size = new Size(100, 30); login.Location = new Point(230, y); login.Text = "Login"; modifyUserPanel.Controls.Add(login); y += 30; // mot de passe TextBox password = new TextBox(); password.Size = new Size(100, 30); password.Location = new Point(230, y); password.Text = "Mot de passe"; modifyUserPanel.Controls.Add(password); y += 30; // nouveau mot de passe TextBox new_password = new TextBox(); new_password.Size = new Size(100, 30); new_password.Location = new Point(230, y); new_password.Text = "Nouveau mot de passe"; modifyUserPanel.Controls.Add(new_password); y += 30; // confirmation nouveau mot de passe TextBox new_password_confirm = new TextBox(); new_password_confirm.Size = new Size(100, 30); new_password_confirm.Location = new Point(230, y); new_password_confirm.Text = "Confirmation nouveau mot de passe"; modifyUserPanel.Controls.Add(new_password_confirm); // bouton modifier Button confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 360); confirmButton.Text = "Modifier"; confirmButton.Click += (sender, eventArgs) => {db.updateUser(rank.Text, login.Text, new_password.Text , user_id);}; confirmButton.Click += new EventHandler(displayUsers); modifyUserPanel.Controls.Add(confirmButton); // bouton Annuler Button backButton = new Button(); backButton.Size = new Size(100, 30); backButton.Location = new Point(310, 360); backButton.Text = "Annuler"; backButton.Click += new EventHandler(displayUsers); modifyUserPanel.Controls.Add(backButton); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); client = db.detailsClient(code); // suppression de tout les objets du panel detailsClientPanel.Controls.Clear(); // titre title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Détails client"; detailsClientPanel.Controls.Add(title); // nom name = new Label(); name.Size = new Size(100, 30); name.Location = new Point(230, 100); name.Text = client.Split(':')[1]; detailsClientPanel.Controls.Add(name); // prénom firstName = new Label(); firstName.Size = new Size(100, 30); firstName.Location = new Point(230, 130); firstName.Text = client.Split(':')[2]; detailsClientPanel.Controls.Add(firstName); // city city = new Label(); city.Size = new Size(100, 30); city.Location = new Point(230, 160); city.Text = client.Split(':')[3]; detailsClientPanel.Controls.Add(city); // adresse adress = new Label(); adress.Size = new Size(200, 30); adress.Location = new Point(230, 190); adress.Text = client.Split(':')[4]; detailsClientPanel.Controls.Add(adress); // mail mail = new Label(); mail.Size = new Size(200, 30); mail.Location = new Point(230, 220); mail.Text = client.Split(':')[5]; detailsClientPanel.Controls.Add(mail); // bouton retour backButton = new Button(); backButton.Size = new Size(100, 30); backButton.Location = new Point(150, 310); backButton.Text = "Retour"; detailsClientPanel.Controls.Add(backButton); backButton.Click += new EventHandler(back_Click); // bouton modifier modifyButton = new Button(); modifyButton.Size = new Size(100, 30); modifyButton.Location = new Point(275, 310); modifyButton.Text = "Modifier"; detailsClientPanel.Controls.Add(modifyButton); modifyButton.Click += new EventHandler(modify_Click); // bouton afficher rendez-vous displayAppointmentButton = new Button(); displayAppointmentButton.Size = new Size(100, 30); displayAppointmentButton.Location = new Point(400, 310); displayAppointmentButton.Text = "Afficher rendez-vous"; detailsClientPanel.Controls.Add(displayAppointmentButton); displayAppointmentButton.Click += new EventHandler(displayAppointment_Click); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel animalDetailsPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Détails animal"; animalDetailsPanel.Controls.Add(title); int y = 100; // ordonnee labels String details = db.displayAnimalDetails(animal_id); // nom Label name = new Label(); name.Size = new Size(100, 30); name.Location = new Point(230, y); name.Text = "Nom : " + details.Split(':')[0]; animalDetailsPanel.Controls.Add(name); y += 30; // poids Label weight = new Label(); weight.Size = new Size(100, 30); weight.Location = new Point(230, y); weight.Text = "Poids : " + details.Split(':')[1]; animalDetailsPanel.Controls.Add(weight); y += 30; // date de naissance Label date = new Label(); date.Size = new Size(200, 30); date.Location = new Point(230, y); date.Text = "Date de naissance : " + details.Split(':')[2]; animalDetailsPanel.Controls.Add(date); y += 30; // proprietaire Label owner = new Label(); owner.Size = new Size(300, 30); owner.Location = new Point(230, y); owner.Text = "Propriétaire : " + details.Split(':')[3] + " " + details.Split(':')[4]; animalDetailsPanel.Controls.Add(owner); y += 30; // espece Label specy = new Label(); specy.Size = new Size(100, 30); specy.Location = new Point(230, y); specy.Text = "Espece : " + details.Split(':')[5]; animalDetailsPanel.Controls.Add(specy); y += 30; // race Label breed = new Label(); breed.Size = new Size(100, 30); breed.Location = new Point(230, y); breed.Text = "Race : " + details.Split(':')[6]; animalDetailsPanel.Controls.Add(breed); // bouton proprietaire Button ownerButton = new Button(); ownerButton.Size = new Size(100, 30); ownerButton.Location = new Point(310, 310); ownerButton.Text = "Propriétaire"; owner_id = Int32.Parse(details.Split(':')[7]); ownerButton.Click += (sender, eventArgs) => displayOwner(sender, eventArgs, owner_id); animalDetailsPanel.Controls.Add(ownerButton); // bouton soins Button careButton = new Button(); careButton.Size = new Size(100, 30); careButton.Location = new Point(425, 310); careButton.Text = "Soins"; animalDetailsPanel.Controls.Add(careButton); // bouton retour Button backButton = new Button(); backButton.Size = new Size(100, 30); backButton.Location = new Point(150, 310); backButton.Text = "Retour"; backButton.Click += new EventHandler(displayAnimals); animalDetailsPanel.Controls.Add(backButton); }
public void Init() { db = new DataBase.DataBaseManagement("VetoPTArentir"); // suppression de tout les objets du panel addAnimalPanel.Controls.Clear(); // titre Label title = new Label(); title.Size = new Size(500, 30); title.Font = new Font("Arial", 20); title.Location = new Point(170, 20); title.Text = "Ajouter un animal"; addAnimalPanel.Controls.Add(title); // nom TextBox name = new TextBox(); name.Size = new Size(100, 30); name.Location = new Point(230, 100); name.Text = "Nom"; addAnimalPanel.Controls.Add(name); // poids TextBox weight = new TextBox(); weight.Size = new Size(100, 30); weight.Location = new Point(230, 130); weight.Text = "Poids (en kg)"; addAnimalPanel.Controls.Add(weight); // proprietaire owner = new ComboBox(); owner.Size = new Size(100, 30); owner.Location = new Point(230, 160); owner.Text = "Propriétaire "; people = db.getPeople(); foreach (string p in people) { owner.Items.Add(p.Split(':')[1] + " " + p.Split(':')[2]); } owner.SelectedIndexChanged += new EventHandler(ownerChange); addAnimalPanel.Controls.Add(owner); // date de naissance DateTimePicker date = new DateTimePicker(); date.Format = DateTimePickerFormat.Short; date.Size = new Size(100, 30); date.Location = new Point(230, 190); addAnimalPanel.Controls.Add(date); // espece specy = new ComboBox(); specy.Size = new Size(100, 30); specy.Location = new Point(230, 220); specy.Text = "Espece"; species = db.getSpecies(); foreach (string s in species) { specy.Items.Add(s.Split(':')[1]); } specy.SelectedIndexChanged += new EventHandler(specyChange); addAnimalPanel.Controls.Add(specy); // race breed = new ComboBox(); breed.Size = new Size(100, 30); breed.Location = new Point(230, 250); breed.Text = "Race"; breed.SelectedIndexChanged += new EventHandler(breedChange); addAnimalPanel.Controls.Add(breed); // bouton confirmer Button confirmButton = new Button(); confirmButton.Size = new Size(100, 30); confirmButton.Location = new Point(150, 310); confirmButton.Text = "Confirmer"; confirmButton.Click += (sender, eventArgs) => { db.InsertAnimal(name.Text, weight.Text + " kg", date.Text, person_id, breed_id); }; confirmButton.Click += new EventHandler(displayAnimals); addAnimalPanel.Controls.Add(confirmButton); // bouton annuler Button cancelButton = new Button(); cancelButton.Size = new Size(100, 30); cancelButton.Location = new Point(310, 310); cancelButton.Text = "Annuler"; cancelButton.Click += new EventHandler(homePage); addAnimalPanel.Controls.Add(cancelButton); }