Esempio n. 1
0
        public EffortEntry GetEntry(PersonalAssistant pa, int month, int year, int day)
        {
            EffortEntryDAO eDao  = new EffortEntryDAO();
            EffortEntry    entry = eDao.GetEntry(pa, month, year, day);

            return(null);
        }
Esempio n. 2
0
 private void eeToText(EffortEntry ee)
 {
     day.Text = ee.Day.ToString();
     von.Text = ee.From.ToString("HH.mm");
     bis.Text = ee.To.ToString("HH.mm");
     KM.Text  = ee.Km.ToString();
     A1.Text  = ee.A1.Name.ToString();
     A1.Text  = ee.A1.Name.ToString();
     A1.Text  = ee.A1.Name.ToString();
 }
Esempio n. 3
0
        private void Bearbeiten_Click(object sender, RoutedEventArgs e)
        {
            EffortEntry ee = (EffortEntry)Übersicht.SelectedItem;

            if (ee != null)
            {
                eest = ee;
                einzel.Visibility = Visibility.Visible;
                eeToText(eest);
            }
        }
Esempio n. 4
0
        //-----------------------------------------------------------------------------------------------------
        public void InsertEntry(EffortEntry ee)
        {
            NpgsqlConnection con = DB.DBConnector.GetConnection();



            NpgsqlCommand command = new NpgsqlCommand(null, con);

            command.CommandText = "Select nextval('eintragIdgen')";
            NpgsqlDataReader reader = command.ExecuteReader();

            reader.Read();
            ee.Id = (int)reader.GetInt64(0);
            reader.Close();


            command             = new NpgsqlCommand(null, con);
            command.CommandText = "INSERT INTO leistungseintrag (paId, agId, monat, jahr, eintragId, von, bis, tag, abrechenbareKm, taetigkeit1, taetigkeit2, taetigkeit3) " +
                                  "VALUES (@paId, @agId, @monat, @jahr, @eintragId, @von, @bis, @tag, @abrechenbareKm, @taetigkeit1, @taetigkeit2, @taetigkeit3)";

            DB.DBConnector.AddToCommand("@paId", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Pa.Id);
            DB.DBConnector.AddToCommand("@agId", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Purchaser.Id);
            DB.DBConnector.AddToCommand("@monat", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Month);
            DB.DBConnector.AddToCommand("@jahr", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Year);

            DB.DBConnector.AddToCommand("@eintragId", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Id);
            DB.DBConnector.AddToCommand("@von", NpgsqlTypes.NpgsqlDbType.Varchar, command, ee.From.Hour + ":" + ee.From.Minute);
            DB.DBConnector.AddToCommand("@bis", NpgsqlTypes.NpgsqlDbType.Varchar, command, ee.To.Hour + ":" + ee.To.Minute);
            DB.DBConnector.AddToCommand("@tag", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Day);
            DB.DBConnector.AddToCommand("@abrechenbareKm", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Km);


            DB.DBConnector.AddToCommand("@taetigkeit1", NpgsqlTypes.NpgsqlDbType.Numeric, command, (int)(ee.A1.Name + 1));
            if (ee.A2 != null)
            {
                DB.DBConnector.AddToCommand("@taetigkeit2", NpgsqlTypes.NpgsqlDbType.Numeric, command, (int)(ee.A2.Name + 1));
            }
            else
            {
                DB.DBConnector.AddToCommand("@taetigkeit2", NpgsqlTypes.NpgsqlDbType.Numeric, command, null);
            }
            if (ee.A3 != null)
            {
                DB.DBConnector.AddToCommand("@taetigkeit3", NpgsqlTypes.NpgsqlDbType.Numeric, command, (int)(ee.A3.Name + 1));
            }
            else
            {
                DB.DBConnector.AddToCommand("@taetigkeit3", NpgsqlTypes.NpgsqlDbType.Numeric, command, null);
            }

            try { command.ExecuteNonQuery(); }catch (Exception e) { MessageBox.Show(e.Message.ToString(), "Error"); }
            con.Close();
        }
