private void Child_DeleteSelf(D02_Continent parent) { using (var dalManager = DalFactorySelfLoad.GetManager()) { var args = new DataPortalHookArgs(); OnDeletePre(args); var dal = dalManager.GetProvider <ID03_Continent_ChildDal>(); using (BypassPropertyChecks) { dal.Delete(parent.Continent_ID); } OnDeletePost(args); } }
private void Child_DeleteSelf(D02_Continent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("DeleteD03_Continent_Child", ctx.Connection)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Continent_ID1", parent.Continent_ID).DbType = DbType.Int32; var args = new DataPortalHookArgs(cmd); OnDeletePre(args); cmd.ExecuteNonQuery(); OnDeletePost(args); } } }
private void Child_Insert(D02_Continent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("AddD03_Continent_ReChild", ctx.Connection)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Continent_ID2", parent.Continent_ID).DbType = DbType.Int32; cmd.Parameters.AddWithValue("@Continent_Child_Name", ReadProperty(Continent_Child_NameProperty)).DbType = DbType.String; var args = new DataPortalHookArgs(cmd); OnInsertPre(args); cmd.ExecuteNonQuery(); OnInsertPost(args); } } }
private void Child_Insert(D02_Continent parent) { using (var dalManager = DalFactorySelfLoad.GetManager()) { var args = new DataPortalHookArgs(); OnInsertPre(args); var dal = dalManager.GetProvider <ID03_Continent_ReChildDal>(); using (BypassPropertyChecks) { dal.Insert( parent.Continent_ID, Continent_Child_Name ); } OnInsertPost(args); } }
private void Child_Insert(D02_Continent parent) { var dto = new D03_Continent_ChildDto(); dto.Parent_Continent_ID = parent.Continent_ID; dto.Continent_Child_Name = Continent_Child_Name; using (var dalManager = DalFactorySelfLoad.GetManager()) { var args = new DataPortalHookArgs(dto); OnInsertPre(args); var dal = dalManager.GetProvider <ID03_Continent_ChildDal>(); using (BypassPropertyChecks) { var resultDto = dal.Insert(dto); args = new DataPortalHookArgs(resultDto); } OnInsertPost(args); } }
private void Child_Insert(D02_Continent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("AddD04_SubContinent", ctx.Connection)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Parent_Continent_ID", parent.Continent_ID).DbType = DbType.Int32; cmd.Parameters.AddWithValue("@SubContinent_ID", ReadProperty(SubContinent_IDProperty)).Direction = ParameterDirection.Output; cmd.Parameters.AddWithValue("@SubContinent_Name", ReadProperty(SubContinent_NameProperty)).DbType = DbType.String; var args = new DataPortalHookArgs(cmd); OnInsertPre(args); cmd.ExecuteNonQuery(); OnInsertPost(args); LoadProperty(SubContinent_IDProperty, (int)cmd.Parameters["@SubContinent_ID"].Value); } // flushes all pending data operations FieldManager.UpdateChildren(this); } }
private void Child_Insert(D02_Continent parent) { var dto = new D04_SubContinentDto(); dto.Parent_Continent_ID = parent.Continent_ID; dto.SubContinent_Name = SubContinent_Name; using (var dalManager = DalFactorySelfLoad.GetManager()) { var args = new DataPortalHookArgs(dto); OnInsertPre(args); var dal = dalManager.GetProvider <ID04_SubContinentDal>(); using (BypassPropertyChecks) { var resultDto = dal.Insert(dto); LoadProperty(SubContinent_IDProperty, resultDto.SubContinent_ID); args = new DataPortalHookArgs(resultDto); } OnInsertPost(args); // flushes all pending data operations FieldManager.UpdateChildren(this); } }
private void Child_Insert(D02_Continent parent) { using (var dalManager = DalFactorySelfLoad.GetManager()) { var args = new DataPortalHookArgs(); OnInsertPre(args); var dal = dalManager.GetProvider <ID04_SubContinentDal>(); using (BypassPropertyChecks) { int subContinent_ID = -1; dal.Insert( parent.Continent_ID, out subContinent_ID, SubContinent_Name ); LoadProperty(SubContinent_IDProperty, subContinent_ID); } OnInsertPost(args); // flushes all pending data operations FieldManager.UpdateChildren(this); } }
private void Child_Update(D02_Continent parent) { if (!IsDirty) { return; } using (var dalManager = DalFactorySelfLoad.GetManager()) { var args = new DataPortalHookArgs(); OnUpdatePre(args); var dal = dalManager.GetProvider <ID03_Continent_ChildDal>(); using (BypassPropertyChecks) { dal.Update( parent.Continent_ID, Continent_Child_Name ); } OnUpdatePost(args); } }