Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lbUserOnline.Text = int.Parse(Application["TotalOnlineUsers"].ToString()).ToString(" 0 คน");

            if (!this.IsPostBack)
            {
                string          sql = "SELECT COUNT('id') AS EmpSum FROM tbl_emp_profile WHERE emp_staus_working = '1'";
                MySqlDataReader rs  = dBScript.selectSQL(sql);
                if (rs.Read())
                {
                    lbCountEmp.Text = "ทั้งหมด " + rs.GetString("EmpSum") + " คน";
                }
                rs.Close();
                BindDataLeave();
                BindRetire();
                dBScript.CloseConnection();

                string sql_guest = "SELECT guest_offer_date FROM  tbl_guest ORDER BY STR_TO_DATE(guest_offer_date, '%d-%m-%Y') DESC ";
                LabelGuest.Text = "รายการล่าสุด " + dBScript.convertDateShortThai(dBScript.GetSelectData(sql_guest));

                lbYear.Text  = dBScript.getBudgetYear();
                txtYear.Text = dBScript.getBudgetYear();
            }
            if (Session["User"] != null)
            {
                if (dBScript.Notallow(new string[] { "5" }, Session["UserPrivilegeId"].ToString()))
                {
                    Response.Redirect("/Profile/empViwe");
                }

                if (dBScript.Notallow(new string[] { "5", "4", "3" }, Session["UserPrivilegeId"].ToString()))
                {
                    boxChangPos.Visible   = false;
                    boxMigrateEmp.Visible = false;
                    boxResignEmp.Visible  = false;
                }
            }
        }