Exemple #1
0
        public JsonResult SXSS_S1_CommentList()
        {
            SXSS_S1_CommentListResponse response = XSS_BusinessServices.SXSS_S1_CommentList(Session.SessionID);
            string commentListHTML = RazorViewToString.RenderRazorViewToString(this, "~/Views/Xss/StoredXss/_CommentList.cshtml", response);

            return(Json(new object[] { commentListHTML, response }));
        }
Exemple #2
0
        public JsonResult SXSS_S1_Comment(SXSS_S1_CommentRequest request)
        {
            SXSS_S1_CommentListResponse response = new SXSS_S1_CommentListResponse();

            if (!GoogleRecaptchaControl(request.SXSS_S1_CommentRequest_gReCaptcha))
            {
                response.IsSuccess    = false;
                response.Message      = "Not valid gReCaptcha!";
                response.ResponseCode = 400;
            }
            else
            {
                response = XSS_BusinessServices.SXSS_S1_Comment(request);
            }
            string commentListHTML = RazorViewToString.RenderRazorViewToString(this, "~/Views/Xss/StoredXss/_CommentList.cshtml", response);

            return(Json(new object[] { commentListHTML, response }));
        }
Exemple #3
0
        public static SXSS_S1_CommentListResponse SXSS_S1_CommentList(string sessionID)
        {
            SXSS_S1_CommentListResponse response = new SXSS_S1_CommentListResponse();

            using (var dbContext = new MSSQL_EF_CF_Context())
            {
                try
                {
                    response.CommentList = XSS_Mapping.XSS_Comment_To_SXSS_S1_CommentView(dbContext.XSS_Comment.OrderByDescending(x => x.ID).Take(5).ToList());
                }
                catch (Exception ex)
                {
                    response.Message      = "Yorumlar getirilirken hata oluştu! " + ex.Message;
                    response.ResponseCode = 500;
                }
            }
            return(response);
        }
Exemple #4
0
        public static SXSS_S1_CommentListResponse SXSS_S1_Comment(SXSS_S1_CommentRequest request)
        {
            SXSS_S1_CommentListResponse response = new SXSS_S1_CommentListResponse();

            using (var dbContext = new MSSQL_EF_CF_Context())
            {
                try
                {
                    dbContext.XSS_Comment.Add(XSS_Mapping.SXSS_S1_CommentRequest_To_XSS_Comment(request));
                    dbContext.SaveChanges();

                    response.CommentList = XSS_Mapping.XSS_Comment_To_SXSS_S1_CommentView(dbContext.XSS_Comment.OrderByDescending(x => x.ID).Take(5).ToList());
                }
                catch (Exception ex)
                {
                    response.Message      = "Yorum kaydı başarısız" + ex.Message;
                    response.ResponseCode = 500;
                }
            }
            return(response);
        }