Exemple #1
0
 private void Child_DeleteSelf(H02_Continent parent)
 {
     using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <IH03_Continent_ReChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.Continent_ID);
         }
         OnDeletePost(args);
     }
 }
Exemple #2
0
 private void Child_DeleteSelf(H02_Continent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteH03_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(H02_Continent parent)
 {
     using (var ctx = ConnectionManager<SqlConnection>.GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddH03_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(H02_Continent parent)
        {
            var dto = new H03_Continent_ReChildDto();

            dto.Parent_Continent_ID  = parent.Continent_ID;
            dto.Continent_Child_Name = Continent_Child_Name;
            using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IH03_Continent_ReChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
            }
        }
 private void Child_Insert(H02_Continent parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddH04_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);
     }
 }
Exemple #6
0
        private void Child_Update(H02_Continent parent)
        {
            if (!IsDirty)
            {
                return;
            }

            using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs();
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IH03_Continent_ReChildDal>();
                using (BypassPropertyChecks)
                {
                    dal.Update(
                        parent.Continent_ID,
                        Continent_Child_Name
                        );
                }
                OnUpdatePost(args);
            }
        }
Exemple #7
0
        private void Child_Insert(H02_Continent parent)
        {
            var dto = new H04_SubContinentDto();

            dto.Parent_Continent_ID = parent.Continent_ID;
            dto.SubContinent_Name   = SubContinent_Name;
            using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IH04_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);
            }
        }
Exemple #8
0
 private void Child_Insert(H02_Continent parent)
 {
     using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IH04_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);
     }
 }