示例#1
0
 private void Child_DeleteSelf(A10Level11111 parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteA11Level111111ReChild", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_ID", parent.Level_1_1_1_1_1_ID).DbType = DbType.Int32;
             var args = new DataPortalHookArgs(cmd);
             OnDeletePre(args);
             cmd.ExecuteNonQuery();
             OnDeletePost(args);
         }
     }
 }
示例#2
0
 private void Child_Insert(A10Level11111 parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddA11Level111111Child", ctx.Connection))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_ID", parent.Level_1_1_1_1_1_ID).DbType = DbType.Int32;
             cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_1_Child_Name", ReadProperty(Level_1_1_1_1_1_1_Child_NameProperty)).DbType = DbType.String;
             var args = new DataPortalHookArgs(cmd);
             OnInsertPre(args);
             cmd.ExecuteNonQuery();
             OnInsertPost(args);
         }
     }
 }