In answer to the second question:
There is the PROC:
Code:
ALTER PROCEDURE dbo.tbh_Articles_DeleteCategory
(
@CategoryID int
)
AS
DELETE tbh_Categories WHERE CategoryID = @CategoryID
Which is called from the the DAL page
"...DAL.SqlClient.SqlArticlesProvider" where the PROC is invoked.
Code:
/// <summary>
/// Deletes a category
/// </summary>
public override bool DeleteCategory(int categoryID)
{
using (SqlConnection cn = new SqlConnection(this.ConnectionString))
{
SqlCommand cmd = new SqlCommand("tbh_Articles_DeleteCategory", cn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@CategoryID", SqlDbType.Int).Value = categoryID;
cn.Open();
int ret = ExecuteNonQuery(cmd);
return (ret == 1);
}
}
Which is called from the BLL code in
"...BLL/Articles/Category"
Code:
/// <summary>
/// Deletes an existing category
/// </summary>
public static bool DeleteCategory(int id)
{
bool ret = SiteProvider.Articles.DeleteCategory(id);
new RecordDeletedEvent("category", id, null).Raise();
BizObject.PurgeCacheItems("articles_categor");
return ret;
}
The BLL code is addressed in the ObjectDataSource in the
"...Admin/ManageCategories.aspx" page.
Code:
<asp:ObjectDataSource ID="objAllCategories" runat="server" SelectMethod="GetCategories"
Code:
TypeName="MB.TheBeerHouse.BLL.Articles.Category" DeleteMethod="DeleteCategory">
</asp:ObjectDataSource>
I think that's how it works.
http://weboperahouse.com