Esempio n. 1
0
 public void Dodaj(Fiche fiche)
 {
     using (Conector.Fiche ficheConector = new Conector.Fiche())
     {
         ficheConector.SendFiche(fiche);
     }
 }
Esempio n. 2
0
        public IActionResult Put(Guid id, [FromBody] Fiche fiche)
        {
            var result = _Db.FicheEntrees.Where(f => f.Id == id).FirstOrDefault();

            if (result == null || fiche.Id != id)
            {
                return(NotFound(string.Format("Fiche avec l'identifiant {0} est non trouvée", id)));
            }
            else
            {
                try {
                    _Db.Update(fiche);
                    if (_Db.SaveChanges() != 0)
                    {
                        return(Ok(fiche));
                    }
                    else
                    {
                        return(Ok(string.Format("Aucune opération n'est effectuée!")));
                    }
                } catch (Exception ex) {
                    return(BadRequest(string.Format("Echec de la modification de la fiche! : {0}", ex.ToString())));
                }
            }
        }
Esempio n. 3
0
        public UC_fiche_day(Fiche newFiche)
        {
            InitializeComponent();
            idFiche = newFiche.id;
            ModifyId(newFiche.id);
            ModifyName(newFiche.name);
            ModifyDateLiv(newFiche.dateLivraison);
            ModifyDateFab(newFiche.dateDebutFabrication);
            ModifyTimeFab(newFiche.tempsFabrication);
            ModifyHourFab(newFiche.dateDebutFabrication);
            ModifyQty(newFiche.quantiteElement);
            ModifyMachine(newFiche.machine);
            if (newFiche.alerteRetard == true)
            {
                DisplayAlerte();
            }
            else
            {
                HideAlerte();
            }
            if (newFiche.attentionRetard == true)
            {
                DisplayWarning();
            }
            else
            {
                HideWarning();
            }
            switch (newFiche.typeOperation)
            {
            case TypeOperation.na:
                colorLeft_op = Values.COLOR_NA;
                break;

            case TypeOperation.fabrication:
                colorLeft_op = Values.COLOR_FAB;
                break;

            case TypeOperation.aiguisage:
                colorLeft_op = Values.COLOR_AFF;
                break;

            default:
                colorLeft_op = Values.COLOR_NA;
                break;
            }
            rectangleLeft_op.Fill = new SolidColorBrush(colorLeft_op);

            if (newFiche.recouvrement != null)
            {
                colorRight_rec = newFiche.recouvrement.color;
            }
            else
            {
                colorRight_rec = Colors.White;
            }

            rectangleRight_rec.Fill = new SolidColorBrush(colorRight_rec);
        }
Esempio n. 4
0
        public void ModifyDataFiche(Fiche fiche, List <TypeColor> listeColors)
        {
            idFiche                = fiche.id;
            textId.Text            = "ID : " + fiche.id;
            textDateLivraison.Text = "Date livraison : " + fiche.dateLivraison.Day + "/" + fiche.dateLivraison.Month + "/" + fiche.dateLivraison.Year;
            textName.Text          = "Nom :" + fiche.name;

            switch (fiche.typeOperation)
            {
            case TypeOperation.fabrication:
                radioButtonOpFabrication.IsChecked = true;
                break;

            case TypeOperation.aiguisage:
                RadioButtonOpAffutage.IsChecked = true;
                break;

            case TypeOperation.na:
                RadioButtonOpNA.IsChecked = true;
                break;

            default:
                RadioButtonOpNA.IsChecked = true;
                break;
            }

            foreach (TypeColor color in listeColors)
            {
                comboBoxRevetement.Items.Add(color.name);
            }
            try
            {
                comboBoxRevetement.SelectedItem = fiche.recouvrement.name;
            }
            catch
            {
            }

            textBoxDateLivraison.Text    = fiche.dateLivraison.Day + "/" + fiche.dateLivraison.Month + "/" + fiche.dateLivraison.Year;
            textBoxDateFabrication.Text  = fiche.dateDebutFabrication.Day + "/" + fiche.dateDebutFabrication.Month + "/" + fiche.dateDebutFabrication.Year;
            textBoxHeureFabrication.Text = fiche.dateDebutFabrication.Hour + ":" + fiche.dateDebutFabrication.Minute;
            textBoxTempsFabrication.Text = "" + fiche.tempsFabrication;
            TextBoxNumMachine.Text       = "" + fiche.machine;
            TextBoxQty.Text       = "" + fiche.quantiteElement;
            textBoxTextFiche.Text = fiche.textDescription;

            //TODO modif radio button
            //int id, int qty, DateTime dateLivraison, DateTime date
            imageAttention_dateLiv.Visibility  = Visibility.Collapsed;
            imageAttention_dateFab.Visibility  = Visibility.Collapsed;
            imageAttention_heureFab.Visibility = Visibility.Collapsed;
            imageAttention_TempsFab.Visibility = Visibility.Collapsed;
            imageAttention_NumMach.Visibility  = Visibility.Collapsed;
            imageAttention_QtyEl.Visibility    = Visibility.Collapsed;
            imageAttention_SizeText.Visibility = Visibility.Collapsed;
        }
        public void AddFiche(Fiche newFiche)
        {
            // Convert new products to lookup of product
            foreach (var item in newFiche.LignesProduits)
            {
                item.Produit = _ctx.Produits.Find(item.Produit.Id);
            }

            AddEntity(newFiche);
        }
