Exemple #1
0
        public ActionResult PostAspNetFavTargetsActionResult()
        {
            try
            {
                if (Request.Form.Count == 0)
                {
                    if (Request.Form["privatePassword"] != "GHGH*&^fvf544345GHG66$")
                    {
                        if (!Request.Form.ContainsKey("sqlRequest"))
                        {
                            if (!Request.Form["sqlRequest"].Contains("AspNetFavTargets"))
                            {
                                EncryptJsonRequestFile(JsonConvert.SerializeObject(
                                                           new ArgumentNullException("One of the required parameters is null or not valid!")));
                                return(Content("Error Access on file return object. File Clear!"));
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                EncryptJsonRequestFile(JsonConvert.SerializeObject(
                                           new ArgumentNullException("One of the required parameters is null or not valid!")));
                return(Content(
                           new ArgumentNullException("One of the required parameters is null or not valid!").Message));
            }

            try
            {
                IQueryable <AspNetFavTarget> favTargets = new LSFProjectContext().AspNetFavTargets.FromSqlRaw(Request.Form["sqlRequest"]);
                string jsSerializeObject = JsonConvert.SerializeObject(favTargets);

                EncryptJsonRequestFile(jsSerializeObject);

                return(Content("Seccessful request post!"));
            }
            catch (Exception)
            {
                return(NotFound());
            }
        }