public string AddMat(DynamicTableEntity entity) { string hp = PaperStore.ActionToHtmlPresentation(entity); lock (this.builder) this.builder.AppendLine(hp); fishSetting(entity); return(hp); }
public PaperRoll(string vote_id) { this.VoteId = vote_id; PaperStore.GetAllActions(vote_id, entity => { string hp = PaperStore.ActionToHtmlPresentation(entity); this.builder.AppendLine(hp); fishSetting(entity); }); }
public object CreateVote(CreateVoteData data) { string user_name = UserCenter.Act(data.session_key); if (user_name == null) { return new { code = ResultCode.InvalidSession } } ; string vote_id = PaperStore.CreatePaper(user_name); return(new { code = ResultCode.Success, vote_id = vote_id }); }
public object AddActions(AddActionData data) { string user_name = UserCenter.Act(data.session_key); if (user_name == null) { return new { code = ResultCode.InvalidSession } } ; // Prevent XSS attack. //for (int i = 0; i < data.actions.Length; i++) // data.actions[i].value = HttpContext.Current.Server.HtmlEncode(data.actions[i].value); // Encode at output instead of input. string[] hps = PaperStore.AddActions(data.vote_id, user_name, data.actions); VoteBroadcaster.HubContext.Clients.Group(data.vote_id).onNewActions(hps); return(new { code = ResultCode.Success, }); }