Esempio n. 5
0
        //-----------------------------------------------------------------------------------------------------
        public List <EffortEntry> GetEntries(long paid, long agid, int month, int year)
        {
            PurchaserDAO         agDao = new PurchaserDAO();
            PersonalAssistantDAO paDao = new PersonalAssistantDAO();

            NpgsqlConnection con     = DB.DBConnector.GetConnection();
            NpgsqlCommand    command = new NpgsqlCommand(null, con);



            command.CommandText = "SELECT eintragId,von,bis,tag,abrechenbareKm,taetigkeit1,taetigkeit2,taetigkeit3,paId From leistungseintrag WHERE paId=@paId AND monat=@monat AND jahr=@jahr AND agId=@agId";


            DB.DBConnector.AddToCommand("@paId", NpgsqlTypes.NpgsqlDbType.Numeric, command, paid);
            DB.DBConnector.AddToCommand("@monat", NpgsqlTypes.NpgsqlDbType.Numeric, command, month);
            DB.DBConnector.AddToCommand("@jahr", NpgsqlTypes.NpgsqlDbType.Numeric, command, year);
            DB.DBConnector.AddToCommand("@agId", NpgsqlTypes.NpgsqlDbType.Numeric, command, agid);

            //using the Connection to get Datas
            NpgsqlDataReader reader = command.ExecuteReader();

            //creating a new Data Container and filling it
            List <EffortEntry> ees = new List <EffortEntry>();

            while (reader.Read())
            {
                EffortEntry ee = new EffortEntry();
                FillEffortEntry(ee, reader);
                ee.Month = month;
                ee.Year  = year;
                ees.Add(ee);
            }

            reader.Close();
            con.Close();

            foreach (EffortEntry ee in ees)
            {
                if (ee.Purchaser != null)
                {
                    agDao.Select(ee.Purchaser);
                }
                if (ee.Pa != null)
                {
                    paDao.select(ee.Pa);
                }
            }

            return(ees);
        }
Esempio n. 6
0
        public void FillEffortEntry(EffortEntry ee, NpgsqlDataReader reader)
        {
            if (!reader.IsDBNull(0))
            {
                ee.Id = reader.GetInt32(0);
            }
            if (!reader.IsDBNull(1))
            {
                String   timeString = reader.GetString(1);
                String[] times      = timeString.Split(':');
                ee.From = new DateTime(2000, 1, 1, int.Parse(times[0]), int.Parse(times[1]), 0);
            }
            if (!reader.IsDBNull(2))
            {
                String   timeString = reader.GetString(2);
                String[] times      = timeString.Split(':');
                ee.To = new DateTime(2000, 1, 1, int.Parse(times[0]), int.Parse(times[1]), 0);
            }
            if (!(reader.IsDBNull(3)))
            {
                ee.Day = reader.GetInt32(3);
            }
            if (!(reader.IsDBNull(4)))
            {
                ee.Km = reader.GetInt32(4);
            }
            if (!(reader.IsDBNull(5)))
            {
                ee.A1      = new Activity();
                ee.A1.Name = (Activity.State)(reader.GetInt32(5) - 1);
            }
            if (!(reader.IsDBNull(6)))
            {
                ee.A2      = new Activity();
                ee.A2.Name = (Activity.State)(reader.GetInt32(6) - 1);
            }
            if (!(reader.IsDBNull(7)))
            {
                ee.A3      = new Activity();
                ee.A3.Name = (Activity.State)(reader.GetInt32(7) - 1);
            }

            if (!reader.IsDBNull(8))
            {
                ee.Purchaser    = new Purchaser();
                ee.Purchaser.Id = reader.GetInt32(8);
            }
        }
Esempio n. 7
0
        public void deleteEntry(EffortEntry ee)
        {
            NpgsqlConnection con = DB.DBConnector.GetConnection();


            NpgsqlCommand command = new NpgsqlCommand(null, con);

            command.CommandText = "Delete from leistungseintrag WHERE eintragId=@eeId AND paId=@paId AND agId=@agId AND monat=@monat AND jahr=@jahr AND tag=@tag";
            DB.DBConnector.AddToCommand("@paId", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Pa.Id);
            DB.DBConnector.AddToCommand("@agId", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Purchaser.Id);
            DB.DBConnector.AddToCommand("@monat", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Month);
            DB.DBConnector.AddToCommand("@jahr", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Year);

            try { command.ExecuteNonQuery(); } catch (Exception e) { MessageBox.Show(e.Message.ToString(), "Error"); }
            con.Close();
        }
