Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 public void SetBooks(Set_Books book)
 {
     dal.SetBooks(book);
 }
Esempio n. 3
0
 public ActionResult SetBook(Set_Books book)
 {
     bis_log.SetBooks(book);
     return(RedirectToAction("Mainpage"));
 }
Esempio n. 4
0
        public ActionResult SetBook()
        {
            Set_Books book = new Set_Books();

            return(View(book));
        }