コード例 #1
0
        private async Task PersonSaveCmdExec(object p)
        {
            PersonViewModel personViewModel = p as PersonViewModel;

            PersonRepository personDataAccess = new PersonRepository();

            if (null == Personen)
            {
                Personen = new ObservableCollection <PersonViewModel>();
            }

            PersonViewModel personToExchange = Personen.SingleOrDefault(x => x.Id == personViewModel.Id);

            if (null != personToExchange)
            {
                personViewModel.Modified   = DateTime.Now;
                personViewModel.ModifiedBy = "Auch Rolf";

                await personDataAccess.Update(personViewModel.Id, personViewModel);

                Personen.Remove(personToExchange);
                Personen.Add(personViewModel);
            }
            else
            {
                await personDataAccess.Insert(personViewModel);

                Personen.Add(personViewModel);
            }
        }
コード例 #2
0
 public void VerwijderPersoon()
 {
     if (Personen.Count > 0)
     {
         Personen.Remove(SelectedPersoon); ////Verwijder nog Persoon via MockDataservice
     }
 }
コード例 #3
0
        public ActionResult FirmaZuordnenNeu(int Id)
        {
            Personen p = db.Personens.Where(x => x.Id == Id).FirstOrDefault();

            firmList = db.Firmen.ToList();

            return(View(p));
        }
コード例 #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            Personen personen = db.Personens.Find(id);

            db.Personens.Remove(personen);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #5
0
 /// <summary>
 /// Verwijdert een persoon uit de lijst
 /// Persoon mag niet null zijn
 /// </summary>
 /// <param name="persoon"></param>
 /// <returns>
 /// Wel of niet verwijderd
 /// </returns>
 public bool VerwijderPersoon(Persoon persoon)
 {
     if (persoon == null)
     {
         throw new ArgumentNullException("persoon", "persoon mag niet null zijn");
     }
     return(Personen.Remove(persoon));
 }
コード例 #6
0
        private void ExecuteCreatePerson(object selectedPerson)
        {
            var person = new Person();

            Personen.Add(person);
            _repository.Insert(person);
            AusgewähltePerson = person;
        }
コード例 #7
0
 void ReloadPersonen()
 {
     _dispatcher.Invoke(() =>
     {
         AktuellePerson = null;
         Personen.Clear();
         Personen.AddRange(_personRepository.GetAll().Select(x => new PersonenViewModel(x)));
     });
 }
コード例 #8
0
        public SonntagEinstellungenViewModel()
        {
            foreach (var az in DataContainer.AufgabenPersonZuordnung.OrderBy(x => x.PersonName))
            {
                Personen.Add(new SonntagEinstellungenItem(az));
            }

            ButtonNewCommand = new DelegateCommand(ButtonNew);
        }
コード例 #9
0
 public ActionResult Edit([Bind(Include = "Id,Vorname,Nachname,Geburtstag,EmailAdr,TelNummer")] Personen personen)
 {
     if (ModelState.IsValid)
     {
         db.Entry(personen).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(personen));
 }
コード例 #10
0
        public NavViewViewModel()
        {
            Projekte = new ObservableCollection <ProjektDomaenenDVO>();

            Projekte.Clear();
            Personen.Clear();

            persRepo.All().ForEach(p => Personen.Add(p));
            repo.AllProjekte().ForEach(r => Projekte.Add(r));
        }
コード例 #11
0
        public ActionResult Create([Bind(Include = "Id,Vorname,Nachname,Geburtstag,EmailAdr,TelNummer,Geburtsjahr")] Personen personen)
        {
            if (ModelState.IsValid)
            {
                db.Personens.Add(personen);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(personen));
        }
コード例 #12
0
        public void VoegPersoonToe()
        {
            if (_visitor == null)
            {
                return;
            }

            Persoon p = new Persoon();

            _visitor.DynamicVisit(p);
            Personen.Add(p);  //voeg nog toe aan MockDataservice
        }
