示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] == null)
            {
                Response.Redirect("/");
            }

            txtEmp_id.Enabled = false;
            if (!this.IsPostBack)
            {
                string sql = "SELECT emp_id,CONCAT(emp_name,' ',emp_lname) AS emp_name FROM tbl_emp_profile ep where emp_staus_working = '1' ORDER BY emp_name";
                dBScript.GetDownList(txtEmp, sql, "emp_name", "emp_id");
                txtEmp.Items.Insert(0, new ListItem("", ""));
                BindData();
                BindDataHis();

                string sql_cpoint = "SELECT * FROM tbl_cpoint";
                dBScript.GetDownList(txtCpoint, sql_cpoint, "cpoint_name", "cpoint_id");

                btnSave.Visible = false;
            }
            if (Session["User"] != null)
            {
                if (dBScript.Notallow(new string[] { "5", "4", "3" }, Session["UserPrivilegeId"].ToString()))
                {
                    Response.Redirect("/");
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["User"] != null)
     {
         if (dbScript.Notallow(new string[] { "5", "4", "3", "2" }, Session["UserPrivilegeId"].ToString()))
         {
             Response.Redirect("/");
         }
     }
 }
示例#3
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;
                }
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserPrivilegeId"] == null)
            {
                Response.Redirect("/");
            }
            if (Session["User"] != null)
            {
                if (dBScript.Notallow(new string[] { "5", "4", "3", "2" }, Session["UserPrivilegeId"].ToString()))
                {
                    Response.Redirect("/");
                }
            }

            if (!this.IsPostBack)
            {
                string sql_privilege = "SELECT * FROM tbl_privilege ORDER BY privilege_name";
                dBScript.GetDownList(txtPrivilege, sql_privilege, "privilege_name", "privilege_id");

                BindData();
            }
        }