Esempio n. 8
0
        public void UpdateEntry(EffortEntry ee)
        {
            NpgsqlConnection con = DB.DBConnector.GetConnection();


            NpgsqlCommand command = new NpgsqlCommand(null, con);

            command.CommandText = "UPDATE leistungseintrag SET von=@von, bis=@bis, tag=@tag, abrechenbareKm=@abrechenbareKm, taetigkeit1=@taetigkeit1, taetigkeit2=@taetigkeit2, taetigkeit3=@taetigkeit3 " +
                                  "WHERE eintragId=@eeId AND paId=@paId AND agId=@agId AND monat=@monat AND jahr=@jahr AND tag=@tag";


            DB.DBConnector.AddToCommand("@paId", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Pa.Id);
            DB.DBConnector.AddToCommand("@agId", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Purchaser.Id);
            DB.DBConnector.AddToCommand("@monat", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Month);
            DB.DBConnector.AddToCommand("@jahr", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Year);

            DB.DBConnector.AddToCommand("@eeId", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Id);
            DB.DBConnector.AddToCommand("@von", NpgsqlTypes.NpgsqlDbType.Varchar, command, ee.From.Hour + ":" + ee.From.Minute);
            DB.DBConnector.AddToCommand("@bis", NpgsqlTypes.NpgsqlDbType.Varchar, command, ee.To.Hour + ":" + ee.To.Minute);
            DB.DBConnector.AddToCommand("@tag", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Day);
            DB.DBConnector.AddToCommand("@abrechenbareKm", NpgsqlTypes.NpgsqlDbType.Numeric, command, ee.Km);


            DB.DBConnector.AddToCommand("@taetigkeit1", NpgsqlTypes.NpgsqlDbType.Numeric, command, (int)ee.A1.Name + 1);
            if (ee.A2 != null)
            {
                DB.DBConnector.AddToCommand("@taetigkeit2", NpgsqlTypes.NpgsqlDbType.Numeric, command, (int)ee.A2.Name + 1);
            }
            else
            {
                DB.DBConnector.AddToCommand("@taetigkeit2", NpgsqlTypes.NpgsqlDbType.Numeric, command, null);
            }
            if (ee.A3 != null)
            {
                DB.DBConnector.AddToCommand("@taetigkeit3", NpgsqlTypes.NpgsqlDbType.Numeric, command, (int)ee.A3.Name + 1);
            }
            else
            {
                DB.DBConnector.AddToCommand("@taetigkeit3", NpgsqlTypes.NpgsqlDbType.Numeric, command, null);
            }

            try { command.ExecuteNonQuery(); }catch (Exception e) { MessageBox.Show(e.Message.ToString(), "Error"); }
            con.Close();
        }
Esempio n. 9
0
 public double getcalculableHours(EffortEntry e)
 {
     //abgerechenbare stunden (aktivitäten) zurückgeben
     return(1.09); //zum testen weilß null kann auch kein wert
 }
Esempio n. 10
0
        internal List <EffortEntry> GetEntriesByPurchaser(Purchaser p, int month, int year)
        {
            NpgsqlConnection con = DB.DBConnector.GetConnection();


            PersonalAssistantDAO pDao = new PersonalAssistantDAO();

            NpgsqlCommand command = new NpgsqlCommand(null, con);

            command.CommandText = "SELECT eintragId,von,bis,tag,abrechenbareKm,taetigkeit1,taetigkeit2,taetigkeit3,paid From leistungseintrag WHERE agId=@agId AND monat=@monat AND jahr=@jahr";

            DB.DBConnector.AddToCommand("@agId", NpgsqlTypes.NpgsqlDbType.Numeric, command, p.Id);
            DB.DBConnector.AddToCommand("@monat", NpgsqlTypes.NpgsqlDbType.Numeric, command, month);
            DB.DBConnector.AddToCommand("@jahr", NpgsqlTypes.NpgsqlDbType.Numeric, command, year);

            NpgsqlDataReader reader = command.ExecuteReader();

            List <EffortEntry> ees = new List <EffortEntry>();

            while (reader.Read())
            {
                EffortEntry ee = new EffortEntry();
                ee.Pa        = new PersonalAssistant();
                ee.Purchaser = p;

                if (!reader.IsDBNull(0))
                {
                    ee.Id = reader.GetInt32(0);
                }
                if (!reader.IsDBNull(1))
                {
                    String   timeString = reader.GetString(1);
                    String[] times      = timeString.Split(':');
                    ee.From = new DateTime(2000, 1, 1, int.Parse(times[0]), int.Parse(times[1]), 0);
                }
                if (!reader.IsDBNull(2))
                {
                    String   timeString = reader.GetString(2);
                    String[] times      = timeString.Split(':');
                    ee.To = new DateTime(2000, 1, 1, int.Parse(times[0]), int.Parse(times[1]), 0);
                }
                if (!(reader.IsDBNull(3)))
                {
                    ee.Day = reader.GetInt32(3);
                }
                if (!(reader.IsDBNull(4)))
                {
                    ee.Km = reader.GetInt32(4);
                }
                if (!(reader.IsDBNull(5)))
                {
                    ee.A1      = new Activity();
                    ee.A1.Name = (Activity.State)(reader.GetInt32(5) - 1);
                }
                if (!(reader.IsDBNull(6)))
                {
                    ee.A2      = new Activity();
                    ee.A2.Name = (Activity.State)(reader.GetInt32(6) - 1);
                }
                if (!(reader.IsDBNull(7)))
                {
                    ee.A3      = new Activity();
                    ee.A3.Name = (Activity.State)(reader.GetInt32(7) - 1);
                }
                if (!reader.IsDBNull(8))
                {
                    ee.Pa.Id = reader.GetInt32(8);
                }
            }
            con.Close();

            foreach (EffortEntry ee in ees)
            {
                pDao.select(ee.Pa);
            }

            return(ees);
        }
