Hi,
Which method is best for passing information?
I have created 3-layered architecture
GUI - MODEL(BL) - DAL
here is what I have coded
BL OBJECT
Category
{
public string CategoryName {get;set;}
Category()
{
//do nothing
}
Category(string categoryName)
{
CategoryName = categoryName;
}
DeleteCategory()
{
}
}
DAL
CategoryDao
{
DeleteCategory(string CategoryName)
{
SqlConnection SqlConn = new ....
SqlCommand sqlCmd = new ....
cmd.paramater.AddWithValue("@categoryName",CategoryName);
try
{
bla..
}
Catch....
}
}
UI Layer
some.aspx.cs
btnDeleteCategory_Click(Sender s, Eventargs arg)
{
//My QUESTION -> IS THIS A GOOD APPROACH
Category c = new Category(txtCategoryName.Text)
c.DeleteCategory();
//OR
//SHOULD IT BE DONE THIS WAY
Category c = new Category()
c.DeteleCategory(categoryName); -> Consider that DeleteCategory takes one string argument.
}
Regards and THANKS in advance