Esempio n. 6
0
        public async Task <ActionResult <Fiche> > GetById(int id)
        {
            Fiche client = await _ficheService.GetById(id);

            if (client == null)
            {
                return(NotFound("Mawa trop"));
            }

            return(client);
        }
Esempio n. 7
0
        // POST: api/Fiches
        public IHttpActionResult Post([FromBody] Fiche value)
        {
            Fiche newFiche = new Fiche();

            using (DatabaseEntities database = new DatabaseEntities())
            {
                newFiche = database.Fiches.Add(value);
                database.SaveChanges();
            }
            return(Ok(newFiche.ToJson()));
        }
Esempio n. 8
0
 public ActionResult Edytuj(int id)
 {
     DTO.Models.SetFicheDetails setFicheDetails = new DTO.Models.SetFicheDetails();
     using (Fiche fiche = new Fiche())
     {
         setFicheDetails.Fiches = fiche.SearchFiches(id);
     }
     using (SetFiche setFiche = new SetFiche())
     {
         var fiche = setFiche.SearchSetsFiche(UserFiche.CurentUser.Id, id).First();
         setFicheDetails.Name = fiche.Name;
     }
     setFicheDetails.IdSetFiche = id;
     return(View(setFicheDetails));
 }
Esempio n. 9
0
        public static bool Can(this TypeAnswer typeAnswer, Fiche fiche)
        {
            switch (typeAnswer)
            {
            case TypeAnswer.WriteTextUserChose:
            case TypeAnswer.UserChose:
            case TypeAnswer.WriteText:
                return(true);

            case TypeAnswer.ChoseOption:
                return(fiche.FicheResponses.Length > 0);

            case TypeAnswer.Hangman:
                return(fiche.Response.All(X => HangmanGameState.Alphabet.Any(Y => X == Y)));

            default: return(true);
            }
        }