Esempio n. 11
0
        public static void TestPersonDao()
        {
            TestMonthlyBilling();
            //TestPurchaser();
            PersonalAssistant    p    = new PersonalAssistant();
            PersonalAssistantDAO pDAO = new PersonalAssistantDAO();

            p.FirstName              = "testpersonDao";
            p.LastName               = "testpersonDao";
            p.PhoneNumber            = "9999";
            p.MobilePhone            = "99999";
            p.EMail                  = "*****@*****.**";
            p.HomeAdress.City        = "LINZ";
            p.HomeAdress.Country     = "schland";
            p.HomeAdress.DoorNumber  = 11115;
            p.HomeAdress.StairNumber = 2345;
            pDAO.insert(p);
            pDAO.update(p);
            pDAO.select(p);
            pDAO.SelectAll();

            PurchaserDAO purDAO = new PurchaserDAO();
            Purchaser    pur    = new Purchaser();

            pur.FirstName              = "testpersonDao";
            pur.LastName               = "testpersonDao";
            pur.PhoneNumber            = "9999";
            pur.MobilePhone            = "99999";
            pur.EMail                  = "*****@*****.**";
            pur.HomeAdress.City        = "LINZ";
            pur.HomeAdress.Country     = "schland";
            pur.HomeAdress.DoorNumber  = 11115;
            pur.HomeAdress.StairNumber = 2345;
            purDAO.Insert(pur);
            purDAO.Update(pur);
            purDAO.Select(pur);
            purDAO.SelectAll();

            PurchaserData    pd    = new PurchaserData();
            PurchaserDataDAO pdDao = new PurchaserDataDAO();

            pd.AssistenceDemand     = 20;
            pd.CareAllowance        = 1;
            pd.CareAllowanceMaximum = 22;
            pd.HourlyRate           = 12;
            pd.HourlyRatePayoff     = 13;
            pd.Income                = 1000;
            pd.InputIncome           = 2000;
            pd.Month                 = 2;
            pd.Year                  = 2000;
            pd.TravellingAllowance   = 15;
            pd.TravellingAllowanceKM = 25;
            pd.Purchaser             = pur;
            pdDao.Insert(pd);
            pdDao.Update(pd);
            pdDao.Select(pd);
            pdDao.SelectAll();

            MonthlyBillingPerPa mb    = new MonthlyBillingPerPa();
            MonthlyBillingDAO   mbDAO = new MonthlyBillingDAO();

            mb.Pa           = p;
            mb.Pur          = pd;
            mb.WorkingHours = 20;
            mb.PrivateKm    = 20;
            mb.EffortList   = new List <EffortEntry>();
            mb.Month        = 2;
            mb.Year         = 2000;
            mbDAO.InsertMonthlyBilling(mb);
            // mbDAO.InsertMonthlyBilling(mb);
            List <MonthlyBilling> mbs = mbDAO.selectAllMB();

            mbDAO.UpdateMonthlyBillingEntry(mb);

            // EffortEntry
            EffortEntry ee = new EffortEntry();

            ee.From         = DateTime.Today;
            ee.To           = DateTime.Today;
            ee.Month        = 2;
            ee.Year         = 2000;
            ee.Pa           = new PersonalAssistant();
            ee.Pa.Id        = p.Id;
            ee.Purchaser    = new Purchaser();
            ee.Purchaser.Id = pur.Id;
            ee.A1           = new Activity();
            ee.A1.Name      = (Activity.State) 1;
            ee.A2           = new Activity();
            ee.A2.Name      = (Activity.State) 2;

            EffortEntryDAO eeDAO = new EffortEntryDAO();

            eeDAO.InsertEntry(ee);
            eeDAO.GetEntries(p.Id, pur.Id, ee.Month, ee.Year);
            ee.A1.Name = (Activity.State) 3;
            eeDAO.UpdateEntry(ee);
            PersonalAssistant pa = new PersonalAssistant();

            pa.Id = 10;
            List <EffortEntry> ees = eeDAO.GetEntriesByPa(pa, 2, 1999);

            pur.Id = 199;
            ees    = eeDAO.GetEntriesByPurchaser(pur, 2, 1999);



            //TestPurchaser();

            /*// testPurchaser();
             * PurchaserDataDAO purdadao = new PurchaserDataDAO();
             * PurchaserData purda = new PurchaserData();
             * purda.purchaser.id = 998;
             * purda.month = 2;
             * purda.year = 2015;
             * purdadao.select(purda);
             *
             *
             * Purchaser pur = new Purchaser();
             * pur.id = 999;
             * PurchaserDAO purDao = new PurchaserDAO();
             * pur = purDao.select(pur);
             *
             *
             * /*
             * Person p = new Person();
             * IPersonDAO Pdao = new PersonDAO();
             *
             * //test Insert
             * p.firstName = "testpersonDao";
             * p.lastName = "testpersonDao";
             * p.phoneNumber = 9999;
             * p.mobilePhone = 99999;
             * p.eMail = "*****@*****.**";
             * p.homeAdress.city = "LINZ";
             * p.homeAdress.country = "schland";
             * p.homeAdress.doorNumber = 11115;
             * p.homeAdress.stairNumber = 2345;
             * Pdao.insert(p);
             *
             * //test update
             * p.homeAdress.city = "WIEN";
             * p.homeAdress.street = "updatestraße";
             * p.firstName = "updateName";
             * p.eMail = "updateEmail";
             * Pdao.update(p);
             *
             *
             *
             * Person p2 = new Person();
             * p2.id = p.id;
             *
             * //test select
             * Pdao.select(p);
             * Console.WriteLine(p.firstName);
             * Console.WriteLine(p.homeAdress.city);
             */
            //test pdao

            /* PersonalAssistant p = new PersonalAssistant();
             * PersonalAssistantDAO Pdao = new PersonalAssistantDAO();
             *
             *
             *
             * //test Insert
             * p.firstName = "Susanne";
             * p.lastName = "Ludwig";
             * p.phoneNumber = 9999;
             * p.mobilePhone = 99999;
             * p.eMail = "*****@*****.**";
             * p.homeAdress.city = "Wartberg";
             * //p.ClosingDateDocuments = new DateTime(1999, 12, 12);
             * Pdao.insert(p);
             *
             * /*
             * p.firstName = "paHans";
             * p.lastName = "paMeinzl";
             * p.homeAdress.city = "paWien";
             * p.active = true;
             * p.ClosingDateDocuments = DateTime.Today;
             * Pdao.insert(p);
             * p.homeAdress.city = "paUpdateLinz";
             *
             * Pdao.update(p);
             * Pdao.select(p);
             *
             * Console.Write(Pdao.SelectAll().ElementAt(0).lastName);
             */
        }
