Click here to Skip to main content
15,900,502 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Introducing the new Code Project employee and a new contest for June! Pin
den2k887-Jun-18 21:06
professionalden2k887-Jun-18 21:06 
GeneralRe: Introducing the new Code Project employee and a new contest for June! Pin
Jovita Dsa8-Jun-18 3:16
professionalJovita Dsa8-Jun-18 3:16 
GeneralRe: Introducing the new Code Project employee and a new contest for June! Pin
Jovita Dsa11-Jun-18 8:19
professionalJovita Dsa11-Jun-18 8:19 
GeneralRe: Introducing the new Code Project employee and a new contest for June! Pin
BillWoodruff8-Jun-18 6:08
professionalBillWoodruff8-Jun-18 6:08 
GeneralRe: Introducing the new Code Project employee and a new contest for June! Pin
Jovita Dsa11-Jun-18 8:19
professionalJovita Dsa11-Jun-18 8:19 
GeneralRe: Introducing the new Code Project employee and a new contest for June! Pin
Nelek8-Jun-18 11:10
protectorNelek8-Jun-18 11:10 
GeneralRe: Introducing the new Code Project employee and a new contest for June! Pin
Jovita Dsa11-Jun-18 8:18
professionalJovita Dsa11-Jun-18 8:18 
GeneralSpeaking of dumbing down... Pin
Marc Clifton7-Jun-18 8:40
mvaMarc Clifton7-Jun-18 8:40 
I just wrote this. It works, exactly as it's supposed to.
Common.Initialize<TaxCode>(
    dxgTaxCodes,                                
    tc => !tc.Archived,                         
    archiveController.OnTaxCodeDeleted,         
    archiveController.OnTaxCodeChanging,        
    onFinalized: (_, __) =>                     
    Common.Initialize<Product>(             
        dxgProducts,                            
        p => !p.Archived,                       
        archiveController.OnProductDeleted,     
        archiveController.OnProductChanging,    
        updateLookups: true,                    
        decoupledLookups: true,                 
        onFinalized: (___, ____) => Common.Initialize<ProductSchedule>(
            dxgProductSchedules,                
            p => !p.Archived,                   
            updateLookups: true,                
            decoupledLookups: true)));          

Here's the code with comments:
Common.Initialize<TaxCode>(
    dxgTaxCodes,                                // Initialize the tax code grid
    tc => !tc.Archived,                         // with non-archived tax codes
    archiveController.OnTaxCodeDeleted,         // archive tax codes that are deleted
    archiveController.OnTaxCodeChanging,        // archive tax codes that are changing
    onFinalized: (_, __) =>                     // when the tax code record has been updated...
    Common.Initialize<Product>(             
        dxgProducts,                            // we need to refresh the products with the cloned 
                                                // (non-archived) version
        p => !p.Archived,                       // which is not archived
        archiveController.OnProductDeleted,     // and when the product is deleted, archive it
        archiveController.OnProductChanging,    // or when the product is changed, archive it
        updateLookups: true,                    // force a fetch of any new lookups 
                                                // (ie, the tax code, which is a lookup)
        decoupledLookups: true,                 // but don't couple this with the cached tax code
                                                // table that's a lookup in product grid
        onFinalized: (___, ____) => Common.Initialize<ProductSchedule>(
            dxgProductSchedules,                // and when a product record is updated,
                                                // update the product-schedule grid
            ps => !ps.Archived,                 // with active product-schedules
            updateLookups: true,                // forcing a fetch of lookups (products and schedules)
            decoupledLookups: true)));          // and decoupled from the cached product and
                                                // schedule tables backing the product and
                                                // schedule grids.

(I hope the formatting got preserved.)

OK, yeah, this is a bit much. Laugh | :laugh:
Latest Article - Building a Prototype Web-Based Diagramming Tool with SVG and Javascript

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

Artificial intelligence is the only remedy for natural stupidity. - CDP1802

GeneralRe: Speaking of dumbing down... Pin
Sander Rossel7-Jun-18 8:46
professionalSander Rossel7-Jun-18 8:46 
GeneralRe: Speaking of dumbing down... Pin
Marc Clifton7-Jun-18 9:02
mvaMarc Clifton7-Jun-18 9:02 
GeneralRe: Speaking of dumbing down... Pin
ZurdoDev7-Jun-18 9:18
professionalZurdoDev7-Jun-18 9:18 
GeneralRe: Speaking of dumbing down... Pin
Eddy Vluggen7-Jun-18 11:13
professionalEddy Vluggen7-Jun-18 11:13 
GeneralRe: Speaking of dumbing down... Pin
PIEBALDconsult7-Jun-18 12:24
mvePIEBALDconsult7-Jun-18 12:24 
GeneralRe: Speaking of dumbing down... Pin
User 74293387-Jun-18 20:01
professionalUser 74293387-Jun-18 20:01 
GeneralRe: Speaking of dumbing down... Pin
Munchies_Matt7-Jun-18 20:45
Munchies_Matt7-Jun-18 20:45 
GeneralRe: Speaking of dumbing down... Pin
Gary Wheeler8-Jun-18 7:19
Gary Wheeler8-Jun-18 7:19 
GeneralRe: Speaking of dumbing down... Pin
Kirk 1038982111-Jun-18 4:59
Kirk 1038982111-Jun-18 4:59 
GeneralHow to create mouse cursor control in C# Pin
Member 122681837-Jun-18 6:19
Member 122681837-Jun-18 6:19 
GeneralRe: How to create mouse cursor control in C# Pin
Richard MacCutchan7-Jun-18 6:31
mveRichard MacCutchan7-Jun-18 6:31 
GeneralRe: How to create mouse cursor control in C# Pin
Eddy Vluggen7-Jun-18 8:19
professionalEddy Vluggen7-Jun-18 8:19 
GeneralRe: How to create mouse cursor control in C# Pin
Member 122681837-Jun-18 19:52
Member 122681837-Jun-18 19:52 
GeneralRe: How to create mouse cursor control in C# Pin
Eddy Vluggen7-Jun-18 22:58
professionalEddy Vluggen7-Jun-18 22:58 
GeneralRe: How to create mouse cursor control in C# Pin
RedDk7-Jun-18 9:10
RedDk7-Jun-18 9:10 
GeneralRe: How to create mouse cursor control in C# Pin
Ryan Peden7-Jun-18 10:52
professionalRyan Peden7-Jun-18 10:52 
GeneralRe: How to create mouse cursor control in C# Pin
RedDk7-Jun-18 12:29
RedDk7-Jun-18 12:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   488 votes