Exemple #1
0
        public ResultBM UpdateProfile(ProfileBM profile)
        {
            try
            {
                log.AddLogInfo("Actualizando perfil", "Creando perfil.", this);
                ProfileDAL profileDal    = new ProfileDAL();
                ResultBM   isValidResult = IsValid(profile);

                if (!isValidResult.IsValid())
                {
                    return(isValidResult);
                }
                profileDal.DeleteRelation(profile.code);
                CreateRelation(profile);

                log.AddLogInfo("Actualizando perfil", "El perfil se ha actualizado exitosamente.", this);
                return(new ResultBM(ResultBM.Type.OK, "Perfil actualizado."));
            }
            catch (Exception exception)
            {
                log.AddLogCritical("Recuperando perfil", exception.Message, this);
                return(new ResultBM(ResultBM.Type.EXCEPTION, SessionHelper.GetTranslation("UPDATING_ERROR") + " " + exception.Message, exception));
            }
        }