Ejemplo n.º 1
0
        public static void removeClient(int id, DB_ENTITIES _db)
        {
            Clients selectedClient = _db.Clients.Find(id);
            var     rdv            = _db.RendezVous;

            foreach (RendezVous myRdv in rdv)
            {
                if (myRdv.Clients_idClients == selectedClient.idClients)
                {
                    Utils.removeRdv(myRdv.idRendezVous, _db);
                }
            }
            var animals = _db.Animaux;

            foreach (Animaux animal in animals)
            {
                if (animal.Clients_idClients == selectedClient.idClients)
                {
                    Utils.removeAnimal(animal.idAnimaux, _db);
                }
            }
            var ordonnances = _db.Ordonnance;

            foreach (Ordonnance ordonnance in ordonnances)
            {
                if (ordonnance.Clients_idClients == selectedClient.idClients)
                {
                    Utils.removeOrdonnance(ordonnance.idOrdonnance, _db);
                }
            }
            _db.Clients.Remove(selectedClient);
            _db.SaveChanges();
        }
Ejemplo n.º 2
0
        public static void removeAnimal(int id, DB_ENTITIES _db)
        {
            Animaux myAnimal = _db.Animaux.Find(id);
            var     rappels  = _db.Rappel;

            foreach (Rappel rappel in rappels)
            {
                if (rappel.Animaux_idAnimaux == myAnimal.idAnimaux)
                {
                    Utils.removeRappel(rappel.idRappel, _db);
                }
            }
            var ordonnances = _db.Ordonnance;

            foreach (Ordonnance ordonnance in ordonnances)
            {
                if (ordonnance.Animaux_idAnimaux == myAnimal.idAnimaux)
                {
                    Utils.removeOrdonnance(ordonnance.idOrdonnance, _db);
                }
            }
            myAnimal.Soins = null;
            myAnimal.Race  = null;
            _db.Animaux.Remove(myAnimal);
            _db.SaveChanges();
        }
Ejemplo n.º 3
0
 public RendezVousForm()
 {
     _db = new DB_ENTITIES();
     InitializeComponent();
     populateClientList();
     displayRdv(datePicker.Value);
 }
Ejemplo n.º 4
0
 public Planning()
 {
     InitializeComponent();
     _db = new DB_ENTITIES();
     SetupDataGrid();
     PopulateDataGrid(datePicker.Value);
 }
Ejemplo n.º 5
0
 public Rappels_Form(Animaux animal)
 {
     _db = new DB_ENTITIES();
     InitializeComponent();
     datePicker.MinDate = DateTime.Now;
     this.animal        = animal;
 }
Ejemplo n.º 6
0
 public Authentication()
 {
     InitializeComponent();
     time = new Timer();
     startTime();
     _db = new DB_ENTITIES();
 }
Ejemplo n.º 7
0
 public ProduitsSheet(Produits p)
 {
     InitializeComponent();
     this.p   = p;
     this._db = new DB_ENTITIES();
     intialiseText();
 }
Ejemplo n.º 8
0
 public ClientSheet(Clients client)
 {
     _db = new DB_ENTITIES();
     InitializeComponent();
     this.client = client;
     allAnimalsClient.FullRowSelect = true;
     InitializeIntels();
 }
Ejemplo n.º 9
0
 public ClientList()
 {
     _db = new DB_ENTITIES();
     InitializeComponent();
     allClientList.FullRowSelect = true;
     searchName   = "";
     selectedLine = "";
     InitializeClientList("");
 }
Ejemplo n.º 10
0
 public Maladies_Form(Animaux animal)
 {
     InitializeComponent();
     this.animal             = animal;
     dateTimePicker1.MaxDate = DateTime.Now;
     _db  = new DB_ENTITIES();
     date = DateTime.Now;
     completeMaladie();
     animal = _db.Animaux.Find(1);
 }
Ejemplo n.º 11
0
 public RendezVousSelector(List <RendezVous> rendezVous)
 {
     rdvs = rendezVous;
     _db  = new DB_ENTITIES();
     InitializeComponent();
     foreach (RendezVous rdv in rendezVous)
     {
         listRdv.Items.Add(rdv.Date.ToShortTimeString() + "  " + rdv.Clients.Prenom + " " + rdv.Clients.Nom);
     }
 }
Ejemplo n.º 12
0
 public RendezVousForm(RendezVous rendezVous)
 {
     _db = new DB_ENTITIES();
     InitializeComponent();
     populateClientList();
     if (rendezVous != null)
     {
         setRdvValues(rendezVous);
     }
     displayRdv(datePicker.Value);
 }
Ejemplo n.º 13
0
 public FicheAnimalInterface(Animaux animal)
 {
     _db = new DB_ENTITIES();
     InitializeComponent();
     this.animal = animal;
     InitializeIntels();
     listOfDiseases.FullRowSelect = true;
     listReminders.FullRowSelect  = true;
     completeMaladieList();
     completeRemindersList();
 }
Ejemplo n.º 14
0
        public static void removeSoin(int id, DB_ENTITIES _db)
        {
            var factures = _db.Factures;

            foreach (Factures facture in factures)
            {
                Utils.removefacture(facture.idFactures, _db);
            }
            _db.Soins.Remove(_db.Soins.Find(id));
            _db.SaveChanges();
        }
