示例#1
0
        public string GetBookIdByISBN(string ISBN)
        {
            DBTool dbTool = new DBTool();
            SqlConnection conn = dbTool.GetConnection();

            SqlCommand command = new SqlCommand();
            command.Connection = conn;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "sp_GetBookIdByISBN";
            command.Parameters.Add("@isbn", SqlDbType.NVarChar).Value = ISBN;

            string bookid = Convert.ToString( command.ExecuteScalar());

            conn.Close();
            return bookid;
        }
示例#2
0
        public DataSet GetBookListByCategory(string SubCategoryId)
        {
            DBTool dbTool = new DBTool();
            SqlConnection conn = dbTool.GetConnection();

            SqlCommand command = new SqlCommand();
            command.Connection = conn;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "sp_GetBookListByCategory";
            command.Parameters.Add("@SubCategoryid", SqlDbType.Int).Value = Convert.ToInt32(SubCategoryId);

            SqlDataAdapter adapter = new SqlDataAdapter(command);
            DataSet ds = new DataSet();

            adapter.Fill(ds, "sp_GetBookListByCategory");

            conn.Close();
            return ds;
        }
示例#3
0
        public DataSet GetBookDetailByISBN(string ISBN)
        {
            DBTool dbTool = new DBTool();
            SqlConnection conn = dbTool.GetConnection();

            SqlCommand command = new SqlCommand();
            command.Connection = conn;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "sp_GetBookDetailByISBN";
            command.Parameters.Add("@isbn", SqlDbType.NVarChar).Value = ISBN;

            SqlDataAdapter adapter = new SqlDataAdapter(command);
            DataSet ds = new DataSet();

            adapter.Fill(ds, "sp_GetBookDetail");

            conn.Close();
            return ds;
        }
示例#4
0
        public DataSet GetBookDetailByID(string bookid)
        {
            DBTool dbTool = new DBTool();
            SqlConnection conn = dbTool.GetConnection();

            SqlCommand command = new SqlCommand();
            command.Connection = conn;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "sp_GetBookDetailByID";
            command.Parameters.Add("@bookid", SqlDbType.Int).Value = Convert.ToInt32(bookid);

            SqlDataAdapter adapter = new SqlDataAdapter(command);
            DataSet ds = new DataSet();

            adapter.Fill(ds, "sp_GetBookDetail");

            conn.Close();
            return ds;
        }
示例#5
0
        public DataSet ListInteriorBooks()
        {
            DBTool dbTool = new DBTool();
            SqlConnection conn = dbTool.GetConnection();

            SqlCommand command = new SqlCommand();
            command.Connection = conn;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "sp_Book_GetThisMonthInteriorBook";

            SqlDataAdapter adapter = new SqlDataAdapter(command);
            DataSet ds = new DataSet();

            adapter.Fill(ds, "sp_Book_GetThisMonthInteriorBook");

            conn.Close();
            return ds;
        }
示例#6
0
        public string GetLastestBookId()
        {
            DBTool dbTool = new DBTool();
            SqlConnection conn = dbTool.GetConnection();

            SqlCommand command = new SqlCommand();
            command.Connection = conn;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "sp_GetLastestBookId";

            string bookid = Convert.ToString(command.ExecuteScalar());

            conn.Close();
            return bookid;
        }
示例#7
0
        public DataSet GetBookListByKeyword_MB(string Keyword)
        {
            DBTool dbTool = new DBTool();
            SqlConnection conn = dbTool.GetConnection();

            SqlCommand command = new SqlCommand();
            command.Connection = conn;
            command.CommandType = CommandType.StoredProcedure;
            command.CommandText = "sp_GetBookListByKeyword_MB";
            command.Parameters.Add("@Keyword", SqlDbType.NVarChar).Value = Keyword;

            SqlDataAdapter adapter = new SqlDataAdapter(command);
            DataSet ds = new DataSet();

            adapter.Fill(ds, "sp_GetBookListByKeyword_MB");

            conn.Close();
            return ds;
        }