예제 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            // 只有首次執行才會執行的程式
            // AUO Login in
            ClsLogin.auth();

            CatchSystemTime();

            Label9.Text = "歡迎您的登入!今天日期為 " + currentDate + ",祝您有個愉快的一天!";

            // 測試用日期
            //currentDate = "2019-07-12";

            // SELECT data from MySQL database
            SQL = "SELECT h.MFGday, h.OVERTIME, h.DN, p.WNUM ,h.NAME FROM h_hr_manpower_daily_actual_name h LEFT OUTER JOIN personal_data p ON(h.NAME = p.NAME) WHERE h.MFGday = \"" + currentDate + "\" AND ( h.OVERTIME = \"當班\" OR h.OVERTIME = \"加班\" ) AND (h.DN = \"" + currentShift + "\")";

            InquiryMySQLData();

            GridView1.DataSource = dataTable; //告訴GridView資料來源為誰
            GridView1.DataBind();             //綁定

            DisconnectMySQL();

            //ClsLogin.Right("PC|領班|大領班", "抱歉您沒有權限!", "'0230221'");
        }

        if (Session["W_ID"] == null)
        {
            ClsLogin.auth();
        }
    }