Click here to Skip to main content
15,906,106 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
i am implementing chain system with auto bidding. when one user referred by parent(referral) then direct referral account have to credited with 10% of the user package amount and all parents of the direct referral credited 5% of the amount. how can i implement it. please tell me in basics not in oops.

[Check this image][1]

https://i.stack.imgur.com/tkU4S.jpg

----------------------------------------------------

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->


    plan_id                  plan_amount                daily_commision
    -----------------------------------------------------
    p1                          $100                       0.7%

    p2                          $250                       1.0%

    p3                          $500                       1.5%

    p4                          $1000                       2%


    user_id password plan plan_amount referred_by income status 
    ---------------------------------------------------------
    usr0    22222    p1     $100      Global       $57.5     1
    usr1    12345    p1     $100       usr0        $72.5     1
    user2   123sad   p1     $100       usr1        $135      1
    user3   asdf4f   p2     $250       user2       $10       1
    user4   321423   p4     $1000      user2       0         1  

<!-- end snippet -->
 

here is users table user4 referred by user2 then 10% commision credited to user2 and 5% commision added to indirect referral usr1 and usr0.


then user gets daily commision according to their package. daily commision is added to user only not referral. every user got their daily commission every day.

please help me and save my job thanking you

  
 


  [1]: https://i.stack.imgur.com/tkU4S.jpg


What I have tried:

i already tried this but i can able add commission to one parent only, i'm not add commission to super parents.
Posted
Updated 9-Nov-16 20:43pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900