コード例 #1
0
 /// <summary>
 /// Create a new EventoHolodischi object.
 /// </summary>
 /// <param name="cdEvento">Initial value of the CdEvento property.</param>
 /// <param name="progressivoDisco">Initial value of the ProgressivoDisco property.</param>
 public static EventoHolodischi CreateEventoHolodischi(global::System.Int64 cdEvento, global::System.Int64 progressivoDisco)
 {
     EventoHolodischi eventoHolodischi = new EventoHolodischi();
     eventoHolodischi.CdEvento = cdEvento;
     eventoHolodischi.ProgressivoDisco = progressivoDisco;
     return eventoHolodischi;
 }
コード例 #2
0
ファイル: EventiManagerNew.cs プロジェクト: LoZeno/Holonet3
        public bool UpdateHolodiskCopiesToPrint(long cdEvento, long progressivo, int copie)
        {
            bool res = false;
            try
            {
                var diskToPrint = from stampe in context.EventoHolodischis
                                  where stampe.CdEvento == cdEvento
                                  && stampe.ProgressivoDisco == progressivo
                                  select stampe;
                if (copie > 0)
                {
                    if (diskToPrint.Count() == 0)
                    {
                        EventoHolodischi newDiskToPrint = new EventoHolodischi();
                        newDiskToPrint.CdEvento = cdEvento;
                        newDiskToPrint.ProgressivoDisco = progressivo;
                        newDiskToPrint.NumeroCopie = copie;
                        context.EventoHolodischis.AddObject(newDiskToPrint);
                    }
                    else
                    {
                        var myDisk = diskToPrint.First();
                        myDisk.NumeroCopie = copie;
                    }
                }
                else
                {
                    if (diskToPrint.Count() > 0)
                    {
                        var myDisk = diskToPrint.First();
                        context.EventoHolodischis.DeleteObject(myDisk);
                    }
                }
                res = true;
            }
            catch
            {
                res = false;
            }

            return res;
        }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EventoHolodischis EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEventoHolodischis(EventoHolodischi eventoHolodischi)
 {
     base.AddObject("EventoHolodischis", eventoHolodischi);
 }