// GET api/<controller>
 public DescriptionAnswers[] POST([FromBody] writtendesc _WrittenObj)
 {
     try
     {
         DescriptionAnswers[] _DescriptionAnswers = new DescriptionAnswers().GetAnswers(_WrittenObj.OtherUserID);
         _DescriptionAnswers = _DescriptionAnswers.Where(x => x.Answer.Trim() != "").ToArray();
         return(_DescriptionAnswers);
     }
     catch (Exception)
     {
         return(null);
     }
 }
Esempio n. 2
0
        public List <string> Post(OtherUser _OtherUserObj)
        {
            try
            {
                string _res;
                DescriptionAnswers[] _DescriptionAnswers = new DescriptionAnswers().GetAnswers(_OtherUserObj.OtherUserID);
                _DescriptionAnswers = _DescriptionAnswers.Where(x => x.Answer.Trim() != "").ToArray();
                Photo[] _photos = new Photo().GetApprovedUserPhotos(_OtherUserObj.OtherUserID);
                CriteriaUserAnswer[] _criteria = new CriteriaUserAnswer().GetCriteriaUserAnswers(_OtherUserObj.OtherUserID).Where(x => x.UserOption != null || x.UserOptionDate != null || x.UserOptionMultiple != null || x.UserText != null || x.UserPreferenceMultiple != null || x.UserPreferenceRange != null).ToArray();
                QuestionAnswers <OptionsSingleSelectAnswer, OptionsMultiSelectAnswer>[] _questionAns = new QuestionAnswers <OptionsSingleSelectAnswer, OptionsMultiSelectAnswer>().GetUserAnswers(_OtherUserObj.OtherUserID);

                List <string> _lstTabs = new List <string>();
                if (_DescriptionAnswers.Count() > 0)
                {
                    _lstTabs.Add("aboutme");
                }
                if (_photos.Count() > 0)
                {
                    _lstTabs.Add("photos");
                }
                if (_criteria.Count() > 0)
                {
                    _lstTabs.Add("criteria");
                }
                if (_questionAns.Count() > 0)
                {
                    _lstTabs.Add("questions");
                }

                return(_lstTabs);
            }
            catch (Exception ex)
            {
                return(null);
            }
        }