FrmSelectAnnouncement.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using LYFZ.Software.MainBusiness.DoorCityProcess;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. namespace LYFZ.Software.MainBusiness.BulletinBoard
  11. {
  12. public partial class FrmSelectAnnouncement : LYFZ.Software.UI.BulletinBoard.FrmSelectAnnouncement
  13. {
  14. public int ID;
  15. public FrmSelectAnnouncement()
  16. {
  17. }
  18. #region 加载
  19. protected override void FrmSelectAnnouncement_Load(object sender, EventArgs e)
  20. {
  21. try
  22. {
  23. if (ID > 0)
  24. {
  25. LYFZ.BLL.BLL_ErpInternalMail bll = new BLL.BLL_ErpInternalMail();
  26. DataTable dt = bll.View_ErpInternalMail("ID=" + ID + "").Tables[0];
  27. if (dt.Rows.Count > 0)
  28. {
  29. txtImail_Attachment.Text = dt.Rows[0]["Imail_Attachment"].ToString();
  30. txtImail_Content.Text = dt.Rows[0]["Imail_Content"].ToString();
  31. lblNR.Text = "发布人(" + dt.Rows[0]["Imail_FromNames"] + ") 时间(" + dt.Rows[0]["Imail_ToSendDatetime"] + ") 内容:";
  32. }
  33. }
  34. }
  35. catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
  36. }
  37. #endregion
  38. #region 查询
  39. protected override void btnSelect_Click(object sender, EventArgs e)
  40. {
  41. if (!string.IsNullOrEmpty(txtImail_Attachment.Text))
  42. {
  43. try
  44. {
  45. // string path = Application.StartupPath + "\\公告\\" + txtImail_Attachment.Text;
  46. string path = BLL.BLL_ErpInternalMail.GetAnnouncementPath() + "\\" + txtImail_Attachment.Text;
  47. System.Diagnostics.Process.Start(path);
  48. }
  49. catch (System.ComponentModel.Win32Exception we) { MessageBoxCustom.Show(we.Message); return; }
  50. }
  51. //if (ID > 0)
  52. //{
  53. // LYFZ.BLL.BLL_ErpInternalMail bll = new BLL.BLL_ErpInternalMail();
  54. // DataTable dt = bll.GetList("ID=" + ID + "").Tables[0];
  55. // if (dt.Rows.Count > 0)
  56. // {
  57. // if (!string.IsNullOrEmpty(dt.Rows[0]["Imail_Attachment"].ToString()))
  58. // {
  59. // byte[] path = PublicCodeClasses.StringToByte(dt.Rows[0]["Fd_PhotoAlbum"].ToString());
  60. // System.Diagnostics.Process.Start(path).ToString();
  61. // }
  62. // }
  63. //}
  64. }
  65. #endregion
  66. #region 取消
  67. protected override void btnClose_Click(object sender, EventArgs e)
  68. {
  69. this.Close();
  70. }
  71. #endregion
  72. }
  73. }