Exemplo n.º 1
0
    protected void btn_login_Click(object sender, EventArgs e)
    {
        DataSet ds = clg_ad_obj.get_all_clg_ad(Convert.ToInt32(drp_clg.SelectedValue), txt_pswd.Text);

        if (ds.Tables[0].Rows.Count > 0)
        {
            Session["clg_ad_id"] = ds.Tables[0].Rows[0][0].ToString();
            Session["clg_id"]    = ds.Tables[0].Rows[0][1].ToString();
            ds.Clear();

            ds = clg_ad_obj.getElectionSchedule_by_clg_id(Convert.ToInt32(Session["clg_id"]));
            if (ds.Tables[0].Rows.Count > 0)
            {
                Session["es_id"] = ds.Tables[0].Rows[0]["es_id"].ToString();
            }

            Response.Redirect("clg_ad_request.aspx");
        }
        else
        {
            Response.Write("<script>alert('Invalid Email or Password')</script>");
        }
    }