You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
4.0 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Data;
  8. using System.Windows.Forms;
  9. #region 程式異動記錄
  10. ///程式代號:MainPage
  11. ///程式名稱:系統主頁面
  12. ///程式說明:
  13. ///xx.YYYY/MM/DD VER AUTHOR COMMENTS(說明修改的內容)
  14. ///01.2012/07/25 1.0 Ethan CREATE
  15. #endregion
  16. namespace OT.Web
  17. {
  18. public partial class MainPage : Ap_Code.BasePage
  19. {
  20. #region 自定義變量區
  21. // 自定義變量區
  22. #endregion
  23. #region 公有方法區
  24. // 公有方法區
  25. #endregion
  26. #region 私有方法區
  27. // 私有方法區
  28. #endregion
  29. #region 頁面事件觸發區
  30. // 頁面事件觸發區
  31. #region Page_Load
  32. /// <summary>
  33. /// 頁面加載事件
  34. /// </summary>
  35. /// <param name="sender"></param>
  36. /// <param name="e"></param>
  37. protected void Page_Load(object sender, EventArgs e)
  38. {
  39. if (!IsPostBack)
  40. {
  41. OT.BLL.CommonClass o_Common_BLL = new OT.BLL.CommonClass();
  42. DataSet dsFunction = o_Common_BLL.GetProgramListByModuleID("", gstrUserID);
  43. DataTable dbProgramLs = dsFunction.Tables[3];
  44. //OT.BLL.OTB_SYS_ProgramList o_TB_SYS_ProgramList_BLL = new OT.BLL.OTB_SYS_ProgramList();
  45. //int intEndRecordIndex = o_TB_SYS_ProgramList_BLL.GetListCount("", "", "");
  46. //DataTable dbProgramLs = new DataTable();
  47. //dbProgramLs = fnDataSetToDataTable(o_TB_SYS_ProgramList_BLL.GetList(0, intEndRecordIndex, "", "", "", ""));
  48. string strHTML = string.Empty;
  49. strHTML += "<table id='gvSearchResult' >";
  50. for (int intRows = 0; intRows < dbProgramLs.Rows.Count; intRows++)
  51. {
  52. strHTML += "<tr>";
  53. //產生所有資料
  54. for (int intCount = 0; intCount < dbProgramLs.Columns.Count; intCount++)
  55. {
  56. strHTML += "<td name=" + dbProgramLs.Columns[intCount].ColumnName + ">" + dbProgramLs.Rows[intRows][intCount].ToString();
  57. strHTML += "</td>";
  58. }
  59. //strHTML += "<td>" + dbProgramLs.Rows[intRows]["ProgramID"].ToString() + "</td>";
  60. //strHTML += "<td>" + dbProgramLs.Rows[intRows]["ProgramName"].ToString() + "</td>";
  61. //strHTML += "<td>" + dbProgramLs.Rows[intRows]["FilePath"].ToString() + "</td>";
  62. //strHTML += "<td>" + dbProgramLs.Rows[intRows]["grouptag"].ToString() + "</td>";
  63. strHTML += "</tr>";
  64. }
  65. strHTML += "</table>";
  66. divProgramList.InnerHtml = (strHTML);
  67. //頁面第一次加載
  68. //ltrLoginName.Text = "Hello!!!" + GetUserNameByUserId(gstrUserID);//當前登錄者
  69. HttpCookie FullScreen = new HttpCookie("isFullScreen");
  70. FullScreen = Request.Cookies["isFullScreen"];
  71. HttpCookie Already = new HttpCookie("Already");
  72. Already = Request.Cookies["Already"];
  73. DateTime now = DateTime.Now;
  74. if (FullScreen == null && Already != null)
  75. {
  76. Already.Value = now.ToString();
  77. Already.Expires = now.AddYears(-1);
  78. Response.Cookies.Add(Already);
  79. SendKeys.SendWait("{F11}");
  80. }
  81. if (FullScreen != null && Already == null)
  82. {
  83. Already = new HttpCookie("Already");
  84. Already.Value = now.ToString();
  85. Already.Expires = now.AddYears(1);
  86. Response.Cookies.Add(Already);
  87. SendKeys.SendWait("{F11}");
  88. }
  89. }
  90. }
  91. #endregion
  92. #endregion
  93. }
  94. }