コード例 #13
0
ファイル: RechnungViewModel.cs プロジェクト: mKFHTW/SWEClient
        public void UpdateComboBox()
        {
            Personen.Clear();

            foreach (Models.Person item in Personen)
            {
                if (item.Vorname.Contains(Kundenname) || item.Nachname.Contains(Kundenname))
                {
                    Personen.Add(item);
                }
            }
        }
コード例 #14
0
        public AdressbuchDbContext(string connectionString) : base(connectionString)
        {
            Database.SetInitializer <AdressbuchDbContext>(null);

            Configuration.LazyLoadingEnabled = false;
            this.Database.CreateIfNotExists();

            if (Personen.Count() == 0)
            {
                InitializeData();
            }
        }
コード例 #15
0
        private void ExecuteRemovePerson(object obj)
        {
            var personToRemove = obj as Person;

            if (personToRemove == null)
            {
                return;
            }

            Personen.Remove(personToRemove);
            _repository.Delete(personToRemove.Id);
        }
コード例 #16
0
        public ActionResult FirmaZuordnenNeu(FormCollection fc)
        {
            int      pid = Convert.ToInt32(fc[0]);
            Personen p   = db.Personens.Where(x => x.Id == pid).FirstOrDefault();

            int    fid = Convert.ToInt32(fc[1]);
            Firmen f   = db.Firmen.Where(x => x.Id == fid).FirstOrDefault();

            p.FirmenListe.Add(f);

            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
コード例 #17
0
        private async Task PersonDeleteCmdExec(object p)
        {
            PersonViewModel personViewModel = p as PersonViewModel;

            if (null != Person && Person.Id == personViewModel.Id)
            {
                Person = null;
            }

            PersonRepository personRepository = new PersonRepository();
            await personRepository.Delete(personViewModel.Id);

            Personen.Remove(personViewModel);
        }
コード例 #18
0
        // GET: PersonenEF/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Personen personen = db.Personens.Find(id);

            if (personen == null)
            {
                return(HttpNotFound());
            }
            return(View(personen));
        }
