protected void LoginButton_Click(object sender, EventArgs e)
    {
        UserBO ob1 = new UserBO();

        ob1.userid   = UserLogin.Text;
        ob1.password = PassLogin.Text;

        clsBLL ob2      = new clsBLL();
        clsBLL ob3      = new clsBLL();
        int    result   = ob2.VerifyLoginData(ob1);
        int    typeuser = ob3.FindUserTypeBLL(ob1);

        if (result == 1)
        {
            StatusLogin.Text = "Login SuccessFul";

            if (typeuser == 1)
            {
                Session["User"] = ob1.userid;
                Response.Redirect("AdminMainPage.aspx");
            }
            else
            {
                Session["User"] = ob1.userid; Response.Redirect("UserMain.aspx");
            }
        }
        else
        {
            StatusLogin.Text = "UnAuthorised Credentials";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try { AdminID.Text = Session["User"].ToString(); }
        catch { Response.Redirect("LoginPage.aspx"); }
        string str = Session["User"].ToString();
        UserBO ob4 = new UserBO();

        ob4.userid = Session["User"].ToString();

        clsBLL ob5    = new clsBLL();
        int    admin1 = ob5.FindUserTypeBLL(ob4);

        if (admin1 != 1)
        {
            Session["User"] = null; Response.Redirect("LoginPage.aspx");
        }

        string name = ob5.firstnamerBLL(str);

        AdminName.Text = name;


        if (!IsPostBack)
        {
            clsBLL        ob1        = new clsBLL();
            List <string> skillList  = ob1.FirstBLL();
            List <string> skillList2 = ob1.First2BLL();
            List <string> skillList3 = ob1.First3BLL();
            try
            {
                skillCard1.Text = skillList[0];
                skillCard2.Text = skillList2[0];
                skillCard3.Text = skillList3[0];
            }
            catch
            {
                skillCard1.Text = "none";
                skillCard2.Text = "none";
                skillCard3.Text = "none";
            }

            Adminsearchshowstat.Visible = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try { UserID.Text = Session["User"].ToString(); }
        catch { Response.Redirect("LoginPage.aspx"); }
        string str = Session["User"].ToString();
        UserBO ob4 = new UserBO();

        ob4.userid = Session["User"].ToString();

        clsBLL ob5 = new clsBLL();

        int user1 = ob5.FindUserTypeBLL(ob4);

        if (user1 == 1)
        {
            Session["User"] = null; Response.Redirect("LoginPage.aspx");
        }

        string name = ob5.firstnamerBLL(str);

        UserName.Text = name;


        using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["userdataConnectionString"].ConnectionString.ToString()))
        {
            SqlCommand cmd = new SqlCommand("select CourseCode,Status,Score from Scores where (UserID ='" + Session["User"].ToString() + "')", con);
            con.Open();
            CoursesAccepted.DataSource = cmd.ExecuteReader();
            CoursesAccepted.DataBind();
        }

        using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["userdataConnectionString"].ConnectionString.ToString()))
        {
            SqlCommand cmd = new SqlCommand("select SkillName from SkillSet", con);
            con.Open();
            UserSkillSearchResult.DataSource = cmd.ExecuteReader();
            UserSkillSearchResult.DataBind();
        }
    }