コード例 #1
0
 private void Child_DeleteSelf(A10_City parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <IA11_City_ReChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.City_ID);
         }
         OnDeletePost(args);
     }
 }
コード例 #2
0
 private void Child_DeleteSelf(A10_City parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteA11_City_Child", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@City_ID1", parent.City_ID).DbType = DbType.Int32;
             var args = new DataPortalHookArgs(cmd);
             OnDeletePre(args);
             cmd.ExecuteNonQuery();
             OnDeletePost(args);
         }
     }
 }
コード例 #3
0
 private void Child_Insert(A10_City parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddA11_City_ReChild", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@City_ID2", parent.City_ID).DbType = DbType.Int32;
             cmd.Parameters.AddWithValue("@City_Child_Name", ReadProperty(City_Child_NameProperty)).DbType = DbType.String;
             var args = new DataPortalHookArgs(cmd);
             OnInsertPre(args);
             cmd.ExecuteNonQuery();
             OnInsertPost(args);
         }
     }
 }
コード例 #4
0
 private void Child_Insert(A10_City parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IA11_City_ReChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Insert(
                 parent.City_ID,
                 City_Child_Name
                 );
         }
         OnInsertPost(args);
     }
 }
コード例 #5
0
        private void Child_Insert(A10_City parent)
        {
            var dto = new A11_City_ReChildDto();

            dto.Parent_City_ID  = parent.City_ID;
            dto.City_Child_Name = City_Child_Name;
            using (var dalManager = DalFactoryParentLoad.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IA11_City_ReChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
            }
        }
コード例 #6
0
 private void Child_Insert(A10_City parent)
 {
     using (var dalManager = DalFactoryParentLoad.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IA12_CityRoadDal>();
         using (BypassPropertyChecks)
         {
             int cityRoad_ID = -1;
             dal.Insert(
                 parent.City_ID,
                 out cityRoad_ID,
                 CityRoad_Name
                 );
             LoadProperty(CityRoad_IDProperty, cityRoad_ID);
         }
         OnInsertPost(args);
     }
 }
コード例 #7
0
        private void Child_Update(A10_City parent)
        {
            if (!IsDirty)
            {
                return;
            }

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