protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (HttpContext.Current.User.Identity.Name == "" || HttpContext.Current.User.Identity.Name == null) { try { Response.Redirect("LogOut"); } catch (Exception) { } } else { int UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name); Photo[] _Photos = new Photo().GetUserPhotosBasedOnUserID(UserID); int _Count = _Photos.Count(); int _ValidationCount = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["PhotoCount"]); if (_Count < _ValidationCount) { divUploadPics.Visible = true; divPhotoValdation.Visible = false; string _Scripts = ""; List <string> _LoadCss = new List <string>(); _LoadCss.Add("web\\css\\photoupload"); _LoadCss.Add("web\\js\\photoupload\\fbphotoselector"); List <string> _LoadJs = new List <string>(); _LoadJs.Add("web\\js\\addphotos\\oauth"); _LoadJs.Add("web\\js\\addphotos\\instafeed"); _LoadJs.Add("web\\js\\addphotos\\google"); _LoadJs.Add("web\\js\\addphotos\\dropbox"); _LoadJs.Add("web\\js\\addphotos\\instagram"); _LoadJs.Add("web\\js\\addphotos\\fbphotos"); _LoadJs.Add("web\\js\\addphotos\\fbphotoselector"); _LoadJs.Add("web\\js\\addphotos\\onedrive"); _LoadJs.Add("web\\js\\addphotos\\addphotos"); _Scripts = _Scripts + "\n" + Helper.LoadCSS(_LoadCss.ToArray()); _Scripts = _Scripts + "\n" + Helper.LoadScripts(_LoadJs.ToArray(), new List <string>().ToArray(), false); string SitePath = ConfigurationManager.AppSettings["SitePath"].ToString(); ltScripts.Text = _Scripts; string _SitePath = ConfigurationManager.AppSettings["SitePath"].ToString(); btnBrowse.Attributes.Add("data-url", _SitePath + "web/inner/multiplephotoupload"); } else { divPhotoValdation.Visible = true; divUploadPics.Visible = false; } } } }
public bool Label() { for (int i = 0; i < Photo.Count(); i++) { if (Photo[i].GetAttribute("aria-label") != null) { ; } else { return(false); } } return(true); }
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); } }