Пример #1
0
 private void Child_DeleteSelf(D06_Country parent)
 {
     using (var dalManager = DalFactorySelfLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <ID07_Country_ChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.Country_ID);
         }
         OnDeletePost(args);
     }
 }
Пример #2
0
 private void Child_DeleteSelf(D06_Country parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteD07_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);
         }
     }
 }
 private void Child_Insert(D06_Country parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddD07_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);
         }
     }
 }
 private void Child_Insert(D06_Country parent)
 {
     using (var dalManager = DalFactorySelfLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <ID07_Country_ReChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Insert(
                 parent.Country_ID,
                 Country_Child_Name
                 );
         }
         OnInsertPost(args);
     }
 }
        private void Child_Insert(D06_Country parent)
        {
            var dto = new D07_Country_ReChildDto();

            dto.Parent_Country_ID  = parent.Country_ID;
            dto.Country_Child_Name = Country_Child_Name;
            using (var dalManager = DalFactorySelfLoad.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <ID07_Country_ReChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
            }
        }
Пример #6
0
 private void Child_Insert(D06_Country parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddD08_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);
     }
 }
Пример #7
0
        private void Child_Update(D06_Country parent)
        {
            if (!IsDirty)
            {
                return;
            }

            using (var dalManager = DalFactorySelfLoad.GetManager())
            {
                var args = new DataPortalHookArgs();
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <ID07_Country_ChildDal>();
                using (BypassPropertyChecks)
                {
                    dal.Update(
                        parent.Country_ID,
                        Country_Child_Name
                        );
                }
                OnUpdatePost(args);
            }
        }
Пример #8
0
 private void Child_Insert(D06_Country parent)
 {
     using (var dalManager = DalFactorySelfLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <ID08_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);
     }
 }
Пример #9
0
        private void Child_Insert(D06_Country parent)
        {
            var dto = new D08_RegionDto();

            dto.Parent_Country_ID = parent.Country_ID;
            dto.Region_Name       = Region_Name;
            using (var dalManager = DalFactorySelfLoad.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <ID08_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);
            }
        }