示例#1
0
 public void updateMagazine()
 {
     try
     {
         using (var ctx = new DBLinqDataContext())
         {
             var temp = ctx.Magazines.Where(p => p.IdMagazine == this.IdMagazine).SingleOrDefault();
             temp.Nome               = this.Nome;
             temp.NumeroCopieRese    = this.NumeroCopieRese;
             temp.NumeroCopieVendute = this.NumeroCopieVendute;
             ctx.SubmitChanges();
         }
     }
     catch { }
 }
示例#2
0
        public static List <ViewHistory> GetHistoryBetweenDates(DateTime dtStart, DateTime dtEnd,
                                                                int amountOfRecordsToTake, int amountOfRecordsToSkip)
        {
            List <ViewHistory> result = null;

            if (dtStart != null && dtEnd != null && amountOfRecordsToSkip >= 0 && amountOfRecordsToTake >= 0)
            {
                using (var ctx = new DBLinqDataContext())
                {
                    result = ctx.ViewHistories.Where(p => p.Data.Date <= dtEnd.Date &&
                                                     p.Data.Date >= dtStart.Date)
                             .Skip(amountOfRecordsToSkip).Take(amountOfRecordsToTake).ToList();
                }
            }

            return(result);
        }
示例#3
0
        public void createPeriodico()
        {
            try
            {
                using (DBLinqDataContext ctx = new DBLinqDataContext())
                {
                    var temp = new Periodico()
                    {
                        Nome = this.Nome,
                    };

                    ctx.Periodicos.InsertOnSubmit(temp);
                    ctx.SubmitChanges();
                    this.IdPeriodico = temp.IdPeriodico;
                }
            }
            catch { }
        }