private List <MonthlyBillingPerPa> selectAllMbpa(MonthlyBilling mb) { List <MonthlyBillingPerPa> mbppa = new List <MonthlyBillingPerPa>(); mbppa = MbDao.SelectMBperPa(mb); return(mbppa); }
//----------------------------------------------------------------------------------------------------- public bool UpdateMb(MonthlyBilling mb) { if (MbDao.UpdateMonthlyBilling(mb)) { return(true); } return(false); }
//----------------------------------------------------------------------------------------------------- /// <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); }
//----------------------------------------------------------------------------------------------------- /// <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); }
//----------------------------------------------------------------------------------------------------- /// <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); }
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); }
//----------------------------------------------------------------------------------------------------- /// <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); }
//----------------------------------------------------------------------------------------------------- /// <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); }
//----------------------------------------------------------------------------------------------------- /// <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); }
public void insertReha(long agid, int month, int year, int days) { MbDao.InsertReha(agid, month, year, days); }
public void deleteReha(int month, int year, long agid, int days) { MbDao.DeleteReha(month, year, agid, days); }
public List <MonthlyBillingPerPa> SelectMBperPa(List <MonthlyBillingPerPa> mbppa) { return(MbDao.SelectMBperPa(mb)); }
public bool UpdateMonthlyBillingEntry(MonthlyBillingPerPa mb) { return(MbDao.UpdateMonthlyBillingEntry(mb)); }
public MonthlyBillingPerPa InsertMonthlyBilling(MonthlyBillingPerPa mb) { return(MbDao.InsertMonthlyBilling(mb)); }
/// <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)); }
//----------------------------------------------------------------------------------------------------- /// <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)); }