/// <summary>
 /// Create a new EventoElementi object.
 /// </summary>
 /// <param name="cdEvento">Initial value of the CdEvento property.</param>
 /// <param name="progressivoElemento">Initial value of the ProgressivoElemento property.</param>
 public static EventoElementi CreateEventoElementi(global::System.Int64 cdEvento, global::System.Int64 progressivoElemento)
 {
     EventoElementi eventoElementi = new EventoElementi();
     eventoElementi.CdEvento = cdEvento;
     eventoElementi.ProgressivoElemento = progressivoElemento;
     return eventoElementi;
 }
Example #2
0
 public bool UpdateElementsCopiesToPrint(long cdEvento, long progressivo, int copie)
 {
     bool res = false;
     try
     {
         var itemsToPrint = from stampe in context.EventoElementis
                            where stampe.CdEvento == cdEvento
                            && stampe.ProgressivoElemento == progressivo
                            select stampe;
         if (copie > 0)
         {
             if (itemsToPrint.Count() == 0)
             {
                 EventoElementi newElementToPrint = new EventoElementi();
                 newElementToPrint.CdEvento = cdEvento;
                 newElementToPrint.ProgressivoElemento = progressivo;
                 newElementToPrint.NumeroCopie = copie;
                 context.EventoElementis.AddObject(newElementToPrint);
             }
             else
             {
                 var myElement = itemsToPrint.First();
                 myElement.NumeroCopie = copie;
             }
         }
         else
         {
             if (itemsToPrint.Count() > 0)
             {
                 var myElement = itemsToPrint.First();
                 context.EventoElementis.DeleteObject(myElement);
             }
         }
         res = true;
     }
     catch
     {
         res = false;
     }
     return res;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the EventoElementis EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEventoElementis(EventoElementi eventoElementi)
 {
     base.AddObject("EventoElementis", eventoElementi);
 }