Ejemplo n.º 1
0
    protected void btnlogin_Click(object sender, EventArgs e)
    {
        string username = txtusername.Text;
        string password = txtpassword.Text;
        Nurse  user     = Nurse.Login_nurse(username, password);

        if (user != null)
        {
            Session["staff_name"] = user.name;

            Server.Transfer("msnurse.aspx");
            ClientScript.RegisterStartupScript(GetType(), "hwa", "alert('เข้าสู่ระบบเรียบร้อย');", true);
        }
        else
        {
            ClientScript.RegisterStartupScript(GetType(), "hwa", "alert('เข้าสู่ระบบผิดพลาด');", true);
        }
    }