[Serializable] public class Child : BusinessBase<Child> { internal static Child NewChild() { return DataPortal.CreateChild<Child>(); } internal static Child GetChild() { return DataPortal.FetchChild<Child>(); } private Child() { MarkAsChild(); } private void Child_Create() { // initialize new child here } private void Child_Fetch() { // load child data here } private void Child_Insert() { // insert child data here } private void Child_Update() { // update child data here } private void Child_DeleteSelf() { // delete child data here } }
[Serializable] public class RootParent : BusinessBase<RootParent> { // other class code here ... protected override void DataPortal_Insert() { using (SqlConnection cn = new SqlConnection(...)) { // insert parent data here FieldManager.UpdateChildren(); } } protected override void DataPortal_Update() { using (SqlConnection cn = new SqlConnection(...)) { // update parent data here FieldManager.UpdateChildren(); } } }
[Serializable] public class ChildList : BusinessListBase<ChildList, Child> { // other class code here ... protected override void DataPortal_Update() { using (SqlConnection cn = new SqlConnection(...)) { Child_Update(); } } }
[Serializable] public class ChildList : BusinessListBase<ChildList, Child> { internal ChildList() { MarkAsChild(); } // other class code here ... }
Remember Me
Powered by: newtelligence dasBlog 2.3.9074.18820
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
E-mail
Theme design by Jelle Druyts