public int NewLogin(Login login) { int rows = 0; using (var ctx = new UckLibMgrDbEntities()) { ctx.Logins.Add(login); rows = ctx.SaveChanges(); } return(rows); }
public int NewBook(Book book) { int rows = 0; using (var ctx = new UckLibMgrDbEntities()) { ctx.Books.Add(book); rows = ctx.SaveChanges(); } return(rows); }
public int NewLog(LogRegister log) { int rows = 0; using (var ctx = new UckLibMgrDbEntities()) { ctx.LogRegisters.Add(log); rows = ctx.SaveChanges(); } return(rows); }
public int NewIssue(Issue issue) { int rows = 0; using (var ctx = new UckLibMgrDbEntities()) { ctx.Issues.Add(issue); rows = ctx.SaveChanges(); } return(rows); }
public int UpdateBook(int bookId, String title, String author, String publisher, DateTime publishDate, String isbn) { int rows = 0; using (var ctx = new UckLibMgrDbEntities()) { var book = ctx.Books.Find(bookId); book.Ttile = title; book.Author = author; book.Publisher = publisher; book.PublishedDate = publishDate; book.ISBN = isbn; book.ModifiedDate = DateTime.Now; rows = ctx.SaveChanges(); } return(rows); }