예제 #1
0
        private void Child_Update(A04_SubContinent parent)
        {
            if (!IsDirty)
            {
                return;
            }

            var dto = new A05_SubContinent_ChildDto();

            dto.Parent_SubContinent_ID  = parent.SubContinent_ID;
            dto.SubContinent_Child_Name = SubContinent_Child_Name;
            dto.RowVersion = _rowVersion;
            using (var dalManager = DalFactoryParentLoad.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IA05_SubContinent_ChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Update(dto);
                    _rowVersion = resultDto.RowVersion;
                    args        = new DataPortalHookArgs(resultDto);
                }
                OnUpdatePost(args);
            }
        }
예제 #2
0
 private void Child_DeleteSelf(A04_SubContinent parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <IA05_SubContinent_ChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.SubContinent_ID);
         }
         OnDeletePost(args);
     }
 }
 private void Child_DeleteSelf(A04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteA05_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(A04_SubContinent parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IA05_SubContinent_ReChildDal>();
         using (BypassPropertyChecks)
         {
             _rowVersion = dal.Insert(
                 parent.SubContinent_ID,
                 SubContinent_Child_Name
                 );
         }
         OnInsertPost(args);
     }
 }
 private void Child_Insert(A04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddA05_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(A04_SubContinent parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IA06_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);
     }
 }
예제 #7
0
 private void Child_Insert(A04_SubContinent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddA06_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_Update(A04_SubContinent parent)
        {
            if (!IsDirty)
            {
                return;
            }

            using (var dalManager = DalFactoryParentLoad.GetManager())
            {
                var args = new DataPortalHookArgs();
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IA05_SubContinent_ReChildDal>();
                using (BypassPropertyChecks)
                {
                    _rowVersion = dal.Update(
                        parent.SubContinent_ID,
                        SubContinent_Child_Name,
                        _rowVersion
                        );
                }
                OnUpdatePost(args);
            }
        }
예제 #9
0
        private void Child_Insert(A04_SubContinent parent)
        {
            var dto = new A06_CountryDto();

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