private void DisplayDataForModify() { var repo = new DB_Repository(); Note note = repo.GetNoteById(Convert.ToInt32(_ID)); txtName.Text = note.Name; txtEmail.Text = note.Email; txtHomepage.Text = note.Homepage; txtTitle.Text = note.Title; txtContent.Text = note.Content; //Encodig string encoding = note.Encoding; if (encoding == "Text") { rdoEncoding.SelectedIndex = 0; } else if (encoding == "Mixed") { rdoEncoding.SelectedIndex = 1; } //TODO : 파일처리 }
private void DisplayDataForReply() { var repo = new DB_Repository(); Note note = repo.GetNoteById(Convert.ToInt32(_ID)); txtTitle.Text = $"답변:{note.Title}"; txtContent.Text = $"\n\n작성일:{note.PostDate}, 작성자:'{note.Name}'\n-----------------------------------\n>" + $"{note.Content.Replace("\n", "\n>")}\n-----------------------------------\n"; }
private void DisplayData() { var repo = new DB_Repository(); Note note = repo.GetNoteById(Convert.ToInt32(_Id)); lblNum.Text = _Id; lblName.Text = note.Name; lblEmail.Text = string.Format("<a href='mailto:{0}'>{0}</a>", note.Email); //email을 누르면 바로 작성할 수 있도록 해줌(outlook으로 바로 연동 등) lblTitle.Text = note.Title; string content = note.Content; //인코딩 방식 : text, html, mixed string encoding = note.Encoding; if (encoding == "Text") { lblContent.Text = Helpers.HtmlUtility.EncodeWithTabAndSpace(content); } else if (encoding == "Mixed") { lblContent.Text = content.Replace("\r\n", "<br/>"); } else //html { lblContent.Text = content; //html은 변환없이 출력 } lblReadCount.Text = note.ReadCount.ToString(); lblHomepage.Text = $"<a href='{note.Homepage}' target='_blank'>{note.Homepage}</a>"; lblPostDate.Text = note.PostDate.ToString(); lblPostIP.Text = note.PostIp; if (note.FileName.Length > 1) { lblFile.Text = $"{note.FileName} / 다운로드 {note.DownCount}"; } else { lblFile.Text = "(None)"; } }