Ejemplo n.º 15
0
 public NewProduct(Stock s, DB_ENTITIES _db, Produits p)
 {
     InitializeComponent();
     this.s   = s;
     this._db = _db;
     this.p   = p;
     if (p != null)
     {
         fillInfos();
         this.qtt.Hide();
         this.label3.Hide();
     }
 }
Ejemplo n.º 16
0
 public AnimauxInterface()
 {
     _db = new DB_ENTITIES();
     InitializeComponent();
     searchName               = "";
     searchEspece             = "";
     searchRace               = "";
     searchNameProprietaire   = "";
     selectedLine             = "";
     this.allAnimauxList.View = View.List;
     animaux = new List <string>();
     InitializeAnimauxInterface("");
     init();
 }
Ejemplo n.º 17
0
 public Globalinterface(String id)
 {
     InitializeComponent();
     _db     = new DB_ENTITIES();
     time    = new Timer();
     this.id = id;
     startTime();
     this.logsListView.View              = View.List;
     this.rappelListView.View            = View.List;
     this.todaysAppointmentListView.View = View.List;
     fillLog();
     fillRecall();
     fillTodaysApp();
 }
Ejemplo n.º 18
0
 public ProductSell(Produits produit, Stock stock)
 {
     InitializeComponent();
     this.produit     = produit;
     this.label1.Text = "0";
     this.quantité    = int.Parse(this.label1.Text);
     _db = new DB_ENTITIES();
     findStock();
     fillList();
     this.pro.Text         = produit.Nom;
     this.client.Text      = "";
     this.s                = stock;
     this.textBox1.Enabled = false;
 }
Ejemplo n.º 19
0
 public RendezVousForm(Clients client)
 {
     _db = new DB_ENTITIES();
     InitializeComponent();
     populateClientList();
     for (int i = 0; i < clientList.Items.Count; i++)
     {
         var c = clientList.Items[i];
         if (int.Parse(((String)c).Substring(0, ((String)c).IndexOf('.'))) == client.idClients)
         {
             clientList.SelectedItem = client;
         }
     }
     displayRdv(datePicker.Value);
 }
Ejemplo n.º 20
0
        public Stock()
        {
            InitializeComponent();
            products            = new List <string>();
            this.listView1.View = View.List;
            _db = new DB_ENTITIES();
            initialiseProduits("");
            //Position
            Point p = new Point(110, 145);

            this.Location        = p;
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;
        }
Ejemplo n.º 21
0
        public static void removeRdv(int id, DB_ENTITIES _db)
        {
            RendezVous myRdv    = _db.RendezVous.Find(id);
            var        factures = _db.Factures;

            foreach (Factures facture in factures)
            {
                if (facture.RendezVousId == myRdv.idRendezVous)
                {
                    Utils.removefacture(facture.RendezVousId, _db);
                }
            }
            _db.RendezVous.Remove(_db.RendezVous.Find(id));
            _db.SaveChanges();
        }
Ejemplo n.º 22
0
 public Prescription(int idClient, int idAnimal)
 {
     idClientSelected = idClient;
     idAnimalSelected = idAnimal;
     _db = new DB_ENTITIES();
     InitializeComponent();
     InitializeClientList("");
     InitializeProduct();
     if (idAnimal != 0 && idClient != 0)
     {
         secondPagePanel.Visible = true;
     }
     listClient.FullRowSelect    = true;
     ClientsAnimal.FullRowSelect = true;
 }
Ejemplo n.º 23
0
 public ClientForm(Clients clientSelected, DB_ENTITIES _db, ClientList clientList)
 {
     InitializeComponent();
     isModification              = false;
     this.clientList             = clientList;
     client                      = clientSelected;
     this._db                    = _db;
     isMan                       = true;
     naissanceDatePicker.MaxDate = DateTime.Now;
     SelectedDate                = DateTime.Now;
     if (client != null)
     {
         initializeInput();
         isModification = true;
     }
 }
Ejemplo n.º 24
0
 public InscriptionAnimalInterface(Animaux animalSelected, AnimauxInterface animalInterface, Clients client)
 {
     InitializeComponent();
     isModification          = false;
     this.client             = client;
     dateTimePicker1.MaxDate = DateTime.Now;
     this.animalList         = animalInterface;
     animal   = animalSelected;
     this._db = new DB_ENTITIES();
     isMan    = true;
     dateNais = DateTime.Now;
     idAnimal = 0;
     if (animal != null)
     {
         idAnimal = animal.idAnimaux;
         initializeInput();
         isModification = true;
     }
     init();
 }
Ejemplo n.º 25
0
 public static void removeOrdonnance(int id, DB_ENTITIES _db)
 {
     _db.Ordonnance.Remove(_db.Ordonnance.Find(id));
     _db.SaveChanges();
 }
Ejemplo n.º 26
0
 public static void removeRappel(int id, DB_ENTITIES _db)
 {
     _db.Rappel.Remove(_db.Rappel.Find(id));
     _db.SaveChanges();
 }
Ejemplo n.º 27
0
 private static void removefacture(int idFactures, DB_ENTITIES _db)
 {
     _db.Factures.Remove(_db.Factures.Find(idFactures));
     _db.SaveChanges();
 }