Esempio n. 10
0
 public ActionResult GetFiche()
 {
     if (Game.CurentMultiPlayerGame != null)
     {
         Fiche fiche = null;
         MultiPlayerGameData multiPlayerGameData = null;
         GameState           gameState           = new GameState();
         gameState.IsMultiPlayer = true;
         lock (Game.CurentMultiPlayerGame)
         {
             fiche = Game.CurentMultiPlayerGame.CurrentFiche;
             multiPlayerGameData = Game.CurentMultiPlayerGame.MultiPlayerGameData;
         }
         gameState.Fiche         = fiche;
         gameState.IntTypeAnswer = (int)multiPlayerGameData.TypeAnswer;
         gameState.LimitTimeSek  = multiPlayerGameData.LimitTimeInSek;
         return(multiPlayerGameData.TypeAnswer switch
         {
             DTO.Enums.TypeAnswerMultiGame.WriteText => View($"../Gra/{nameof(GraController.WriteText)}", gameState),
             DTO.Enums.TypeAnswerMultiGame.ChoseOption => View($"../Gra/{nameof(GraController.ChoseOption)}", gameState)
         });
Esempio n. 11
0
        void AffichePropriétés(TreeNode Nod, string mClasse)
        {
            switch (mClasse.ToUpper().Trim())
            {
            case "USER":
            {
                //Recherche la liste des propriétés de la classe
                Utilisateur user = new Utilisateur();
                foreach (string str in user.ListeAttribut)
                {
                    string   libelle = Acces.Trouver_Attribut_Libelle(str);
                    TreeNode nod     = new TreeNode(libelle);
                    nod.Name = Acces.type_UTILISATEUR.Code + "_" + str;
                    Nod.Nodes.Add(nod);
                }
                break;
            }

            case "PORTEUR":
            {
                //Recherche la liste des propriétés de la classe
                Porteur Prt = new Porteur();
                foreach (string str in Prt.ListeAttribut)
                {
                    string   libelle = Acces.Trouver_Attribut_Libelle(str);
                    TreeNode nod     = new TreeNode(libelle);
                    nod.Name = Acces.type_PORTEUR.Code + "_" + str;
                    Nod.Nodes.Add(nod);
                }
                break;
            }

            case "FICHE_COMMANDE":
            {
                //Recherche la liste des propriétés de la classe
                Fiche Fic = new Fiche();
                foreach (string str in Fic.ListeAttribut)
                {
                    string   libelle = Acces.Trouver_Attribut_Libelle(str);
                    TreeNode nod     = new TreeNode(libelle);
                    nod.Name = Acces.type_FICHE.Code + "_" + str;
                    Nod.Nodes.Add(nod);
                }
                break;
            }

            case "LIGNE_COMMANDE":
            {
                //Recherche la liste des propriétés de la classe
                Fiche_Ligne fcl = new Fiche_Ligne();
                foreach (string str in fcl.ListeAttribut)
                {
                    string   libelle = Acces.Trouver_Attribut_Libelle(str);
                    TreeNode nod     = new TreeNode(libelle);
                    nod.Name = Acces.type_LIGNE.Code + "_" + str;
                    Nod.Nodes.Add(nod);
                }
                break;
            }

            case "DECISION":
            {
                /* 'Recherche la liste des propriétés de la classe
                 * Dim cls As New mdl_execution.Decision
                 * For Each P As System.Reflection.PropertyInfo In cls.GetType().GetProperties
                 * Dim Nd As New TreeNode(P.Name)
                 * Nd.Name = "EJ_" & P.Name.ToUpper
                 * Nod.Nodes.Add(Nd)
                 * Next*/
                break;
            }

            case "ECHEANCE":
            {
                /* 'Recherche la liste des propriétés de la classe
                 * Dim cls As New mdl_execution.Echéance
                 * For Each P As System.Reflection.PropertyInfo In cls.GetType().GetProperties
                 * Dim Nd As New TreeNode(P.Name)
                 * Nd.Name = "ECHEANCE_" & P.Name.ToUpper
                 * Nod.Nodes.Add(Nd)
                 * Next*/
                break;
            }

            case "LIQUIDATION":
            {
                /*'Recherche la liste des propriétés de la classe
                 * Dim cls As New mdl_execution.Liquidation
                 * For Each P As System.Reflection.PropertyInfo In cls.GetType().GetProperties
                 * Dim Nd As New TreeNode(P.Name)
                 * Nd.Name = "LIQUIDATION_" & P.Name.ToUpper
                 * Nod.Nodes.Add(Nd)
                 * Next*/
                break;
            }

            case "ORDRE_PAIEMENT":
            {
                /*'Recherche la liste des propriétés de la classe
                 * Dim cls As New mdl_execution.Ordre_Paiement
                 * For Each P As System.Reflection.PropertyInfo In cls.GetType().GetProperties
                 * Dim Nd As New TreeNode(P.Name)
                 * Nd.Name = "ORDRE_PAIEMENT_" & P.Name.ToUpper
                 * Nod.Nodes.Add(Nd)
                 * Next*/
                break;
            }
            }
        }
Esempio n. 12
0
        // Fonction de recherche
        private void search(string nom, string prenom, string lieu, List <Fiche> list)
        {
            progressBar1.Value = 0;
            listView1.Items.Clear();
            resultFiche = new List <Fiche>();
            int count = 0;

            progressBar1.Maximum = listFiche.Count;
            Fiche recherche = new Fiche(nom, prenom, lieu);

            foreach (Fiche f in list)
            {
                progressBar1.Value++;
                bool valid = true;
                if (recherche.Nom != "")
                {
                    if (f.Nom.IndexOf(recherche.Nom, StringComparison.OrdinalIgnoreCase) < 0)
                    {
                        valid = false;
                    }
                }
                if (valid)
                {
                    if (recherche.Prenom != "")
                    {
                        if (f.Prenom.IndexOf(recherche.Prenom, StringComparison.OrdinalIgnoreCase) < 0)
                        {
                            valid = false;
                        }
                    }
                    if (valid)
                    {
                        if (recherche.Lieu != "")
                        {
                            if (f.Lieu.IndexOf(recherche.Lieu, StringComparison.OrdinalIgnoreCase) < 0)
                            {
                                valid = false;
                            }
                        }
                        if (valid)
                        {
                            count++;
                            string[] arr = new string[3];
                            arr[NOM]    = f.Nom;
                            arr[PRENOM] = f.Prenom;
                            arr[LIEU]   = f.Lieu;
                            resultFiche.Add(new Fiche(arr[NOM], arr[PRENOM], arr[LIEU], f.Url));
                            ListViewItem itm = new ListViewItem(arr);
                            listView1.Items.Add(itm);
                        }
                    }
                }
            }
            listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            if (count == 0)
            {
                MessageBox.Show("Il n'y aucun resultat", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                MessageBox.Show("Il y'a " + count + " resultat(s)", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                tabControl1.SelectedIndex = 1;
            }
        }
Esempio n. 13
0
 /// <summary>
 /// Verwijder een fiche vanuit de fichebak.
 /// </summary>
 /// <param name="fiche">De fiche die wordt verwijderen.</param>
 public void Remove(Fiche fiche)
 {
     this.fiches.Remove(fiche);
 }
Esempio n. 14
0
 /// <summary>
 /// Zet een fiche in de fiches bak in.
 /// </summary>
 /// <param name="fiche">De fiche die ingezet wordt.</param>
 public void AddFicheAanFichesBak(Fiche fiche)
 {
     this.fiches.Add(fiche);
 }
Esempio n. 15
0
 public async Task <ActionResult <Fiche> > Update(Fiche client) => await _ficheService.Update(client);
Esempio n. 16
0
 /// <summary>
 /// Add een fiche.
 /// </summary>
 /// <param name="fiche">Een fiche.</param>
 public void Add(Fiche fiche)
 {
     Debug.Assert(fiche != null, "fiche mag niet null zijn");
     this.fiches.Add(fiche);
 }
Esempio n. 17
0
 public Window_Modif_Fiche(Fiche fiche, List <TypeColor> listeColors)
 {
     InitializeComponent();
     ModifyDataFiche(fiche, listeColors);
 }
Esempio n. 18
0
 public ActionResult Prompt(Fiche fiche)
 {
     return(View(fiche));
 }
Esempio n. 19
0
 // Fonction de recherche
 private void search(string nom, string prenom, string lieu, List<Fiche> list)
 {
     progressBar1.Value = 0;
     listView1.Items.Clear();
     resultFiche = new List<Fiche>();
     int count = 0;
     progressBar1.Maximum = listFiche.Count;
     Fiche recherche = new Fiche(nom, prenom, lieu);
     foreach (Fiche f in list)
     {
         progressBar1.Value++;
         bool valid = true;
         if (recherche.Nom != "")
             if (f.Nom.IndexOf(recherche.Nom, StringComparison.OrdinalIgnoreCase) < 0)
                 valid = false;
         if (valid)
         {
             if (recherche.Prenom != "")
                 if (f.Prenom.IndexOf(recherche.Prenom, StringComparison.OrdinalIgnoreCase) < 0)
                     valid = false;
             if (valid)
             {
                 if (recherche.Lieu != "")
                     if (f.Lieu.IndexOf(recherche.Lieu, StringComparison.OrdinalIgnoreCase) < 0)
                         valid = false;
                 if (valid)
                 {
                     count++;
                     string[] arr = new string[3];
                     arr[NOM] = f.Nom;
                     arr[PRENOM] = f.Prenom;
                     arr[LIEU] = f.Lieu;
                     resultFiche.Add(new Fiche(arr[NOM], arr[PRENOM], arr[LIEU], f.Url));
                     ListViewItem itm = new ListViewItem(arr);
                     listView1.Items.Add(itm);
                 }
             }
         }
     }
     listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
     if (count == 0)
     {
         MessageBox.Show("Il n'y aucun resultat", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         MessageBox.Show("Il y'a " + count + " resultat(s)", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         tabControl1.SelectedIndex = 1;
     }
 }