private void Child_DeleteSelf(H04_SubContinent parent) { using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(); OnDeletePre(args); var dal = dalManager.GetProvider <IH05_SubContinent_ReChildDal>(); using (BypassPropertyChecks) { dal.Delete(parent.SubContinent_ID); } OnDeletePost(args); } }
private void Child_DeleteSelf(H04_SubContinent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("DeleteH05_SubContinent_ReChild", ctx.Connection)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SubContinent_ID2", parent.SubContinent_ID).DbType = DbType.Int32; var args = new DataPortalHookArgs(cmd); OnDeletePre(args); cmd.ExecuteNonQuery(); OnDeletePost(args); } } }
private void Child_Insert(H04_SubContinent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("AddH05_SubContinent_Child", ctx.Connection)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SubContinent_ID1", parent.SubContinent_ID).DbType = DbType.Int32; cmd.Parameters.AddWithValue("@SubContinent_Child_Name", ReadProperty(SubContinent_Child_NameProperty)).DbType = DbType.String; var args = new DataPortalHookArgs(cmd); OnInsertPre(args); cmd.ExecuteNonQuery(); OnInsertPost(args); } } }
private void Child_Insert(H04_SubContinent parent) { var dto = new H05_SubContinent_ReChildDto(); dto.Parent_SubContinent_ID = parent.SubContinent_ID; dto.SubContinent_Child_Name = SubContinent_Child_Name; using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(dto); OnInsertPre(args); var dal = dalManager.GetProvider <IH05_SubContinent_ReChildDal>(); using (BypassPropertyChecks) { var resultDto = dal.Insert(dto); args = new DataPortalHookArgs(resultDto); } OnInsertPost(args); } }
private void Child_Insert(H04_SubContinent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("AddH06_Country", ctx.Connection)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Parent_SubContinent_ID", parent.SubContinent_ID).DbType = DbType.Int32; cmd.Parameters.AddWithValue("@Country_ID", ReadProperty(Country_IDProperty)).Direction = ParameterDirection.Output; cmd.Parameters.AddWithValue("@Country_Name", ReadProperty(Country_NameProperty)).DbType = DbType.String; var args = new DataPortalHookArgs(cmd); OnInsertPre(args); cmd.ExecuteNonQuery(); OnInsertPost(args); LoadProperty(Country_IDProperty, (int)cmd.Parameters["@Country_ID"].Value); } // flushes all pending data operations FieldManager.UpdateChildren(this); } }
private void Child_Update(H04_SubContinent parent) { if (!IsDirty) { return; } using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(); OnUpdatePre(args); var dal = dalManager.GetProvider <IH05_SubContinent_ChildDal>(); using (BypassPropertyChecks) { dal.Update( parent.SubContinent_ID, SubContinent_Child_Name ); } OnUpdatePost(args); } }
private void Child_Insert(H04_SubContinent parent) { var dto = new H06_CountryDto(); dto.Parent_SubContinent_ID = parent.SubContinent_ID; dto.Country_Name = Country_Name; using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(dto); OnInsertPre(args); var dal = dalManager.GetProvider <IH06_CountryDal>(); using (BypassPropertyChecks) { var resultDto = dal.Insert(dto); LoadProperty(Country_IDProperty, resultDto.Country_ID); args = new DataPortalHookArgs(resultDto); } OnInsertPost(args); // flushes all pending data operations FieldManager.UpdateChildren(this); } }
private void Child_Insert(H04_SubContinent parent) { using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(); OnInsertPre(args); var dal = dalManager.GetProvider <IH06_CountryDal>(); using (BypassPropertyChecks) { int country_ID = -1; dal.Insert( parent.SubContinent_ID, out country_ID, Country_Name ); LoadProperty(Country_IDProperty, country_ID); } OnInsertPost(args); // flushes all pending data operations FieldManager.UpdateChildren(this); } }