Esempio n. 1
0
        public async Task <bool> UpdateProfile(VMProfile profile)
        {
            try
            {
                var resultExist = await _iaccountdata.GetById(profile.Id);

                if (resultExist == null)
                {
                    throw new Exception("Not Exist");
                }

                resultExist.Name           = profile.Name;
                resultExist.Surname        = profile.Surname;
                resultExist.NumberDocument = profile.NumberDocument;
                resultExist.IdRol          = profile.IdRol;
                resultExist.IdTypeDocument = profile.IdTypeDocument;

                var result = await _iaccountdata.EditAsync(resultExist);


                return(result);
            }

            catch (Exception)
            {
                return(false);
            }
        }