Example #1
0
        private List <MonthlyBillingPerPa> selectAllMbpa(MonthlyBilling mb)
        {
            List <MonthlyBillingPerPa> mbppa = new List <MonthlyBillingPerPa>();

            mbppa = MbDao.SelectMBperPa(mb);
            return(mbppa);
        }
Example #2
0
 //-----------------------------------------------------------------------------------------------------
 public bool UpdateMb(MonthlyBilling mb)
 {
     if (MbDao.UpdateMonthlyBilling(mb))
     {
         return(true);
     }
     return(false);
 }
Example #3
0
        //-----------------------------------------------------------------------------------------------------
        /// <summary>
        /// alle Monatsabrechnungen für eine bestimmte Periode aus der DB holen
        /// </summary>
        /// <param name="from"></param>
        /// <param name="to"></param>
        /// <returns></returns>
        public List <MonthlyBilling> SelectMbPeriod(DateTime from, DateTime to)
        {
            List <MonthlyBilling> mbList = new List <MonthlyBilling>();

            mbList = MbDao.SelectPeriod(from, to);
            //fehlerhandling??
            return(mbList);
        }
Example #4
0
        //-----------------------------------------------------------------------------------------------------
        /// <summary>
        /// Liste von Monatsabrechnungen für einen PA aus DB holen
        /// </summary>
        /// <returns></returns>
        public List <MonthlyBillingPerPa> SelectMbPerPa()
        {
            MonthlyBilling             mb    = new MonthlyBilling();
            List <MonthlyBillingPerPa> mbppa = new List <MonthlyBillingPerPa>();

            mbppa = MbDao.SelectMBperPa(mb);

            return(mbppa);
        }
Example #5
0
        //-----------------------------------------------------------------------------------------------------
        /// <summary>
        /// alle Monatsabrechnungen aus der DB holen
        /// </summary>
        /// <returns></returns>
        public List <MonthlyBilling> SelectAllMB()
        {
            List <MonthlyBilling> mbList = new List <MonthlyBilling>();

            mbList = MbDao.selectAllMB();

            foreach (MonthlyBilling mb in mbList)
            {
                CreateMb(mb);
                calculateValues();
            }
            return(mbList);
        }
Example #6
0
        public MonthlyBilling SelectMb(int selectedYear, int selectedMonth, PurchaserData selectedPurchaserData, List <PersonalAssistant> currentAssistents)
        {
            MonthlyBillingPerPaBL      bl = new MonthlyBillingPerPaBL();
            List <MonthlyBillingPerPa> monthlyBillingList = new List <MonthlyBillingPerPa>();

            mb           = new MonthlyBilling();
            mb.Purchaser = new PurchaserData();
            mb.Purchaser = selectedPurchaserData;
            mb.Month     = selectedMonth;
            mb.Year      = selectedYear;
            //------ get all MonthlyBillingPerPa for this month
            foreach (PersonalAssistant pa in currentAssistents)
            {
                MonthlyBillingPerPa monthb = new MonthlyBillingPerPa(selectedMonth, selectedYear, pa, selectedPurchaserData, new List <EffortEntry>());
                monthlyBillingList.Add(monthb);
            }

            if (mb == null)
            {
                mb = new MonthlyBilling();
            }
            if (mb.MbPerPaList == null)
            {
                mb.MbPerPaList = new List <MonthlyBillingPerPa>();
            }

            mb.MbPerPaList = monthlyBillingList;

            MonthlyBillingPerPaBL      mbPpabl = new MonthlyBillingPerPaBL();
            List <MonthlyBillingPerPa> tmp     = new List <MonthlyBillingPerPa>();

            //fill MonthlyBilling PerPa with data
            foreach (MonthlyBillingPerPa mbPa in mb.MbPerPaList)
            {
                tmp.Add(SelectMb(mbPa));
            }
            mb.MbPerPaList = tmp;
            mb.RehaDays    = MbDao.selectReha(selectedPurchaserData.Purchaser.Id, selectedMonth, selectedYear);

            //wenn keine Leistungseinträge vorhanden wird nichts berechnet
            if (mb.MbPerPaList == null || mb.MbPerPaList.Count == 0)
            {
            }
            else
            {
                //berechnet alles was für MB wichtig ist.
                calculateValues();
            }
            return(mb);
        }
