/*驗貨情況*/ void prepareProcessCommentList() { string sqlstr = "select 0 as Form_No, '' as comment union(select Form_No, comment from Verify) order by Form_No "; CommentList.DataSource = mydb.GetDataTable(sqlstr); CommentList.DataBind(); }
/// <summary> /// チャンネル情報の初期化 /// </summary> public void InitChannelInfo() { VideoId = ""; BcUrl = ""; ChatId = ""; CommentList.Clear(); }
public ActionResult Index(string articleId) { int id = int.Parse(articleId); var Article = db.Articles .Where(x => x.Id == id) .Include(x => x.Type) .Include(x => x.Author) .Include(x => x.Ingridients) .First(); using (db) { var comms = db.Comments .Where(r => r.ArticleId == Article.Id) .Where(x => !x.IsDeleted) .Include(x => x.Author); CommentList model = new CommentList() { Comments = comms.ToArray() }; ViewBag.ArticleId = articleId; ViewData["Article"] = Article; return(View(model)); } }
/// <summary> /// コメントをGUIに登録する /// </summary> /// <param name="workCommentList"></param> private void SetCmntToGui(IList <CommentStruct> workCommentList) { // 登録済みの最新コメントを取得 for (int iComment = 0; iComment < workCommentList.Count; iComment++) { CommentStruct tagtComment = workCommentList[iComment]; // 新規のコメントの場合、リストに追加する CommentList.Add(tagtComment); System.Diagnostics.Debug.WriteLine("■{0} {1}", tagtComment.UserName, tagtComment.Text); // 最大コメント数チェック if (CommentList.Count > MaxStoredCommentCnt) { CommentList.RemoveAt(0); System.Diagnostics.Debug.Assert(CommentList.Count == MaxStoredCommentCnt); } if (OnCommentReceiveEach != null) { OnCommentReceiveEach(this, tagtComment); } } if (OnCommentReceiveDone != null) { OnCommentReceiveDone(this); } }
public ActionResult Index(string requestId) { int id = int.Parse(requestId); var request = db.Requests .Where(x => x.Id == id) .Where(x => x.IsDeleted == false) .Include(x => x.Document) .Include(x => x.Category) .Include(x => x.Subject) .Include(x => x.Author) .Include(x => x.Executor) .First(); using (db) { var comms = db.Comments .Where(r => r.RequestId == request.Id) .Where(x => !x.IsDeleted) .Include(x => x.Author); CommentList model = new CommentList() { Comments = comms.ToArray() }; ViewBag.requestId = requestId; ViewData["Request"] = request; return(View(model)); } }
// GET: Articles/Details/5 public ActionResult Details(int?id) { ViewModelResult model = new ViewModelResult(); try { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CommentList cmtList = new CommentList(); var comments = cmtList.getListComment(id); ArticleList art = new ArticleList(); var details = art.getDetailArticle(id); model = new ViewModelResult { articleDetail = details, listComment = comments }; } catch (Exception e) { CommonUse.WriteLogError(e); } return(View(model)); }
public Entry(XmlElement element) { Id = Util.ChildValue(element, "id"); Title = Util.ChildValue(element, "title"); Link = Util.ChildValue(element, "link"); Published = DateTime.Parse(Util.ChildValue(element, "published")); Updated = DateTime.Parse(Util.ChildValue(element, "updated")); User = new User(Util.ChildElement(element, "user")); Service = new Service(Util.ChildElement(element, "service")); Comments = new CommentList(); foreach (XmlElement child in element.GetElementsByTagName("comment")) { Comments.Add(new Comment(child)); } Likes = new LikeList(); foreach (XmlElement child in element.GetElementsByTagName("like")) { Likes.Add(new Like(child)); } Media = new MediaList(); foreach (XmlElement child in element.GetElementsByTagName("media")) { Media.Add(new Media(child)); } }
public ActionResult Index(string requestSolutionId) { int id = int.Parse(requestSolutionId); var requestSolution = db.RequestSolutions .Where(x => x.Id == id) .Include(x => x.Document) .Include(x => x.Author) .First(); using (db) { var comms = db.Comments .Where(r => r.ReqId == requestSolution.Id) .Where(x => !x.IsDeleted) .Include(x => x.Author); CommentList model = new CommentList() { Comments = comms.ToArray() }; ViewBag.requestSolutionId = requestSolutionId; ViewData["MathTaskSolution"] = requestSolution; return(View(model)); } }
public void Load(PictureViewModel picture) { this.picture = picture; CommentList.Load(picture?.PictureUri); RefreshState(); ApplicationStateService.PropertyChanged += (s, e) => RefreshState(); }
void OnEnable() { if (EditorPrefs.HasKey("CommentObjectPath")) { string objectPath = EditorPrefs.GetString("CommentObjectPath"); comments = AssetDatabase.LoadAssetAtPath(objectPath, typeof(CommentList)) as CommentList; } }
public static CommentList Create() { CommentList asset = ScriptableObject.CreateInstance <CommentList>(); AssetDatabase.CreateAsset(asset, "Assets/Comments.asset"); AssetDatabase.SaveAssets(); return(asset); }
public CommentList GetComments() { CommentList comment = new CommentList(); comment = Services.GetInstance.GetComments(); return(comment); }
private void AddPage(int pageNum) { CommentList Page = new CommentList(_story, pageNum); Page.PropertyChanged += PageLoaded; Pages.Add(Page); ((FrameworkElement)Pivot.Items[pageNum - 1]).DataContext = Page; }
/// <summary> /// Add reaction to the last comment /// </summary> /// <param name="teamProjectName"></param> /// <param name="workItemID"></param> /// <param name="reactionType"></param> private static void AddReactionToLastComment(string teamProjectName, int workItemID, CommentReactionType reactionType) { CommentList comments = WitClient.GetCommentsAsync(teamProjectName, workItemID).Result; var reaction = WitClient.CreateCommentReactionAsync(teamProjectName, workItemID, comments.Comments.ElementAt(0).Id, reactionType).Result; Console.WriteLine("{0} - {1}\n", reaction.Type, reaction.Count); }
/// <summary> /// コメントをGUIに登録する /// </summary> /// <param name="workCommentList"></param> private void setCmntToGui(IList <CommentStruct> workCommentList) { // 登録済みの最新コメントを取得 CommentStruct prevComment = new CommentStruct(); if (CommentList.Count > 0) { prevComment = CommentList[CommentList.Count - 1]; } // 新しいコメントから順にチェック int iStPos = 0; // 未登録のコメントの開始位置 for (int iComment = workCommentList.Count - 1; iComment >= 0; iComment--) { CommentStruct tagtComment = workCommentList[iComment]; // 登録済みかチェック if (tagtComment.Id == prevComment.Id) { iStPos = iComment + 1; // 登録済みのコメントの次のコメントが未登録の開始位置 System.Diagnostics.Debug.WriteLine("found stored comment."); break; } } if (iStPos == workCommentList.Count) { // すべて登録済み return; } // 新規分だけ登録 for (int iComment = iStPos; iComment < workCommentList.Count; iComment++) { CommentStruct tagtComment = workCommentList[iComment]; // 新規のコメントの場合、リストに追加する CommentList.Add(tagtComment); System.Diagnostics.Debug.WriteLine("■{0} {1} {2}", tagtComment.UserName, tagtComment.Text, tagtComment.TimeStr); System.Diagnostics.Debug.WriteLine("■ThumbUrl " + tagtComment.UserThumbUrl); // 最大コメント数チェック if (CommentList.Count > MaxStoredCommentCnt) { CommentList.RemoveAt(0); System.Diagnostics.Debug.Assert(CommentList.Count == MaxStoredCommentCnt); } if (OnCommentReceiveEach != null) { OnCommentReceiveEach(this, tagtComment); } } if (OnCommentReceiveDone != null) { OnCommentReceiveDone(this); } }
protected void Page_Load(object sender, EventArgs e) { if (!User.Identity.IsAuthenticated) { RedirectToLoginPage(); } CommentList.DataSource = AuctionList_GetData(); CommentList.DataBind(); }
/// <summary> /// Get all commeent in work item /// </summary> /// <param name="teamProjectName"></param> /// <param name="workItemID"></param> private static void GetWorkitemComments(string teamProjectName, int workItemID) { CommentList comments = WitClient.GetCommentsAsync(teamProjectName, workItemID).Result; foreach (var comment in comments.Comments) { Console.WriteLine("{0} - {1}\n{2}", comment.CreatedDate, comment.CreatedBy.DisplayName, comment.Text); } }
/// <summary> /// コメント行の追加を行います。 /// </summary> public void AddComment(string comment) { if (string.IsNullOrEmpty(comment)) { return; } CommentList.Add(comment); }
public async Task <List <Comments> > GetCommentListAsync(CommentList data) { var list = data.CommentId; var getList = await _context.Comments.Where(x => x.CommentId == data.CommentId).ToListAsync(); _context.Comments.RemoveRange(getList); return(getList); }
public Post(string senderId, string title, string body, List <string> disableList) { SenderId = senderId; Title = title; Body = body; LikerIdList = new List <string>(); CommentList = new CommentList(); DisableList = new List <string>(disableList); }
public ActionResult List(int id) { var commentmodel = new CommentList(); commentmodel.ThreadId = id; commentmodel.Comments = this.commentService.GetCommentsByThreadId(id); return(View(commentmodel)); }
public Post(string postId, Post post) { PostId = postId; SenderId = post.SenderId; Title = post.Title; Body = post.Body; Time = new MyTime(DateTime.Now); LikerIdList = new List <string>(); CommentList = new CommentList(); DisableList = new List <string>(post.DisableList); }
/// <summary> /// チャンネル情報の初期化 /// </summary> public void InitChannelInfo() { ChannelName = ""; BcUrl = ""; BcStatus = 0; MovieId = 0; lastBcCmntCnt = 0; lastBcCmntId = 0; pendingCntForOffLine = 0; CommentList.Clear(); }
/// <summary> /// Update the last comment /// </summary> /// <param name="teamProjectName"></param> /// <param name="workItemID"></param> /// <param name="message"></param> private static void UpdateLastComment(string teamProjectName, int workItemID, string message) { CommentList comments = WitClient.GetCommentsAsync(teamProjectName, workItemID).Result; var comment = WitClient.UpdateCommentAsync(new CommentUpdate() { Text = message }, teamProjectName, workItemID, comments.Comments.ElementAt(0).Id).Result; Console.WriteLine("{0} - {1}\n{2}", comment.CreatedDate, comment.CreatedBy.DisplayName, comment.Text); }
private async Task RequestShortComments() { if (_currCommentType == CommentType.Long) { _currCommentType = CommentType.Short; } var shortComment = await DataRequester.RequestShortComment(CurrentStoryId, _currCommentType == CommentType.Long?null : LastCommentId); if (shortComment != null) { CommentList.Last().AddRange(shortComment.comments); } }
public int getpos(int pos) { int num = pos - this.head; for (CommentList commentList = this.comments; commentList != null; commentList = commentList.tail) { if (pos > commentList.spos) { num += commentList.len; } } return(num); }
private async Task RequestNormalComments() { if (_currCommentType == CommentType.Recommend) { _currCommentType = CommentType.Normal; } var normalComments = await DataRequester.RequestNormalComments(CurrentStoryId, _currCommentType == CommentType.Recommend?null : LastCommentId); if (normalComments != null) { CommentList.Last().AddRange(normalComments.Comments); } }
//public string AuctionCommentIndent(int cid) { // // considering this is all cached, this should be highly efficient // var str = ""; // var parentCommentID = Comment.LoadID(cid).ParentCommentID; // if (parentCommentID == null) { // str = ""; // } else { // var parentparentCommentID = Comment.LoadID(parentCommentID.Value).ParentCommentID; // str = parentparentCommentID == null ? " class=\"reply1\"" : " class=\"reply2\""; // } // return str; //} //public static CommentList GetCommentHierarchy(Auction auction=null, BuyNowItem buyNow=null) { // var fkName = auction!=null? "auctionID": "buyNowItemID"; // var fkValue = auction!=null? auction.ID: buyNow.ID; // var hierarchy = new CommentList(); // var comments = CommentList.Load(new Sql("select * from Comment where "+fkName+"=", fkValue, "and status=", Comment.CommentStatus.Approved.ToString().SqlizeText(), " order by CommentDate Desc")); // foreach (var comment in comments) { // if (comment.ParentCommentID == null) { // // top level comment // comment.Depth = 0; // hierarchy.Add(comment); // AddChildren(hierarchy, comment, 1, comments); // } // } // return hierarchy; //} private static void AddChildren(CommentList hierarchy, Comment parentComment, int depth, CommentList allComments) { foreach (var checkComment in allComments) { if (checkComment.ParentCommentID == parentComment.ID) { var childComment = checkComment; childComment.Depth = depth; hierarchy.Add(childComment); AddChildren(hierarchy, childComment, depth + 1, allComments); } } }
public void OnShowAll() { bool check = true; if (check) { if (Selected == null) { List <City> listaGradova = new List <City>(); CitiesList.Clear(); City c = new City(); listaGradova = c.GetAllCitiesListDone(); foreach (var item in listaGradova) { CitiesList.Add(item); } List <Comment> com = new List <Comment>(); Comment ccc = new Comment(); CommentList.Clear(); com = ccc.GetAllComment(); foreach (var item in com) { CommentList.Add(item); } } else { List <City> listaGradova = new List <City>(); City c = new City(); c.CityName = Selected.CityName; List <Comment> com = new List <Comment>(); Comment ccc = new Comment(); CommentList.Clear(); com = ccc.GetAllCommentSelected(c.CityName.ToString()); foreach (var item in com) { CommentList.Add(item); } Selected = null; } } }
private void InitCommentInfo() { if (CommentList.Count == 0) { CommentList.Add(new GroupComments() { GroupName = StringUtil.GetCommentGroupName(CommentType.Long, CurrentStoryExtraInfo.long_comments.ToString()) }); CommentList.Add(new GroupComments() { GroupName = StringUtil.GetCommentGroupName(CommentType.Short, CurrentStoryExtraInfo.short_comments.ToString()) }); } }
private void InitCommentInfo() { if (CommentList.Count == 0) { CommentList.Add(new GroupComments() { GroupName = StringUtil.GetCommentGroupName(CommentType.Recommend, CurrentStoryExtraInfo.Count.Post_Reasons.ToString()) }); CommentList.Add(new GroupComments() { GroupName = StringUtil.GetCommentGroupName(CommentType.Normal, CurrentStoryExtraInfo.Count.Normal_Comments.ToString()) }); } }
internal static CommentList getCommentsList(HttpResponseMessage responce) { var commentList = new CommentList(); var jsonObj = JsonConvert.DeserializeObject<Dictionary<string, object>>(responce.Content.ReadAsStringAsync().Result); if (jsonObj.ContainsKey("comments")) { var commentsArray = JsonConvert.DeserializeObject<List<object>>(jsonObj["comments"].ToString()); foreach(var commentObj in commentsArray) { var comment = new Comment(); comment = JsonConvert.DeserializeObject<Comment>(commentObj.ToString()); commentList.Add(comment); } } return commentList; }
private static void GenerateWorksheetCommentsPartContent(WorksheetCommentsPart worksheetCommentsPart, XLWorksheet xlWorksheet) { var comments = new Comments(); var commentList = new CommentList(); var authorsDict = new Dictionary<String, Int32>(); foreach (var c in xlWorksheet.Internals.CellsCollection.GetCells(c => c.HasComment)) { var comment = new Comment {Reference = c.Address.ToStringRelative()}; var authorName = c.Comment.Author; Int32 authorId; if (!authorsDict.TryGetValue(authorName, out authorId)) { authorId = authorsDict.Count; authorsDict.Add(authorName, authorId); } comment.AuthorId = (UInt32)authorId; var commentText = new CommentText(); foreach (var rt in c.Comment) { commentText.Append(GetRun(rt)); } comment.Append(commentText); commentList.Append(comment); } var authors = new Authors(); foreach (var author in authorsDict.Select(a => new Author {Text = a.Key})) { authors.Append(author); } comments.Append(authors); comments.Append(commentList); worksheetCommentsPart.Comments = comments; }
// Generates content of worksheetCommentsPart1. private void GenerateWorksheetCommentsPart1Content(WorksheetCommentsPart worksheetCommentsPart1) { Comments comments1 = new Comments(); Authors authors1 = new Authors(); Author author1 = new Author(); author1.Text = "Author"; authors1.Append(author1); CommentList commentList1 = new CommentList(); Comment comment1 = new Comment() { Reference = "V10", AuthorId = (UInt32Value)0U, ShapeId = (UInt32Value)0U }; CommentText commentText1 = new CommentText(); Run run14 = new Run(); RunProperties runProperties14 = new RunProperties(); Bold bold1 = new Bold(); FontSize fontSize1 = new FontSize() { Val = 9D }; Color color1 = new Color() { Indexed = (UInt32Value)81U }; RunFont runFont1 = new RunFont() { Val = "Tahoma" }; RunPropertyCharSet runPropertyCharSet1 = new RunPropertyCharSet() { Val = 1 }; runProperties14.Append(bold1); runProperties14.Append(fontSize1); runProperties14.Append(color1); runProperties14.Append(runFont1); runProperties14.Append(runPropertyCharSet1); Text text14 = new Text(); text14.Text = "Author:"; run14.Append(runProperties14); run14.Append(text14); Run run15 = new Run(); RunProperties runProperties15 = new RunProperties(); FontSize fontSize2 = new FontSize() { Val = 9D }; Color color2 = new Color() { Indexed = (UInt32Value)81U }; RunFont runFont2 = new RunFont() { Val = "Tahoma" }; RunPropertyCharSet runPropertyCharSet2 = new RunPropertyCharSet() { Val = 1 }; runProperties15.Append(fontSize2); runProperties15.Append(color2); runProperties15.Append(runFont2); runProperties15.Append(runPropertyCharSet2); Text text15 = new Text() { Space = SpaceProcessingModeValues.Preserve }; text15.Text = "\nThis is a comment"; run15.Append(runProperties15); run15.Append(text15); commentText1.Append(run14); commentText1.Append(run15); comment1.Append(commentText1); commentList1.Append(comment1); comments1.Append(authors1); comments1.Append(commentList1); worksheetCommentsPart1.Comments = comments1; }