Esempio n. 12
0
        //-----------------------------------------------------------------------------------------------------

        public EffortEntry GetEntry(EffortEntry ee)
        {
            return(null);
        }
Esempio n. 13
0
        public static void setUp(TestContext testContext)
        {
            eeDao = new EffortEntryDAO();
            mbDao = new MonthlyBillingDAO();
            pdDao = new PurchaserDataDAO();
            paDao = new PersonalAssistantDAO();
            Purchaser p = new Purchaser();

            //Person Insert
            p.FirstName              = "testpersonDao";
            p.LastName               = "testpersonDao";
            p.PhoneNumber            = "9999";
            p.MobilePhone            = "99999";
            p.EMail                  = "*****@*****.**";
            p.HomeAdress.Street      = "Am Hügel";
            p.HomeAdress.HouseNumber = 12;
            p.HomeAdress.City        = "LINZ";
            p.HomeAdress.Country     = "schland";
            p.HomeAdress.DoorNumber  = 11115;
            p.HomeAdress.StairNumber = 2345;
            p.HomeAdress.Etage       = 2;
            p.HomeAdress.ZipCode     = 5040;
            p.IBAN          = "AT1254859888898";
            p.BIC           = "SPPR2586XX";
            p.AccountHolder = "Helmut Günther";
            p.SVN           = 1225020496;
            p.nationality   = "Auenland";
            p.InfoField     = "Infotext";

            //purchaser
            p.Active            = true;
            p.ApprovalBegin     = new DateTime(2015, 05, 02);
            p.ApprovalEnd       = new DateTime(2017, 05, 02);
            p.EntryDate         = new DateTime(2015, 05, 02);
            p.hasContract       = true;
            p.hasIntroCourse    = true;
            p.DistrictCommision = "Perg";

            //purchaserData
            d                       = new PurchaserData();
            d.Purchaser             = p;
            d.AssistenceDemand      = 12;
            d.CareAllowance         = 2;
            d.HourlyRate            = 30;
            d.HourlyRatePayoff      = 20;
            d.Income                = 29;
            d.InputIncome           = 100;
            d.Month                 = 11;
            d.TravellingAllowance   = 12;
            d.TravellingAllowanceKM = 11;
            d.CareAllowanceMaximum  = 16;
            d.Year                  = 1998;

            pa = new PersonalAssistant();
            //Person Insert
            pa.FirstName              = "persöhnlicher";
            pa.LastName               = "assistent";
            pa.PhoneNumber            = "9999";
            pa.MobilePhone            = "99999";
            pa.EMail                  = "*****@*****.**";
            pa.HomeAdress.Street      = "Am Hügel";
            pa.HomeAdress.HouseNumber = 12;
            pa.HomeAdress.City        = "LINZ";
            pa.HomeAdress.Country     = "schland";
            pa.HomeAdress.DoorNumber  = 11115;
            pa.HomeAdress.StairNumber = 2345;
            pa.HomeAdress.Etage       = 2;
            pa.HomeAdress.ZipCode     = 5040;
            pa.IBAN          = "AT1254859888898";
            pa.BIC           = "SPPR2586XX";
            pa.AccountHolder = "Helmut Günther";
            pa.SVN           = 1225020496;
            pa.nationality   = "Auenland";
            pa.InfoField     = "Infotext";

            //pa
            pa.Active = true;
            pa.ClosingDateDocuments = new DateTime(2016, 02, 03);
            pa.SV            = true;
            pa.Dienstvertrag = true;
            pa.BestBH        = true;
            pa.Grundkurs     = true;
            pa.consumedHours = 2.4M;
            pa.deadLineHours = new DateTime(2017, 02, 04);

            pa              = paDao.insert(pa);
            d               = pdDao.Insert(d);
            mb              = new MonthlyBillingPerPa();
            mb.PrivateKm    = 21;
            mb.Month        = 7;
            mb.Year         = 1998;
            mb.Pa           = pa;
            mb.Pur          = d;
            mb.WorkingHours = 15;
            mb.BillableKm   = 10;


            effortEntries = new List <EffortEntry>();
            EffortEntry a = new EffortEntry();

            a.Month     = mb.Month;
            a.Year      = mb.Year;
            a.Pa        = mb.Pa;
            a.Purchaser = mb.Pur.Purchaser;
            a.Day       = 1;
            a.From      = new DateTime(a.Year, a.Month, a.Day, 12, 30, 0);
            a.To        = new DateTime(a.Year, a.Month, a.Day, 18, 45, 0);
            a.Km        = 10;
            a.A1        = new Activity(Activity.State.Begleitung);
            a.A2        = new Activity(Activity.State.Hauswirtschaft);
            EffortEntry b = new EffortEntry();

            b.Month     = mb.Month;
            b.Year      = mb.Year;
            b.Pa        = mb.Pa;
            b.Purchaser = mb.Pur.Purchaser;
            b.Day       = 2;
            b.From      = new DateTime(b.Year, b.Month, b.Day, 12, 30, 0);
            b.To        = new DateTime(b.Year, b.Month, b.Day, 18, 45, 0);
            b.Km        = 10;
            b.A1        = new Activity(Activity.State.Begleitung);
            b.A2        = new Activity(Activity.State.Hauswirtschaft);

            effortEntries.Add(a);
            effortEntries.Add(b);
        }
