Esempio n. 1
0
 public void AddNewContact(long numeroPg, long contatto, string nome)
 {
     DataAccessLayer.Rubrica elemento = new DataAccessLayer.Rubrica();
     elemento.NumeroPG = numeroPg;
     elemento.NumeroSalvato = contatto;
     elemento.NomeVisualizzato = nome;
     context.AddToRubricas(elemento);
 }
Esempio n. 2
0
 public void AddNewContact(long numeroPg, long contatto, string nome)
 {
     DataAccessLayer.Rubrica elemento = new DataAccessLayer.Rubrica();
     elemento.NumeroPG         = numeroPg;
     elemento.NumeroSalvato    = contatto;
     elemento.NomeVisualizzato = nome;
     context.AddToRubricas(elemento);
 }
Esempio n. 3
0
 public void DeleteContact(long numeroPg, long contatto)
 {
     DataAccessLayer.Rubrica toDelete = (from names in context.Rubricas
                                         where names.NumeroPG == numeroPg &&
                                         names.NumeroSalvato == contatto
                                         select names).FirstOrDefault();
     if (toDelete != null)
     {
         context.Rubricas.DeleteObject(toDelete);
     }
 }
Esempio n. 4
0
 protected void btnSalva_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(txtNumero.Text) && !string.IsNullOrWhiteSpace(txtNome.Text))
     {
         Personaggio currentCharacter = (Personaggio)Session["Personaggio"];
         using (HolonetEntities context = new HolonetEntities())
         {
             DataAccessLayer.Rubrica elemento = new DataAccessLayer.Rubrica();
             elemento.NumeroPG = currentCharacter.NumeroPG;
             elemento.NumeroSalvato = long.Parse(txtNumero.Text.Trim());
             elemento.NomeVisualizzato = txtNome.Text.Trim();
             context.AddToRubricas(elemento);
             context.SaveChanges();
         }
     }
     carica();
 }
Esempio n. 5
0
 protected void btnSalva_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(txtNumero.Text) && !string.IsNullOrWhiteSpace(txtNome.Text))
     {
         Personaggio currentCharacter = (Personaggio)Session["Personaggio"];
         using (HolonetEntities context = new HolonetEntities())
         {
             DataAccessLayer.Rubrica elemento = new DataAccessLayer.Rubrica();
             elemento.NumeroPG         = currentCharacter.NumeroPG;
             elemento.NumeroSalvato    = long.Parse(txtNumero.Text.Trim());
             elemento.NomeVisualizzato = txtNome.Text.Trim();
             context.AddToRubricas(elemento);
             context.SaveChanges();
         }
     }
     carica();
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Rubricas EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRubricas(Rubrica rubrica)
 {
     base.AddObject("Rubricas", rubrica);
 }
 /// <summary>
 /// Create a new Rubrica object.
 /// </summary>
 /// <param name="numeroPG">Initial value of the NumeroPG property.</param>
 /// <param name="numeroSalvato">Initial value of the NumeroSalvato property.</param>
 public static Rubrica CreateRubrica(global::System.Int64 numeroPG, global::System.Int64 numeroSalvato)
 {
     Rubrica rubrica = new Rubrica();
     rubrica.NumeroPG = numeroPG;
     rubrica.NumeroSalvato = numeroSalvato;
     return rubrica;
 }