Exemple #1
0
        public IPerson FindByIdNumber(string idnumber)
        {
            var          context     = new TxnFlowDBEntities();
            var          repo        = new DataRepository <Person>(context);
            Person       P           = context.Persons.Where(s => s.id_number == idnumber).FirstOrDefault();
            PersonEntity FoundPerson = new PersonEntity();

            FoundPerson.code      = P.code;
            FoundPerson.name      = P.name;
            FoundPerson.surname   = P.surname;
            FoundPerson.id_number = P.id_number;
            return(FoundPerson);
        }
Exemple #2
0
        public IPerson Find(int id)
        {
            var          context     = new TxnFlowDBEntities();
            var          repo        = new DataRepository <Person>(context);
            Person       P           = repo.FindOne(id);
            PersonEntity FoundPerson = new PersonEntity();

            FoundPerson.code      = P.code;
            FoundPerson.name      = P.name;
            FoundPerson.surname   = P.surname;
            FoundPerson.id_number = P.id_number;
            return(FoundPerson);
        }
Exemple #3
0
        public IEnumerable <IPerson> GetAllPeople()
        {
            var context = new TxnFlowDBEntities();
            var repo    = new DataRepository <Person>(context);
            IEnumerable <Person> ReturnedList = new List <Person>();
            List <PersonEntity>  PersonList   = new List <PersonEntity>();

            ReturnedList = repo.FindAll();

            foreach (Person P in ReturnedList)
            {
                PersonEntity CurrentPerson = new PersonEntity();
                CurrentPerson.code      = P.code;
                CurrentPerson.id_number = P.id_number;
                CurrentPerson.name      = P.name;
                CurrentPerson.surname   = P.surname;
                PersonList.Add(CurrentPerson);
            }

            return(PersonList);
        }
Exemple #4
0
        public IPerson Add()
        {
            IPerson PersonEntity = new PersonEntity();

            return(PersonEntity);
        }