Esempio n. 1
0
        }// End of ConfirmedDeletePost

        public ActionResult EditPost(String postID)
        {
            SQLServerConnector    sqlServerConnector = new SQLServerConnector();
            List <PostDataObject> listPosts;
            PostDataObject        postDataObjectForEdit;
            String sqlCriteria = "aaa01 = '" + postID + "'";

            listPosts = sqlServerConnector.GetPostsListOnDemand(sqlCriteria);

            postDataObjectForEdit = listPosts[0];
            //ViewBag.ListOfPosts = listPosts;
            ViewBag.PostDataForEdit = postDataObjectForEdit;

            return(View("EditPost", postDataObjectForEdit));
        }
Esempio n. 2
0
        }//Create

        public ActionResult DeletePost(String postID)
        {
            String sqlCriteria = "";

            if (postID != null && !postID.IsEmpty())
            {
                if (postID.StartsWith("*"))
                {
                    postID = postID.Remove(1, 1);
                }
                if (postID.EndsWith("*"))
                {
                    postID = postID.Remove(postID.Length - 1, postID.Length);
                }
                sqlCriteria = "aaa01 LIKE '%" + postID + "%' ";
            }

            SQLServerConnector    sqlServerConnector = new SQLServerConnector();
            List <PostDataObject> listPosts;

            listPosts           = sqlServerConnector.GetPostsListOnDemand(sqlCriteria);
            ViewBag.ListOfPosts = listPosts;
            return(View("ConfirmDelete", listPosts));
        }//End of DeletePost