CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Posts
    1

    Arrears global processing

    Am working on an medical arrears submodule in my HR & Payroll system.The Board has

    decided that all the staff in salary scales 10 to 15 will have their new medical

    allowance increased from the current $112 to $130 per month.the payments are to be

    backdated to last year july(Ist July 2008).staff in the mentioned scales are 388.

    I have filtered staff to scales 10 to 15(of course with sql statements).
    the months difference between now and last year is also well catered for(no issue

    here).

    The following code calculates medical arrears backdating it to last year.

    private void MedAllowanceArrears()
    {
    decimal currentMedallowance,newMedallowance,Medarrears,totalMedarrears;
    int MedMonths;

    currentMedallowance=int.Parse(txtMedAllowance.Text);// textbox to hold $112
    newMedallowance=int.Parse(txtNewMedAllowance.Text);// textbox to hold $130
    MedMonths=int.Parse(txtMedMonths.Text);// textbox to hold months difference


    Medarrears=(newMedallowance-currentMedallowance);// variable to store

    // arrears difference

    totalMedarrears=(Medarrears*MedMonths); //variable to store total arrears.

    txtMedArrears.Text=totalMedarrears.ToString(); //textbox to store total arrears
    }



    Am calling this function when navigating the Personnel master table (Has 388 records)
    with this code:

    this.BindingContext[pm1,"PERSONNEL_MASTER"].Position++;

    //calling function
    MedAllowanceArrears();

    QUESTION:
    The only problem with navigation code is that its computing the arrears for my staff

    one record at at time as you navigate forward the personnel master table which has 388

    records.

    So can anyone out there help me with code to compute(process) the arrears for all my

    staff with only one click instead of 388 clicks which is tiresome.

    -- Don't worry of the long narration.meant to make your understanding easy.

  2. #2
    Join Date
    May 2009
    Location
    Bengaluru, India
    Posts
    460

    Re: Arrears global processing

    Can you pls quote your code inside the tags so that it would make life easier reading it.


    where ever you are calling the arrears calculation for 1 record - call it for 388 times in a for loop in the button handler - where you are clicking.

    Code:
     this.BindingContext[pm1,"PERSONNEL_MASTER"].Position++;
    what is the this object your are referring here in the above code ?
    what is the pm1 refer here ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured