private string GenererNomBinding(Critere c) { string critere = ""; switch (c.Titre) { case "Quantité": critere = "Quantite"; break; case "Prix": critere = "Produit.Prix"; break; case "Nom produit": critere = "Produit.Nom"; break; case "Description": critere = "Produit.Description"; break; case "": critere = ""; break; default: critere = ""; break; } return(critere); }
public async Task <IActionResult> Post([FromBody] Critere critere1) { _context.Criteres.Add(critere1); await _context.SaveChangesAsync(); return(Ok()); }
private string ConstruireNomDuFichier(Localité localité, Periode periode, Critere critere, DateTime date, string magasin) { return new StringBuilder() .Append(critere == Critere.ChiffreAffaire ? "top_100_ca_" : "top_100_ventes_") .Append(localité == Localité.Globale ? "GLOBAL" : magasin) .Append("_") .Append(date.ToString("yyyyMMdd")) .Append(periode == Periode.Jour ? "" : "-J" + (int) periode) .Append(".data") .ToString(); }
public async Task <IActionResult> Put(int id, [FromBody] Critere critere1) { var dbCritere1 = _context.Criteres.FirstOrDefault(x => x.Id == id); /* dbCritere1.Bareme = critere1.Bareme; * dbCritere1.C1 = critere1.C1; * dbCritere1.C2 = critere1.C2; * dbCritere1.C3 = critere1.C3; * dbCritere1.C4 = critere1.C4;*/ _context.Criteres.Update(dbCritere1); await _context.SaveChangesAsync(); return(Ok()); }