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

            var dto = new C05_SubContinent_ChildDto();

            dto.Parent_SubContinent_ID  = parent.SubContinent_ID;
            dto.SubContinent_Child_Name = SubContinent_Child_Name;
            dto.RowVersion = _rowVersion;
            using (var dalManager = DalFactorySelfLoad.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IC05_SubContinent_ChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Update(dto);
                    _rowVersion = resultDto.RowVersion;
                    args        = new DataPortalHookArgs(resultDto);
                }
                OnUpdatePost(args);
            }
        }
 private void Child_DeleteSelf(C04_SubContinent parent)
 {
     using (var dalManager = DalFactorySelfLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <IC05_SubContinent_ChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.SubContinent_ID);
         }
         OnDeletePost(args);
     }
 }
Пример #3
0
 private void Child_DeleteSelf(C04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteC05_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);
         }
     }
 }
Пример #4
0
 private void Child_Insert(C04_SubContinent parent)
 {
     using (var dalManager = DalFactorySelfLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IC05_SubContinent_ReChildDal>();
         using (BypassPropertyChecks)
         {
             _rowVersion = dal.Insert(
                 parent.SubContinent_ID,
                 SubContinent_Child_Name
                 );
         }
         OnInsertPost(args);
     }
 }
Пример #5
0
 private void Child_Insert(C04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddC05_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(C04_SubContinent parent)
 {
     using (var dalManager = DalFactorySelfLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IC06_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(C04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddC06_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);
     }
 }
Пример #8
0
        private void Child_Insert(C04_SubContinent parent)
        {
            var dto = new C06_CountryDto();

            dto.Parent_SubContinent_ID = parent.SubContinent_ID;
            dto.Country_Name           = Country_Name;
            using (var dalManager = DalFactorySelfLoad.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IC06_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);
            }
        }
Пример #9
0
        private void Child_Update(C04_SubContinent parent)
        {
            if (!IsDirty)
            {
                return;
            }

            using (var dalManager = DalFactorySelfLoad.GetManager())
            {
                var args = new DataPortalHookArgs();
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IC05_SubContinent_ReChildDal>();
                using (BypassPropertyChecks)
                {
                    _rowVersion = dal.Update(
                        parent.SubContinent_ID,
                        SubContinent_Child_Name,
                        _rowVersion
                        );
                }
                OnUpdatePost(args);
            }
        }