public void SetBooks(Set_Books book) { string sqlexpression = "book_insert"; using (SqlConnection connection = new SqlConnection(connectionString)) { connection.Open(); SqlCommand command = new SqlCommand(sqlexpression, connection); command.CommandType = System.Data.CommandType.StoredProcedure; SqlParameter BookIdParam = new SqlParameter { ParameterName = "@id", Value = book.Id }; command.Parameters.Add(BookIdParam); SqlParameter BookNameParam = new SqlParameter { ParameterName = "@book", Value = book.BookName }; command.Parameters.Add(BookNameParam); command.ExecuteNonQuery(); try { command.ExecuteNonQuery(); } catch { } connection.Close(); } }
public void SetBooks(Set_Books book) { dal.SetBooks(book); }
public ActionResult SetBook(Set_Books book) { bis_log.SetBooks(book); return(RedirectToAction("Mainpage")); }
public ActionResult SetBook() { Set_Books book = new Set_Books(); return(View(book)); }