예제 #1
0
        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            LinkButton   l              = (LinkButton)sender;
            Label        lbl1           = (Label)l.Parent.FindControl("IdLabel");
            int          id_candidate   = Convert.ToInt32(lbl1.Text);
            Label        lbl2           = (Label)l.Parent.FindControl("Commission_fkLabel");
            int          id_commissiion = Convert.ToInt32(lbl2.Text);
            ElectionData election       = new ElectionData();
            ElectionDal  eledal         = new ElectionDal();
            CandidateDal candal         = new CandidateDal();
            ElectedDal   ed             = new ElectedDal();
            string       n              = (TextBox1.Text).ToString();
            int          id             = ed.ReturnID(n);

            election.Elected_fk    = id;
            election.Commission_fk = id_commissiion;
            election.Candidate_fk  = id_candidate;
            int no = ed.Check_Elected(id);

            if (no == 0)
            {
                eledal.InsertElection(election);
                Response.Redirect("OK.aspx");
            }
            else
            {
                Response.Redirect("VoteInfo.aspx");
            }
        }
예제 #2
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            TextBox1.Visible = false;
            Button1.Visible  = false;
            lbl_message.Text = "";
            ElectedDal ed1           = new ElectedDal();
            string     m             = (TextBox1.Text);
            int        Commission_fk = Convert.ToInt32(ed1.commission_fk(m));
            int        id            = Convert.ToInt32(ed1.ReturnID(m));
            int        no            = ed1.Check_Elected(id);

            if (no == 0)
            {
                Session["ID"]            = id;
                Session["Commission_FK"] = Commission_fk;
            }
            else
            {
                Session["ID"] = id;
                Response.Redirect("VoteInfo.aspx");
            }
        }
        protected void btn_ok_Click(object sender, EventArgs e)
        {
            ElectedDal d = new ElectedDal();

            d.DeleteRowElected((txt_delete.Text).ToString());
        }