예제 #1
0
 private void Child_DeleteSelf(A08_Region parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <IA09_Region_ChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.Region_ID);
         }
         OnDeletePost(args);
     }
 }
예제 #2
0
 private void Child_DeleteSelf(A08_Region parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteA09_Region_Child", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Region_ID1", parent.Region_ID).DbType = DbType.Int32;
             var args = new DataPortalHookArgs(cmd);
             OnDeletePre(args);
             cmd.ExecuteNonQuery();
             OnDeletePost(args);
         }
     }
 }
 private void Child_Insert(A08_Region parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddA09_Region_ReChild", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Region_ID2", parent.Region_ID).DbType = DbType.Int32;
             cmd.Parameters.AddWithValue("@Region_Child_Name", ReadProperty(Region_Child_NameProperty)).DbType = DbType.String;
             var args = new DataPortalHookArgs(cmd);
             OnInsertPre(args);
             cmd.ExecuteNonQuery();
             OnInsertPost(args);
         }
     }
 }
 private void Child_Insert(A08_Region parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IA09_Region_ReChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Insert(
                 parent.Region_ID,
                 Region_Child_Name
                 );
         }
         OnInsertPost(args);
     }
 }
예제 #5
0
        private void Child_Insert(A08_Region parent)
        {
            var dto = new A09_Region_ChildDto();

            dto.Parent_Region_ID  = parent.Region_ID;
            dto.Region_Child_Name = Region_Child_Name;
            using (var dalManager = DalFactoryParentLoad.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IA09_Region_ChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
            }
        }
예제 #6
0
 private void Child_Insert(A08_Region parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddA10_City", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Parent_Region_ID", parent.Region_ID).DbType         = DbType.Int32;
             cmd.Parameters.AddWithValue("@City_ID", ReadProperty(City_IDProperty)).Direction  = ParameterDirection.Output;
             cmd.Parameters.AddWithValue("@City_Name", ReadProperty(City_NameProperty)).DbType = DbType.String;
             var args = new DataPortalHookArgs(cmd);
             OnInsertPre(args);
             cmd.ExecuteNonQuery();
             OnInsertPost(args);
             LoadProperty(City_IDProperty, (int)cmd.Parameters["@City_ID"].Value);
         }
         // flushes all pending data operations
         FieldManager.UpdateChildren(this);
     }
 }
예제 #7
0
        private void Child_Insert(A08_Region parent)
        {
            var dto = new A10_CityDto();

            dto.Parent_Region_ID = parent.Region_ID;
            dto.City_Name        = City_Name;
            using (var dalManager = DalFactoryParentLoad.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IA10_CityDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    LoadProperty(City_IDProperty, resultDto.City_ID);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
                // flushes all pending data operations
                FieldManager.UpdateChildren(this);
            }
        }
예제 #8
0
 private void Child_Insert(A08_Region parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IA10_CityDal>();
         using (BypassPropertyChecks)
         {
             int city_ID = -1;
             dal.Insert(
                 parent.Region_ID,
                 out city_ID,
                 City_Name
                 );
             LoadProperty(City_IDProperty, city_ID);
         }
         OnInsertPost(args);
         // flushes all pending data operations
         FieldManager.UpdateChildren(this);
     }
 }
        private void Child_Update(A08_Region parent)
        {
            if (!IsDirty)
            {
                return;
            }

            using (var dalManager = DalFactoryParentLoad.GetManager())
            {
                var args = new DataPortalHookArgs();
                OnUpdatePre(args);
                var dal = dalManager.GetProvider <IA09_Region_ChildDal>();
                using (BypassPropertyChecks)
                {
                    dal.Update(
                        parent.Region_ID,
                        Region_Child_Name
                        );
                }
                OnUpdatePost(args);
            }
        }