コード例 #1
0
        public string SaveFeedbackComment(string currentUserId, string commentId, string comment, string appkey)
        {
            if (appkey != Globals.Settings.AppServiceSecureKey)
            {
                return("invalid app key");
            }
            var feedbackcomment = new FeedbackComments
            {
                ID = Convert.ToInt32(Convert.ToInt32(commentId)),
            };

            feedbackcomment.GetById();
            if (feedbackcomment.UserID.ToString() != currentUserId)
            {
                return("invalid user");
            }
            feedbackcomment.Comment = comment;
            feedbackcomment.Update();
            return("OK");
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AppKey = Globals.Settings.AppServiceSecureKey;
            var userInSession = (Users)Session["userinsession"];

            CurrentUserId = userInSession.ID.ToString();
            var id = Page.Request.Params["id"];
            var feedbackcomment = new FeedbackComments
            {
                ID = Convert.ToInt32(id)
            };

            feedbackcomment.GetById();
            if (feedbackcomment.UserID != userInSession.ID)
            {
                tbComment.Visible = btnSave.Visible = false;
                pnlError.Visible  = true;
            }
            CommentId = id;
            if (!IsPostBack)
            {
                tbComment.Text = feedbackcomment.Comment;
            }
        }