protected void databind_es()
    {
        int     clg_id = Convert.ToInt32(Session["clg_id"]);
        DataSet ds     = clg_ad_obj.getElectionSchedule_by_clg_id(clg_id);

        if (ds.Tables[0].Rows.Count > 0)
        {
            lbl_es.Visible       = false;
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();
        }
    }
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        int clg_ad_id = Convert.ToInt32(Session["clg_ad_id"]);
        int clg_id    = Convert.ToInt32(Session["clg_id"]);
        int i         = clg_ad_obj.addElectionSchedule(clg_id, txt_date.Text, txt_start_time.Text, txt_end_time.Text);

        if (i > 0)
        {
            DataSet ds = clg_ad_obj.getElectionSchedule_by_clg_id(clg_id);
            if (ds.Tables[0].Rows.Count > 0)
            {
                Session["es_id"] = ds.Tables[0].Rows[0]["es_id"].ToString();
                Response.Redirect("clg_ad_eSchedule_view.aspx");
            }
        }
    }
Exemplo n.º 3
0
    protected void btn_login_Click(object sender, EventArgs e)
    {
        DataSet ds = bl.get_student(txt_enroll_no.Text, txt_pswd.Text);

        if (ds.Tables[0].Rows.Count > 0)
        {
            Session["reg_id"]    = ds.Tables[0].Rows[0][0].ToString();
            Session["enroll_no"] = ds.Tables[0].Rows[0][1].ToString();
            Session["fn"]        = ds.Tables[0].Rows[0][2].ToString();
            Session["ln"]        = ds.Tables[0].Rows[0][3].ToString();
            int clg_id = Convert.ToInt32(ds.Tables[0].Rows[0]["clg_id"]);
            Session["clg_id"] = clg_id.ToString();
            Session["email"]  = ds.Tables[0].Rows[0][11].ToString();
            ds.Clear();

            ds = bl.get_candidate_reg_id(Convert.ToInt32(Session["reg_id"]));
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (Convert.ToInt32(ds.Tables[0].Rows[0]["active"]) == 1)
                {
                    Session["cnd_id"] = ds.Tables[0].Rows[0]["cnd_id"].ToString();
                }
            }

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

            ds.Clear();
            Response.Redirect("stu_vote.aspx");
        }
        else
        {
            Response.Write("<script>alert('Invalid Email or Password')</script>");
        }
    }
Exemplo n.º 4
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>");
        }
    }