private void Child_DeleteSelf(H06_Country parent)
 {
     using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <IH07_Country_ChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.Country_ID);
         }
         OnDeletePost(args);
     }
 }
Ejemplo n.º 2
0
 private void Child_DeleteSelf(H06_Country parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteH07_Country_Child", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Country_ID1", parent.Country_ID).DbType = DbType.Int32;
             var args = new DataPortalHookArgs(cmd);
             OnDeletePre(args);
             cmd.ExecuteNonQuery();
             OnDeletePost(args);
         }
     }
 }
Ejemplo n.º 3
0
 private void Child_Insert(H06_Country parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddH07_Country_ReChild", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Country_ID2", parent.Country_ID).DbType = DbType.Int32;
             cmd.Parameters.AddWithValue("@Country_Child_Name", ReadProperty(Country_Child_NameProperty)).DbType = DbType.String;
             var args = new DataPortalHookArgs(cmd);
             OnInsertPre(args);
             cmd.ExecuteNonQuery();
             OnInsertPost(args);
         }
     }
 }
Ejemplo n.º 4
0
        private void Child_Insert(H06_Country parent)
        {
            var dto = new H07_Country_ReChildDto();

            dto.Parent_Country_ID  = parent.Country_ID;
            dto.Country_Child_Name = Country_Child_Name;
            using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IH07_Country_ReChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
            }
        }
Ejemplo n.º 5
0
 private void Child_Insert(H06_Country parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddH08_Region", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Parent_Country_ID", parent.Country_ID).DbType           = DbType.Int32;
             cmd.Parameters.AddWithValue("@Region_ID", ReadProperty(Region_IDProperty)).Direction  = ParameterDirection.Output;
             cmd.Parameters.AddWithValue("@Region_Name", ReadProperty(Region_NameProperty)).DbType = DbType.String;
             var args = new DataPortalHookArgs(cmd);
             OnInsertPre(args);
             cmd.ExecuteNonQuery();
             OnInsertPost(args);
             LoadProperty(Region_IDProperty, (int)cmd.Parameters["@Region_ID"].Value);
         }
         // flushes all pending data operations
         FieldManager.UpdateChildren(this);
     }
 }
Ejemplo n.º 6
0
 private void Child_Insert(H06_Country parent)
 {
     using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IH08_RegionDal>();
         using (BypassPropertyChecks)
         {
             int region_ID = -1;
             dal.Insert(
                 parent.Country_ID,
                 out region_ID,
                 Region_Name
                 );
             LoadProperty(Region_IDProperty, region_ID);
         }
         OnInsertPost(args);
         // flushes all pending data operations
         FieldManager.UpdateChildren(this);
     }
 }
Ejemplo n.º 7
0
        private void Child_Insert(H06_Country parent)
        {
            var dto = new H08_RegionDto();

            dto.Parent_Country_ID = parent.Country_ID;
            dto.Region_Name       = Region_Name;
            using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IH08_RegionDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    LoadProperty(Region_IDProperty, resultDto.Region_ID);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
                // flushes all pending data operations
                FieldManager.UpdateChildren(this);
            }
        }
        private void Child_Update(H06_Country parent)
        {
            if (!IsDirty)
            {
                return;
            }

            using (var dalManager = DalFactorySelfLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs();
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IH07_Country_ChildDal>();
                using (BypassPropertyChecks)
                {
                    dal.Update(
                        parent.Country_ID,
                        Country_Child_Name
                        );
                }
                OnUpdatePost(args);
            }
        }