public ActionResult SeekOnePerson(string id, Person person, string[] Address)
        {
            ObjectId _id;

            ObjectId.TryParse(id, out _id);
            person._id = _id;
            if (Address != null)
            {
                List <string> adresList = Address.ToList();
                person.Address = adresList;
            }
            else
            {
                person.Address = new List <string>();
            }
            if (person._id == default(ObjectId))
            {
                pDal.InsertPerson(person);
            }
            else
            {
                pDal.UpdatePerson(person);
            }
            return(RedirectToAction("LookPersons"));
        }
Beispiel #2
0
        private void Insert()
        {
            var dal = new PersonDal();

            using (BypassPropertyChecks)
            {
                var dto = new PersonDto
                {
                    FirstName = this.FirstName,
                    LastName  = this.LastName
                };
                Id = dal.InsertPerson(dto);
            }
        }
Beispiel #3
0
        protected override void DataPortal_Insert()
        {
            var dal = new PersonDal();

            using (BypassPropertyChecks)
            {
                var dto = new PersonDto
                {
                    FirstName = this.FirstName,
                    LastName  = this.LastName
                };
                Id = dal.InsertPerson(dto);
            }
        }