コード例 #19
0
        public ActionResult Create(Personen p)
        {
            try
            {
                p.Id = personenListe.Count + 1;

                personenListe.Add(p);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
コード例 #20
0
        void LoadPersonen(SqliteConnection conn)
        {
            Personen.Clear();

            bool shouldClose = false;

            // Is the database already open?
            if (conn.State != ConnectionState.Open)
            {
                shouldClose = true;
                conn.Open();
            }

            // Execute query
            using (var command = conn.CreateCommand())
            {
                try
                {
                    // Create new command
                    command.CommandText = "SELECT DISTINCT ID FROM [Persoon]";

                    using (var reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            var persoon = new PersoonModel();
                            var id      = (string)reader["ID"];

                            persoon.Load(conn, id);

                            AddPersoon(persoon);
                        }
                    }
                }
                catch (Exception Exception)
                {
                    Debug.WriteLine(Exception.Message);
                }
            }

            if (shouldClose)
            {
                conn.Close();
            }
        }
コード例 #21
0
 /// <summary>
 /// Voegt een persoon toe aan de lijst
 /// </summary>
 /// <param name="persoon"></param>
 public void VoegPersoonToe(Persoon persoon)
 {
     if (persoon == null)
     {
         throw new ArgumentNullException("persoon", "persoon mag niet null zijn");
     }
     foreach (Persoon p in Personen)
     {
         if (p is Medewerker && persoon is Medewerker)
         {
             Medewerker bestaandeMedewerker = p as Medewerker;
             Medewerker nieuweMedewerker    = persoon as Medewerker;
             if (bestaandeMedewerker.MedewerkerID == nieuweMedewerker.MedewerkerID)
             {
                 throw new NumberAlreadyTakenException("Andere medewerker heeft hetzelfde Id");
             }
         }
     }
     Personen.Add(persoon);
 }
コード例 #22
0
        public void SuchePersonen()
        {
            if (string.IsNullOrEmpty(Suchtext)) //Wenn Suchtext == null || leer
            {
                SichtbarePersonen = Personen;   //Gebe Personen aus (ganze Liste)
                return;
            }

            if (Personen == null) //Wenn Liste null => Gebe aus
            {
                return;
            }

            var sichtbarePersonen = Personen //Neue Var = Liste gleich dem Suchtext
                                    .Where(m => m.Name.ToString().ToUpper().Contains(Suchtext.ToUpper()) ||
                                           m.Geburtsjahr.ToString().ToUpper().Contains(Suchtext.ToUpper()) ||
                                           m.Herkunft.ToUpper().Contains(Suchtext.ToUpper()) ||
                                           m.Beruf.ToUpper().Contains(Suchtext.ToUpper()));

            SichtbarePersonen = new BindableCollection <PersonModel>(sichtbarePersonen); //SichtbarePersonen = Neue Var
        }
コード例 #23
0
        private void InitializeData()
        {
            Person rolf = new Person()
            {
                Id = Guid.NewGuid(), Name = "Jansen", Vorname = "Rolf", Geburtsdatum = new DateTime(1962, 2, 24), Created = DateTime.Now, Modified = DateTime.Now, CreatedBy = "Rolf", ModifiedBy = "Rolf"
            };
            Person susanne = new Person()
            {
                Id = Guid.NewGuid(), Name = "Weitzel-Jansen", Vorname = "Susanne", Geburtsdatum = new DateTime(1966, 3, 1), Created = DateTime.Now, Modified = DateTime.Now, CreatedBy = "Rolf", ModifiedBy = "Rolf"
            };
            Person max = new Person()
            {
                Id = Guid.NewGuid(), Name = "Jansen", Vorname = "Maximilian", Geburtsdatum = new DateTime(2000, 4, 8), Created = DateTime.Now, Modified = DateTime.Now, CreatedBy = "Rolf", ModifiedBy = "Rolf"
            };
            Person alex = new Person()
            {
                Id = Guid.NewGuid(), Name = "Jansen", Vorname = "Alexander", Geburtsdatum = new DateTime(2007, 9, 7), Created = DateTime.Now, Modified = DateTime.Now, CreatedBy = "Rolf", ModifiedBy = "Rolf"
            };

            Personen.AddRange(new Person[] { rolf, susanne, max, alex });

            SaveChanges();
        }
コード例 #24
0
ファイル: RechnungViewModel.cs プロジェクト: mKFHTW/SWEClient
        public void ProceedPersonen()
        {
            Personen.Clear();

            XmlDocument xml = new XmlDocument();

            xml.LoadXml(Proxy.Instance.Response);

            XmlElement root = xml.DocumentElement;

            foreach (XmlNode item in root.ChildNodes)
            {
                if (item.Name == "Person")
                {
                    Models.Person person = new Models.Person();

                    foreach (XmlNode line in item.ChildNodes)
                    {
                        if (line.Name == "ID")
                        {
                            person.ID = line.InnerText;
                        }
                        if (line.Name == "Vorname")
                        {
                            person.Vorname = line.InnerText;
                        }
                        if (line.Name == "Nachname")
                        {
                            person.Nachname = line.InnerText;
                        }
                    }

                    Personen.Add(person);
                }
            }
        }
コード例 #25
0
        public void UnpackPersonen(XmlElement root)
        {
            foreach (XmlNode element in root.ChildNodes)
            {
                Models.Person person = new Models.Person();

                foreach (XmlNode item in element.ChildNodes)
                {
                    if (item.Name == "ID")
                    {
                        person.ID = item.InnerText;
                    }
                    if (item.Name == "Vorname")
                    {
                        person.Vorname = item.InnerText;
                    }
                    if (item.Name == "Nachname")
                    {
                        person.Nachname = item.InnerText;
                    }
                    if (item.Name == "Suffix")
                    {
                        person.Suffix = item.InnerText;
                    }
                    if (item.Name == "Titel")
                    {
                        person.Titel = item.InnerText;
                    }
                    if (item.Name == "Adresse")
                    {
                        person.Adresse = item.InnerText;
                    }
                    if (item.Name == "Ort")
                    {
                        person.Ort = item.InnerText;
                    }
                    if (item.Name == "PLZ")
                    {
                        person.PLZ = item.InnerText;
                    }
                    if (item.Name == "RechnungsAdresse")
                    {
                        person.RechnungsAdresse = item.InnerText;
                    }
                    if (item.Name == "RechnungsOrt")
                    {
                        person.RechnungsOrt = item.InnerText;
                    }
                    if (item.Name == "RechnungsPLZ")
                    {
                        person.RechnungsPLZ = item.InnerText;
                    }
                    if (item.Name == "LieferAdresse")
                    {
                        person.LieferAdresse = item.InnerText;
                    }
                    if (item.Name == "LieferOrt")
                    {
                        person.LieferOrt = item.InnerText;
                    }
                    if (item.Name == "LieferPLZ")
                    {
                        person.LieferPLZ = item.InnerText;
                    }
                    if (item.Name == "Firma")
                    {
                        person.Firm = item.InnerText;
                    }
                    if (item.Name == "FirmaID")
                    {
                        person.FirmaID = item.InnerText;
                    }
                    if (item.Name == "Geburtsdatum")
                    {
                        person.GebDatum = Convert.ToDateTime(item.InnerText);
                    }
                }
                Personen.Add(person);
            }
        }
コード例 #26
0
        public void GeneralCommandMethod(object param)
        {
            switch (param as string)
            {
            case "Firma":
                Firmen.Clear();
                SearchFirma();
                Proxy.Instance.Send(data);
                Proxy.Instance.Receive();
                Proceed();
                break;

            case "Person":
                Personen.Clear();
                SearchPerson();
                Proxy.Instance.Send(data);
                Proxy.Instance.Receive();
                Proceed();
                break;

            case "Rechnung":
                Rechnungen.Clear();
                SearchRechnung();
                Proxy.Instance.Send(data);
                Proxy.Instance.Receive();
                Proceed();
                break;

            case "ViewFirma":
                lViewDoubleClickFirma();
                break;

            case "ViewRechnung":
                lViewDoubleClickRechnung();
                break;

            case "ViewPerson":
                lViewDoubleClickPerson();
                break;

            case "AddFirma":
                Firma = new Models.Firma();
                lViewDoubleClickFirma();
                break;

            case "AddPerson":
                Person = new Models.Person();
                lViewDoubleClickPerson();
                break;

            case "AddRechnung":
                Rechnung = new Models.Rechnung();
                lViewDoubleClickRechnung();
                break;

            case "SearchRechnungen":
                Rechnungen.Clear();
                SearchRechnung();
                Proxy.Instance.Send(data);
                Proxy.Instance.Receive();
                Proceed();
                break;

            case "DeleteFirma":
                DeleteFirma();
                Proxy.Instance.Send(data);
                Proxy.Instance.Receive();
                break;

            case "DeletePerson":
                DeletePerson();
                Proxy.Instance.Send(data);
                Proxy.Instance.Receive();
                break;

            default:
                //DetailedInformationWindow window = new DetailedInformationWindow();
                //window.Show();
                break;
            }
        }
コード例 #27
0
ファイル: Reference.cs プロジェクト: heinzsack/DEV
 public static Personen CreatePersonen(global::System.Guid ID)
 {
     Personen personen = new Personen();
     personen.ID = ID;
     return personen;
 }
コード例 #28
0
ファイル: Reference.cs プロジェクト: heinzsack/DEV
 public void AddToPersonen(Personen personen)
 {
     base.AddObject("Personen", personen);
 }
コード例 #29
0
 public ProductivityController(Personen personen)
 {
     this.personen = personen;
 }
コード例 #30
0
 public UploadController(Personen personen, Arbeit arbeit)
 {
     this.personen = personen;
     this.arbeit   = arbeit;
 }
コード例 #31
0
 public void WähleÄltestePersonAus()
 {
     AusgewähltePerson = Personen.OrderByDescending(p => p.Alter).First();
 }
コード例 #32
0
        private void ButtonNew()
        {
            var az = DataContainer.AufgabenZuordnungAdd();

            Personen.Add(new SonntagEinstellungenItem(az));
        }