Пример #1
0
        private void LoadPhoto()
        {
            int    _PhotoID = 0;
            string SitePath = ConfigurationManager.AppSettings["SitePath"].ToString();

            if (Request.QueryString["pid"] != null)
            {
                _PhotoID = Convert.ToInt32(Request.QueryString["pid"]);

                string _Scripts = "<script type=\"text/javascript\">var _PhotoID=\"" + _PhotoID.ToString() + "\";</script>";
                _Scripts = _Scripts + "\n<script type=\"text/javascript\">var _SitePath=\"" + SitePath + "\"</script>";
                _Scripts = _Scripts + "\n" + "<script src=\"" + SitePath + "Scripts/js_fun.js\" type=\"text/javascript\"></script>";

                ltScripts.Text = _Scripts;

                int _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);

                bool _HasUserAlreadyReported = new PhotoReport().HasUserReportedAlready(_UserID, _PhotoID);

                if (_HasUserAlreadyReported)
                {
                    divOptions.Visible         = false;
                    divAlreadyReported.Visible = true;
                }
            }
            if (Request.QueryString["path"] != null)
            {
                imgPhoto.Src = Request.QueryString["path"].ToString();
            }
        }
        // POST api/<controller>
        public bool Post([FromBody] ReportPhotoCls PhotoReportObj)
        {
            int  _UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);
            bool Res     = new PhotoReport().ReportPhotoAbuse(_UserID, PhotoReportObj.PhotoUserID, PhotoReportObj.PhotoID, PhotoReportObj.ReportType, PhotoReportObj.Comment);

            return(Res);
        }