Example #7
0
        //-----------------------------------------------------------------------------------------------------
        /// <summary>
        /// holt die Differenz aus dem Vormonat
        /// </summary>
        /// <param name="mb"></param>
        /// <returns></returns>
        private decimal getDifferenceToPrevMonth()
        {
            List <MonthlyBilling> mList = new List <MonthlyBilling>();

            mList = MbDao.selectAllFrom(mb.Purchaser.Purchaser.ApprovalBegin);
            foreach (MonthlyBilling m in mList)
            {
                if (m.Year == mb.Year && m.Month + 1 == mb.Month)
                {
                    return(m.Difference);
                }
            }
            return(0);
        }
Example #8
0
        //-----------------------------------------------------------------------------------------------------
        /// <summary>
        /// holt alle bereits benötigten Stunden des Stundenkontingents im Bewilligungszeitraum
        /// </summary>
        /// <param name="mb"></param>
        /// <returns></returns>
        private decimal getTookHours()
        {
            List <MonthlyBilling> mList = new List <MonthlyBilling>();

            mList = MbDao.selectAllFrom(mb.Purchaser.Purchaser.ApprovalBegin);
            decimal sum = 0;

            foreach (MonthlyBilling m in mList)
            {
                // calculateValues(m);

                sum += m.ConsumedHoursAmount;
            }
            return(sum);
        }
Example #9
0
        //-----------------------------------------------------------------------------------------------------

        /// <summary>
        /// verbleibende Stunden im Stundenkontingent berechnen
        /// </summary>
        /// <returns></returns>
        private decimal getDemandHours()
        {
            List <MonthlyBilling> mList = new List <MonthlyBilling>();

            mList = MbDao.selectAllFrom(mb.Purchaser.Purchaser.ApprovalBegin);
            decimal s = 0;

            foreach (MonthlyBilling m in mList)
            {
                s += m.SumHours;
            }
            mb.SoFarTookHours = s;

            mb.demandHours = mb.HourContingent - s;

            return(mb.demandHours);
        }
Example #10
0
 public void insertReha(long agid, int month, int year, int days)
 {
     MbDao.InsertReha(agid, month, year, days);
 }
Example #11
0
 public void deleteReha(int month, int year, long agid, int days)
 {
     MbDao.DeleteReha(month, year, agid, days);
 }
Example #12
0
 public List <MonthlyBillingPerPa> SelectMBperPa(List <MonthlyBillingPerPa> mbppa)
 {
     return(MbDao.SelectMBperPa(mb));
 }
Example #13
0
 public bool UpdateMonthlyBillingEntry(MonthlyBillingPerPa mb)
 {
     return(MbDao.UpdateMonthlyBillingEntry(mb));
 }
Example #14
0
 public MonthlyBillingPerPa InsertMonthlyBilling(MonthlyBillingPerPa mb)
 {
     return(MbDao.InsertMonthlyBilling(mb));
 }
Example #15
0
 /// <summary>
 /// die Monatsabrechnung für einen PA aus der DB holen
 /// Thomas: hier müssen Jahr, Monat und AG auch angegeben werden ansonsten brauchen wir hier eine Liste.
 /// </summary>
 /// <param name="mb"></param>
 /// <returns></returns>
 public MonthlyBillingPerPa SelectMb(MonthlyBillingPerPa mb)
 {
     return(MbDao.selectMBEntry(mb));
 }
Example #16
0
 //-----------------------------------------------------------------------------------------------------
 /// <summary>
 /// holt alle Monatsabrechnungen eines bestimmten AG aus der DB
 /// </summary>
 /// <param name="pur"></param>
 /// <returns></returns>
 public List <MonthlyBilling> SelectAllMB(Purchaser pur)
 {
     return(MbDao.selectSpecificMB(pur));
 }