예제 #1
0
 private void Child_DeleteSelf(E10_City parent)
 {
     using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnDeletePre(args);
         var dal = dalManager.GetProvider <IE11_City_ChildDal>();
         using (BypassPropertyChecks)
         {
             dal.Delete(parent.City_ID);
         }
         OnDeletePost(args);
     }
 }
예제 #2
0
 private void Child_DeleteSelf(E10_City parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("DeleteE11_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);
         }
     }
 }
 private void Child_Insert(E10_City parent)
 {
     using (var ctx = ConnectionManager <SqlConnection> .GetManager("DeepLoad"))
     {
         using (var cmd = new SqlCommand("AddE11_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);
         }
     }
 }
        private void Child_Insert(E10_City parent)
        {
            var dto = new E11_City_ChildDto();

            dto.Parent_City_ID  = parent.City_ID;
            dto.City_Child_Name = City_Child_Name;
            using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
            {
                var args = new DataPortalHookArgs(dto);
                OnInsertPre(args);
                var dal = dalManager.GetProvider <IE11_City_ChildDal>();
                using (BypassPropertyChecks)
                {
                    var resultDto = dal.Insert(dto);
                    args = new DataPortalHookArgs(resultDto);
                }
                OnInsertPost(args);
            }
        }
 private void Child_Insert(E10_City parent)
 {
     using (var dalManager = DalFactoryParentLoadSoftDelete.GetManager())
     {
         var args = new DataPortalHookArgs();
         OnInsertPre(args);
         var dal = dalManager.GetProvider <IE12_CityRoadDal>();
         using (BypassPropertyChecks)
         {
             int cityRoad_ID = -1;
             dal.Insert(
                 parent.City_ID,
                 out cityRoad_ID,
                 CityRoad_Name
                 );
             LoadProperty(CityRoad_IDProperty, cityRoad_ID);
         }
         OnInsertPost(args);
     }
 }
예제 #6
0
        private void Child_Update(E10_City parent)
        {
            if (!IsDirty)
            {
                return;
            }

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