Beispiel #1
0
        protected DataSet studentSelect()
        {
            poDll.PurchaseOrder dsStudent = new poDll.PurchaseOrder();
            DataSet             ds        = new DataSet();

            ds = dsStudent.STUDENT_Select("ab1234cd", "password");

            return(ds);
        }
        //Method for Login
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            DataSet ds     = new DataSet();
            string  starId = txtBoxStarid.Text.Trim();
            string  pwd    = txtBoxPwd.Text.Trim();

            ds = stud.STUDENT_Select(starId, pwd);

            if (ds.Tables[0].Rows.Count < 1)
            {
                lblNotFound.Text = "User not found";
                return;
            }
            else
            {
                lblNotFound.Text = "";
                string active = ds.Tables["Student"].Rows[0].ItemArray[4].ToString();
                Session["User"]   = ds.Tables["Student"].Rows[0].ItemArray[1];
                Session["StarID"] = ds.Tables["Student"].Rows[0].ItemArray[0];

                if (active == "1")  // aunthenticated user
                {
                    Response.Redirect("Involvement.aspx");
                }

                else if (active == "2") // advisor
                {
                    Response.Redirect("");
                }

                else if (active == "3") // vendor
                {
                    Response.Redirect("");
                }

                else
                {
                    Response.Redirect("Default.aspx");
                }
            }
        }