Beispiel #1
0
 public bool UpdatePerson(PersonModel person)
 {
     if (PersonsRepository.Update(Core.Transformer.AsDatabaseModel(person)) != null)
     {
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 public bool DeletePerson(int personID)
 {
     try {
         var updatePerson = PersonsRepository.Get().Where(m => m.Id == personID).FirstOrDefault();
         updatePerson.IsDeleted = true;
         if (PersonsRepository.Update(updatePerson) != null)
         {
             return(true);
         }
         return(false);
     }catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
        public ActionResult Edit(Guid id, string name, string lastname, DateTime dob)
        {
            //Instantiate a person type object and assign the event to search by id
            Person person = personRepository.ReadById(id);

            //Checks whether the database id is the same as the searched person
            if (person.Id == id)
            {
                person.Name     = name.ToUpper();
                person.LastName = lastname.ToUpper();
                person.Dob      = dob;

                personRepository.Update(person);
            }
            return(View(person));
        }
 public bool UpdatePerson(Persons entity)
 {
     try
     {
         bool isSuccess;
         using (var repo = new PersonsRepository())
         {
             isSuccess = repo.Update(entity);
         }
         return(isSuccess);
     }
     catch (Exception ex)
     {
         LogHelper.Log(LogTarget.File, ExceptionHelper.ExceptionToString(ex), true);
         throw new Exception("BusinessLogic:PersonsBusiness::UpdatePerson::Error occured.", ex);
     }
 }
Beispiel #5
0
        public bool UpdatePerson(PersonsEntity entity)
        {
            try
            {
                bool bOpDoneSuccessfully;
                using (var repository = new PersonsRepository())
                {
                    bOpDoneSuccessfully = repository.Update(entity);
                }

                return(bOpDoneSuccessfully);
            }
            catch (Exception ex)
            {
                //Log exception error
                _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);

                throw new Exception("BusinessLogic:PersonsBusiness::UpdatePerson::Error occured.", ex);
            }
        }
 public bool Update(Persons person)
 {
     return(ipersonsRepository.Update(person));
 }
        // PUT api/values/5
        public Person Put(int id, [FromBody] Person value)
        {
            var result = _personsRepositoy.Update(value);

            return(_personsRepositoy.LoadById(value.Id));
        }