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