protected void Grid1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var item = new PigeonCms.Message(); item = (PigeonCms.Message)e.Row.DataItem; LinkButton LnkSubject = (LinkButton)e.Row.FindControl("LnkSubject"); string subject = Utility.Html.GetTextPreview(item.Title, 50, ""); if (item.IsRead) LnkSubject.Text = subject; else LnkSubject.Text = "<b>" + subject + "</b>"; Literal LitBody = (Literal)e.Row.FindControl("LitBody"); LitBody.Text = Utility.Html.GetTextPreview(item.Description, 200, ""); Literal LitDateInserted = (Literal)e.Row.FindControl("LitDateInserted"); LitDateInserted.Text = item.DateInserted.ToString(); //Starred if (item.IsStarred) { Image img1 = (Image)e.Row.FindControl("ImgStarredOk"); img1.Visible = true; } else { Image img1 = (Image)e.Row.FindControl("ImgStarredKo"); img1.Visible = true; } } }
public void ShowMessage(int recordId) { var obj = new PigeonCms.Message(); MultiView1.ActiveViewIndex = VIEW_MESSAGE_INDEX; clearMessage(); CurrentId = recordId; if (CurrentId > 0) { obj = new MessagesManager().GetByKey(CurrentId); obj2message(obj); } }