Exemplo n.º 1
0
        public Pacient Put(PacientDTO value)
        {
            Pacient model = IPacientRepository.Get(value.Id);

            if (value.UserName != null)
            {
                model.UserName = value.UserName;
            }
            if (value.FirstName != null)
            {
                model.FirstName = value.FirstName;
            }
            if (value.LastName != null)
            {
                model.LastName = value.LastName;
            }
            if (value.Gender != null)
            {
                model.Gender = value.Gender;
            }
            if (value.BirthDate != null)
            {
                model.BirthDate = value.BirthDate;
            }

            /*
             * if (value.Password != null)
             * {
             *  model.Password = value.Password;
             * }
             */
            return(IPacientRepository.Update(model));
        }
Exemplo n.º 2
0
        public Pacient Put(int id, PacientDTO value)
        {
            Pacient model = IPacientRepository.Get(id);

            if (value.PacientNume != null)
            {
                model.PacientNume = value.PacientNume;
            }

            if (value.PacientPrenume != null)
            {
                model.PacientPrenume = value.PacientPrenume;
            }

            if (value.CNP != null)
            {
                model.CNP = value.CNP;
            }

            if (value.Varsta >= 0)
            {
                model.Varsta = value.Varsta;
            }

            return(IPacientRepository.Update(model));
        }
Exemplo n.º 3
0
        public Pacient Post(PacientDTO value)
        {
            Pacient model = new Pacient()
            {
                PacientNume    = value.PacientNume,
                PacientPrenume = value.PacientPrenume,
                CNP            = value.CNP,
                Varsta         = value.Varsta,
            };

            return(IPacientRepository.Create(model));
        }
Exemplo n.º 4
0
        public Pacient Post(PacientDTO value)
        {
            Pacient model = new Pacient()
            {
                UserName  = value.UserName,
                FirstName = value.FirstName,
                LastName  = value.LastName,
                CNP       = value.CNP,
            };

            return(IPacientRepository.Create(model));
        }
Exemplo n.º 5
0
        public Pacient Post(PacientDTO value)
        {
            Pacient model = new Pacient()
            {
                UserName  = value.UserName,
                FirstName = value.FirstName,
                LastName  = value.LastName,
                Gender    = value.Gender,
                BirthDate = value.BirthDate,
                // Password = value.Password,
            };

            return(IPacientRepository.Create(model));
        }
Exemplo n.º 6
0
        public Pacient Put(int id, PacientDTO value)
        {
            Pacient model = IPacientRepository.Get(id);

            if (value.UserName != null)
            {
                model.UserName = value.UserName;
            }
            if (value.FirstName != null)
            {
                model.FirstName = value.FirstName;
            }
            if (value.LastName != null)
            {
                model.LastName = value.LastName;
            }
            if (value.CNP != null)
            {
                model.CNP = value.CNP;
            }
            return(IPacientRepository.Update(model));
        }