/// <summary>
 /// Create a new MissioneHacking object.
 /// </summary>
 /// <param name="numeroMissione">Initial value of the NumeroMissione property.</param>
 /// <param name="numeroPG">Initial value of the NumeroPG property.</param>
 /// <param name="numeroTentativo">Initial value of the NumeroTentativo property.</param>
 /// <param name="riuscito">Initial value of the Riuscito property.</param>
 /// <param name="dataTentativo">Initial value of the DataTentativo property.</param>
 public static MissioneHacking CreateMissioneHacking(global::System.Int64 numeroMissione, global::System.Int64 numeroPG, global::System.Int64 numeroTentativo, global::System.Int64 riuscito, global::System.DateTime dataTentativo)
 {
     MissioneHacking missioneHacking = new MissioneHacking();
     missioneHacking.NumeroMissione = numeroMissione;
     missioneHacking.NumeroPG = numeroPG;
     missioneHacking.NumeroTentativo = numeroTentativo;
     missioneHacking.Riuscito = riuscito;
     missioneHacking.DataTentativo = dataTentativo;
     return missioneHacking;
 }
Exemple #2
0
        public static void RegistraHackingMissione(long numeroMissione, long hacker, bool successo)
        {
            using (HolonetEntities context = new HolonetEntities())
            {
                var ultimoProgressivo = (from trials in context.MissioneHackings
                                         select trials.Progressivo).Max();

                MissioneHacking tentativoDaRegistrare = new MissioneHacking();
                tentativoDaRegistrare.Progressivo = ultimoProgressivo + 1;
                tentativoDaRegistrare.NumeroPG = hacker;
                tentativoDaRegistrare.NumeroMissione = numeroMissione;
                tentativoDaRegistrare.Riuscito = successo ? 1 : 0;
                tentativoDaRegistrare.DataTentativo = DateTime.Now;

                context.AddToMissioneHackings(tentativoDaRegistrare);
                context.SaveChanges();
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the MissioneHackings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMissioneHackings(MissioneHacking missioneHacking)
 {
     base.AddObject("MissioneHackings", missioneHacking);
 }