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 { } }
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); }
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 { } }