Ejemplo n.º 1
0
        /// <summary>
        /// Este efectuat calculul final al salariilor
        /// </summary>
        public void ProcessSalariiFinal()
        {
            //sunt sterse din baza de date salariile calculate inainte de inchiderea lunii
            Salaries.Data.Process     processSalarii = new Data.Process(settings.ConnectionString);
            Salaries.Business.Angajat angajat        = new Salaries.Business.Angajat();
            //sunt preluate toate id-urile angajatilor
            angajat.AngajatorId = angajatorID;
            ArrayList alAng = angajat.GetSal_SituatieLunaraAngajatiIDs(lunaID);
            int       tot = alAng.Count, prev = Parameters.Task_PercentDone, current = 0;

            foreach (int angajatID in alAng)
            {
                //este sters salariul angajatului pe o anumita luna
                current++;
                Parameters.Task_PercentDone = prev + (int)(current * 10 / tot);
                processSalarii.DeleteSalariuLuna(lunaID, angajatID);
            }

            //sunt calculate salariile si sunt introduse datele in baza de date
            ProcessSalariiIntermediar();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Este efectuat calculul salariului pentru fiecare angajat in parte
        /// </summary>
        public void ProcessSalariiIntermediar()
        {
            Salaries.Data.Process     processSalarii = new Salaries.Data.Process(settings.ConnectionString);
            Salaries.Business.Angajat angajat        = new Salaries.Business.Angajat();
            angajat.AngajatorId = angajatorID;
            //sunt preluate toate id-urile angajatilor
            ArrayList alAng = angajat.GetSal_SituatieLunaraAngajatiIDs(lunaID);

            processSalarii.DeleteSalarii(lunaID, angajatorID);
            int total = alAng.Count, previous = Parameters.Task_PercentDone, current = 0;

            foreach (int id in alAng)
            {
                current++;
                Parameters.Task_PercentDone = previous + (int)(current * 33 / total);
                //este sters salariul angajatului pe o anumita luna
                //processSalarii.DeleteSalariuLuna(lunaID, id);

                //este calculat salariul angajatului
                ProcessSalariuAngajat(id);
            }
        }