I was using Mr. Washington's code example ThingForSale as a template for things that I need. This is the first time I have tried to develop with DNN. I don't mean to sound too lazy (though it is probably true), but do we have to type in the code by hand to use databases? For example, on his tutorial for creating modules in 4.3+ the super easy way it has:
Namespace YourCompany.Modules.ThingsForSale
Public Class ThingsForSaleController
<DataObjectMethod(DataObjectMethodType.Insert)> _
Public Shared Sub ThingsForSale_Insert(ByVal ThingsForSaleInfo As ThingsForSaleInfo)
DataProvider.Instance().ExecuteNonQuery("ThingsForSale_Insert", ThingsForSaleInfo.ModuleId, GetNull(ThingsForSaleInfo.UserID), GetNull(ThingsForSaleInfo.Category.ToString), GetNull(ThingsForSaleInfo.Description.ToString), GetNull(ThingsForSaleInfo.Price))
End Sub
<DataObjectMethod(DataObjectMethodType.Delete)> _
Public Shared Sub ThingsForSale_Delete(ByVal ThingsForSaleInfo As ThingsForSaleInfo)
DataProvider.Instance().ExecuteNonQuery("ThingsForSale_Delete", ThingsForSaleInfo.ID)
End Sub
<DataObjectMethod(DataObjectMethodType.Update)> _
Public Shared Sub ThingsForSale_Update(ByVal ThingsForSaleInfo As ThingsForSaleInfo)
DataProvider.Instance().ExecuteNonQuery("ThingsForSale_Update", ThingsForSaleInfo.ID, ThingsForSaleInfo.ModuleId, GetNull(ThingsForSaleInfo.UserID), GetNull(ThingsForSaleInfo.Category.ToString), GetNull(ThingsForSaleInfo.Description.ToString), GetNull(ThingsForSaleInfo.Price))
End Sub
<DataObjectMethod(DataObjectMethodType.Select)> _
Public Shared Function ThingsForSale_SelectAll(ByVal ModuleId As Integer) As List(Of ThingsForSaleInfo)
Return CBO.FillCollection(Of ThingsForSaleInfo)(CType(DataProvider.Instance().ExecuteReader("ThingsForSale_SelectAll", ModuleId), IDataReader))
End Function
Private Shared Function GetNull(ByVal Field As Object) As Object
Return Null.GetNull(Field, DBNull.Value)
End Function
End Class
All that was copy and paste, so it was very easy. I just want to know about the next time I do something. Maybe I just don't know enough about asp.net, but a lot of the stuff I have done VS created the ObjectDataSource methods automatically.
I am not complaining. Please don't read it this way. I am thankful for the tutorial, and I realize that DNN is a complex system. I don't expect it to be super-easy. But I do need to get a good grasp on how to proceeed. I can't copy and paste forever because I don't understand.
Thank you.