private void Child_Update(G04_SubContinent parent) { if (!IsDirty) { return; } var dto = new G05_SubContinent_ReChildDto(); dto.Parent_SubContinent_ID = parent.SubContinent_ID; dto.SubContinent_Child_Name = SubContinent_Child_Name; dto.RowVersion = _rowVersion; using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(dto); OnUpdatePre(args); var dal = dalManager.GetProvider <IG05_SubContinent_ReChildDal>(); using (BypassPropertyChecks) { var resultDto = dal.Update(dto); _rowVersion = resultDto.RowVersion; args = new DataPortalHookArgs(resultDto); } OnUpdatePost(args); } }
private void Child_DeleteSelf(G04_SubContinent parent) { using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(); OnDeletePre(args); var dal = dalManager.GetProvider <IG05_SubContinent_ReChildDal>(); using (BypassPropertyChecks) { dal.Delete(parent.SubContinent_ID); } OnDeletePost(args); } }
private void Child_DeleteSelf(G04_SubContinent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("DeleteG05_SubContinent_Child", ctx.Connection)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@SubContinent_ID1", parent.SubContinent_ID).DbType = DbType.Int32; var args = new DataPortalHookArgs(cmd); OnDeletePre(args); cmd.ExecuteNonQuery(); OnDeletePost(args); } } }
private void Child_Insert(G04_SubContinent parent) { using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(); OnInsertPre(args); var dal = dalManager.GetProvider <IG05_SubContinent_ChildDal>(); using (BypassPropertyChecks) { _rowVersion = dal.Insert( parent.SubContinent_ID, SubContinent_Child_Name ); } OnInsertPost(args); } }
private void Child_Insert(G04_SubContinent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("AddG05_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; cmd.Parameters.Add("@NewRowVersion", SqlDbType.Timestamp).Direction = ParameterDirection.Output; var args = new DataPortalHookArgs(cmd); OnInsertPre(args); cmd.ExecuteNonQuery(); OnInsertPost(args); _rowVersion = (byte[])cmd.Parameters["@NewRowVersion"].Value; } } }
private void Child_Insert(G04_SubContinent parent) { using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(); OnInsertPre(args); var dal = dalManager.GetProvider <IG06_CountryDal>(); using (BypassPropertyChecks) { int country_ID = -1; _rowVersion = 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); } }
private void Child_Insert(G04_SubContinent parent) { using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad")) { using (var cmd = new SqlCommand("AddG06_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; cmd.Parameters.Add("@NewRowVersion", SqlDbType.Timestamp).Direction = ParameterDirection.Output; var args = new DataPortalHookArgs(cmd); OnInsertPre(args); cmd.ExecuteNonQuery(); OnInsertPost(args); LoadProperty(Country_IDProperty, (int)cmd.Parameters["@Country_ID"].Value); _rowVersion = (byte[])cmd.Parameters["@NewRowVersion"].Value; } // flushes all pending data operations FieldManager.UpdateChildren(this); } }
private void Child_Insert(G04_SubContinent parent) { var dto = new G06_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 <IG06_CountryDal>(); using (BypassPropertyChecks) { var resultDto = dal.Insert(dto); LoadProperty(Country_IDProperty, resultDto.Country_ID); _rowVersion = resultDto.RowVersion; args = new DataPortalHookArgs(resultDto); } OnInsertPost(args); // flushes all pending data operations FieldManager.UpdateChildren(this); } }
private void Child_Update(G04_SubContinent parent) { if (!IsDirty) { return; } using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager()) { var args = new DataPortalHookArgs(); OnUpdatePre(args); var dal = dalManager.GetProvider <IG05_SubContinent_ChildDal>(); using (BypassPropertyChecks) { _rowVersion = dal.Update( parent.SubContinent_ID, SubContinent_Child_Name, _rowVersion ); } OnUpdatePost(args); } }