public string But(string match, string mitemps, string temps) { string result = ""; try { CtrlAction ca = new CtrlAction(connexion); PartieDetailsDAO pddao = new PartieDetailsDAO(connexion); PartieDetails detail = pddao.Select("WHERE partie='" + match + "' AND mitemps=" + mitemps + " AND action='" + ca.TirCadre + "' ORDER BY temps DESC").First(); result = Create(match, mitemps, temps, detail.Equipe.Nom, detail.Details.Id, ca.But, ""); } catch (Exception ex) { throw ex; } return(result); }
public string SetTempsPossession(string match, string mitemps, string equipe, string joueur, string duree) { string result = ""; try { PartieDAO ptdao = new PartieDAO(connexion); EquipeDAO eqdao = new EquipeDAO(connexion); EquipeDetailsDAO eddao = new EquipeDetailsDAO(connexion); PartieDetailsDAO pddao = new PartieDetailsDAO(connexion); Partie pt = ptdao.Select("WHERE id='" + match + "'").First(); Equipe eq = eqdao.Select("WHERE nom='" + equipe + "'").First(); EquipeDetails detail = eddao.Select("WHERE id='" + joueur + "'").First(); result = pddao.InsertPossession("'" + pt + "', " + mitemps + ", '" + eq + "', '" + detail + "', '" + duree + "'"); } catch (Exception ex) { throw ex; } return(result); }
public List <string[]> Read(string equipe, string adversaire, string datePartie, string mitemps, string nom, string prenom) { List <string[]> results = new List <string[]>(); try { EquipeStatDAO eqsdao = new EquipeStatDAO(connexion); PartieDetailsDAO pddao = new PartieDetailsDAO(connexion); EquipeStat stats = null; string[] query = GenerateQuery(equipe, adversaire, datePartie, mitemps, nom, prenom); stats = eqsdao.Select(query[0]); float poss = pddao.Possession(query[1], query[2]); string[] str_poss = { "possession", poss + " %" }; results.AddRange(stats.GetAll()); results.Add(str_poss); } catch (Exception ex) { throw ex; //System.Windows.Forms.MessageBox.Show(ex.Message + ":\n" + ex.StackTrace); } return(results); }
private string Create(string match, string mitemps, string temps, string equipe, string joueur, string action, string remarque) { string result = ""; try { PartieDAO ptdao = new PartieDAO(connexion); EquipeDAO eqdao = new EquipeDAO(connexion); EquipeDetailsDAO eddao = new EquipeDetailsDAO(connexion); ActionDAO acdao = new ActionDAO(connexion); PartieDetailsDAO pddao = new PartieDetailsDAO(connexion); Partie pt = ptdao.Select("WHERE id='" + match + "'").First(); Equipe eq = eqdao.Select("WHERE nom='" + equipe + "'").First(); EquipeDetails detail = eddao.Select("WHERE id='" + joueur + "'").First(); Model.Action act = acdao.Select("WHERE id='" + action + "'").First(); PartieDetails pd = new PartieDetails(pt, int.Parse(mitemps), Convert.ToDateTime(temps), eq, detail, act, remarque); result = pddao.Insert(pd.ToInsert()); } catch (Exception ex) { throw ex; //System.Windows.Forms.MessageBox.Show(ex.StackTrace); } return(result); }