private void Child_Update(E04_SubContinent parent)
        {
            if (!IsDirty)
            {
                return;
            }

            var dto = new E05_SubContinent_ChildDto();

            dto.Parent_SubContinent_ID  = parent.SubContinent_ID;
            dto.SubContinent_Child_Name = SubContinent_Child_Name;
            dto.RowVersion = _rowVersion;
            using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IE05_SubContinent_ChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Update(dto);
                    _rowVersion = resultDto.RowVersion;
                    args        = new DataPortalHookArgs(resultDto);
                }
                OnUpdatePost(args);
            }
        }
 private void Child_DeleteSelf(E04_SubContinent parent)
 {
     using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <IE05_SubContinent_ChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.SubContinent_ID);
         }
         OnDeletePost(args);
     }
 }
 private void Child_DeleteSelf(E04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteE05_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(E04_SubContinent parent)
 {
     using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IE05_SubContinent_ReChildDal>();
         using (BypassPropertyChecks)
         {
             _rowVersion = dal.Insert(
                 parent.SubContinent_ID,
                 SubContinent_Child_Name
                 );
         }
         OnInsertPost(args);
     }
 }
 private void Child_Insert(E04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddE05_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;
         }
     }
 }
Пример #6
0
 private void Child_Insert(E04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddE06_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);
     }
 }
Пример #7
0
 private void Child_Insert(E04_SubContinent parent)
 {
     using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IE06_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_Update(E04_SubContinent parent)
        {
            if (!IsDirty)
            {
                return;
            }

            using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs();
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IE05_SubContinent_ReChildDal>();
                using (BypassPropertyChecks)
                {
                    _rowVersion = dal.Update(
                        parent.SubContinent_ID,
                        SubContinent_Child_Name,
                        _rowVersion
                        );
                }
                OnUpdatePost(args);
            }
        }
Пример #9
0
        private void Child_Insert(E04_SubContinent parent)
        {
            var dto = new E06_CountryDto();

            dto.Parent_SubContinent_ID = parent.SubContinent_ID;
            dto.Country_Name           = Country_Name;
            using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IE06_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);
            }
        }