Esempio n. 14
0
        public List <MonthlyBilling> selectAllFrom(DateTime?nullable)
        {
            List <MonthlyBilling> mb     = new List <MonthlyBilling>();
            MonthlyBilling        mb1    = new MonthlyBilling();
            MonthlyBilling        mb2    = new MonthlyBilling();
            MonthlyBillingPerPa   mbppa1 = new MonthlyBillingPerPa();
            MonthlyBillingPerPa   mbppa2 = new MonthlyBillingPerPa();
            MonthlyBillingPerPa   mbppa3 = new MonthlyBillingPerPa();
            MonthlyBillingPerPa   mbppa4 = new MonthlyBillingPerPa();
            MonthlyBillingPerPa   mbppa5 = new MonthlyBillingPerPa();

            mb1.Month = 6;
            mb1.Year  = 2015;

            mb2.Month = 5;
            mb2.Year  = 2015;
            EffortEntry e1 = new EffortEntry(2011, 06, 12,
                                             new Purchaser(new Person("Hansi", "Müller", new Adress("Teststrasse", 2, 2323, "City"))), new PersonalAssistant(new Person("Elisabeth", "Schütz", new Adress("Hausstrasse", 12, 3445, "Linz"))), new DateTime(2011, 5, 6), new DateTime(2012, 7, 7), 22);

            EffortEntry e2 = new EffortEntry(2011, 06, 12,
                                             new Purchaser(new Person("Lisa", "Bauer", new Adress("Hochstrasse", 34, 7654, "Town"))), new PersonalAssistant(new Person("Hans", "Kunz", new Adress("testtest", 87, 6354, "Enns"))), new DateTime(2013, 5, 6), new DateTime(2015, 7, 7), 242);


            EffortEntry e3 = new EffortEntry(2011, 06, 12,
                                             new Purchaser(new Person("Thomas", "Mann", new Adress("Klammstrasse", 2, 2323, "City"))), new PersonalAssistant(new Person("Uwe", "Lamm", new Adress("Hausstrasse", 12, 1234, "Steyr"))), new DateTime(2011, 5, 6), new DateTime(2012, 7, 7), 22);

            EffortEntry e4 = new EffortEntry(2011, 06, 12,
                                             new Purchaser(new Person("Tom", "Bauer", new Adress("Friedlstrasse", 344, 9876, "Hall"))), new PersonalAssistant(new Person("Julia", "Niedermaier", new Adress("Lastenstrasse", 56, 6354, "Wels"))), new DateTime(2013, 5, 6), new DateTime(2015, 7, 7), 242);

            e1.A1      = new Activity();
            e1.A2      = new Activity();
            e1.A3      = new Activity();
            e1.A1.Name = new Activity.State();
            e1.A2.Name = new Activity.State();
            e1.A3.Name = new Activity.State();
            e1.A1.Name = Activity.State.Nachtbereitschaft;
            e1.A2.Name = Activity.State.Grundversorgung;
            e1.A3.Name = Activity.State.Begleitung;
            e1.Day     = 1;
            e1.Month   = 2;
            e1.Year    = 2015;
            e1.From    = new DateTime(2015, 2, 1, 10, 23, 00);

            e1.To = new DateTime(2015, 2, 1, 20, 00, 00);

            e1.Km = 15;

            e2.A1      = new Activity();
            e2.A2      = new Activity();
            e2.A1.Name = new Activity.State();
            e2.A2.Name = new Activity.State();
            e2.A1.Name = Activity.State.Begleitung;
            e2.A2.Name = Activity.State.Freizeitgestaltung;
            e2.Day     = 3;
            e2.Month   = 7;
            e2.Year    = 2015;
            e2.From    = new DateTime(2015, 7, 3, 6, 20, 00);
            e2.To      = new DateTime(2015, 7, 3, 6, 20, 00);

            e2.Km = 15;


            e3.A1      = new Activity();
            e3.A2      = new Activity();
            e3.A1.Name = new Activity.State();
            e3.A2.Name = new Activity.State();
            e3.A1.Name = Activity.State.Begleitung;
            e3.A2.Name = Activity.State.Freizeitgestaltung;
            e3.Day     = 3;
            e3.Month   = 7;
            e3.Year    = 2015;
            e3.From    = new DateTime();
            e3.From.AddHours(12);
            e3.From.AddMinutes(00);
            e3.To = new DateTime();
            e3.To.AddHours(15);
            e3.To.AddMinutes(00);
            e3.Km = 15;

            e4.A1      = new Activity();
            e4.A2      = new Activity();
            e4.A1.Name = new Activity.State();
            e4.A2.Name = new Activity.State();
            e4.A1.Name = Activity.State.Begleitung;
            e4.A2.Name = Activity.State.Freizeitgestaltung;
            e4.Day     = 3;
            e4.Month   = 7;
            e4.Year    = 2015;
            e4.From    = new DateTime(2015, 2, 1, 07, 25, 00);

            e4.To = new DateTime(2015, 2, 1, 16, 00, 00);

            e4.Km = 15;

            mbppa1.EffortList = new List <EffortEntry>();
            mbppa2.EffortList = new List <EffortEntry>();
            mbppa3.EffortList = new List <EffortEntry>();

            mbppa1.EffortList.Add(e2);
            mbppa1.EffortList.Add(e1);
            mbppa1.EffortList.Add(e4);

            mbppa2.EffortList.Add(e3);
            mbppa2.EffortList.Add(e4);

            mbppa1.BillableKm                  = 22;
            mbppa1.Pa                          = new PersonalAssistant(new Person("Franz", "Müller", new Adress("Sandl", 2, 2345, "Altstadt")));
            mbppa1.Pur                         = new PurchaserData();
            mbppa1.Pur.Purchaser.Active        = true;
            mbppa1.Pur.Purchaser.FirstName     = "Hugo";
            mbppa1.Pur.Purchaser.LastName      = "Huber";
            mbppa1.Pur.Purchaser.MobilePhone   = "982374283745";
            mbppa1.Pur.Purchaser.EntryDate     = new DateTime(2010, 12, 12);
            mbppa1.Pur.Purchaser.EMail         = "*****@*****.**";
            mbppa1.Pur.Purchaser.ApprovalBegin = new DateTime(2015, 01, 01);
            mbppa1.Pur.Purchaser.ApprovalEnd   = new DateTime(2015, 12, 31);
            mbppa1.Pur.Purchaser.ContactPerson = new Person("Maria", "Huber", new Adress("Hauptstrasse", 12, 4040, "Linz"));
            mbppa1.Pur.Purchaser.Employees     = new List <EmploymentStatus>();
            EmploymentStatus e0 =
                new EmploymentStatus(
                    new PersonalAssistant(new Person("Brigitte", "Fritte",
                                                     new Adress("Landstrasse", 22, 4209, "Engerwitzdorf"))), mbppa1.Pur.Purchaser);
            EmploymentStatus e5 =
                new EmploymentStatus(
                    new PersonalAssistant(new Person("Max", "Moritz",
                                                     new Adress("Maienweg", 22, 4209, "Engerwitzdorf"))), mbppa1.Pur.Purchaser);

            mbppa1.Pur.Purchaser.HomeAdress  = new Adress("Heimatstrasse", 124, 2345, "Wien");
            mbppa1.Pur.Purchaser.PhoneNumber = "28374937453987";

            mbppa1.Pur.Income      = 1500;
            mbppa1.Pur.InputIncome = 150;
            mbppa1.Pur.Month       = 6;
            mbppa1.Pur.Year        = 2015;

            mbppa1.Pur.TravellingAllowanceKM = (decimal)0.22;
            mbppa1.Pur.HourlyRate            = 20;
            mbppa1.Pur.HourlyRatePayoff      = (decimal)20.5;
            mbppa1.Pur.CareAllowanceMaximum  = 300;
            mbppa1.Pur.CareAllowance         = 2;
            mbppa1.Pur.AssistenceDemand      = 60;

            mbppa2.BillableKm                  = 34;
            mbppa2.Pa                          = new PersonalAssistant(new Person("Franz", "Müller", new Adress("Sandl", 2, 2345, "Altstadt")));
            mbppa2.Pur                         = new PurchaserData();
            mbppa2.Pur.Purchaser.Active        = true;
            mbppa2.Pur.Purchaser.FirstName     = "Hugo";
            mbppa2.Pur.Purchaser.LastName      = "Huber";
            mbppa2.Pur.Purchaser.MobilePhone   = "982374283745";
            mbppa2.Pur.Purchaser.EntryDate     = new DateTime(2010, 12, 12);
            mbppa2.Pur.Purchaser.EMail         = "*****@*****.**";
            mbppa2.Pur.Purchaser.ApprovalBegin = new DateTime(2015, 01, 01);
            mbppa2.Pur.Purchaser.ApprovalEnd   = new DateTime(2015, 12, 31);
            mbppa2.Pur.Purchaser.ContactPerson = new Person("Maria", "Huber", new Adress("Hauptstrasse", 12, 4040, "Linz"));
            mbppa2.Pur.Purchaser.Employees     = new List <EmploymentStatus>();
            EmploymentStatus e9 =
                new EmploymentStatus(
                    new PersonalAssistant(new Person("Brigitte", "Fritte",
                                                     new Adress("Landstrasse", 22, 4209, "Engerwitzdorf"))), mbppa2.Pur.Purchaser);
            EmploymentStatus e7 =
                new EmploymentStatus(
                    new PersonalAssistant(new Person("Max", "Moritz",
                                                     new Adress("Maienweg", 22, 4209, "Engerwitzdorf"))), mbppa2.Pur.Purchaser);

            mbppa2.Pur.Purchaser.HomeAdress  = new Adress("Heimatstrasse", 124, 2345, "Wien");
            mbppa2.Pur.Purchaser.PhoneNumber = "28374937453987";

            mbppa2.Pur.Income      = 1500;
            mbppa2.Pur.InputIncome = 150;
            mbppa2.Pur.Month       = 6;
            mbppa2.Pur.Year        = 2015;

            mbppa2.Pur.TravellingAllowanceKM = (decimal)0.22;
            mbppa2.Pur.HourlyRate            = 20;
            mbppa2.Pur.HourlyRatePayoff      = (decimal)20.5;
            mbppa2.Pur.CareAllowanceMaximum  = 300;
            mbppa2.Pur.CareAllowance         = 2;
            mbppa2.Pur.AssistenceDemand      = 60;

            mb1.MbPerPaList = new List <MonthlyBillingPerPa>();
            mb2.MbPerPaList = new List <MonthlyBillingPerPa>();

            mb1.MbPerPaList.Add(mbppa1);
            mb1.MbPerPaList.Add(mbppa2);

            mb2.MbPerPaList.Add(mbppa2);
            List <MonthlyBilling> list = new List <MonthlyBilling>();

            list.Add(mb1);
            list.Add(mb2);

            return(list);
        }
Esempio n. 15
0
        public void ModifyEntry(EffortEntry e)
        {
            EffortEntryDAO eDao = new EffortEntryDAO();

            eDao.UpdateEntry(e);
        }
Esempio n. 16
0
        public void DoEffortEntry(EffortEntry e)
        {
            EffortEntryDAO eDao = new EffortEntryDAO();

            eDao.InsertEntry(e);
        }
Esempio n. 17
0
        public void deleteEntry(EffortEntry e)
        {
            EffortEntryDAO eDAO = new EffortEntryDAO();

            eDAO.deleteEntry(e);
        }