Example #1
0
    public void Del(int id)
    {
        Tunnel.BLL.Tunnel_Vote tv = new Tunnel.BLL.Tunnel_Vote();

        Tunnel.BLL.Tunnel_VoteRe          tvr     = new Tunnel.BLL.Tunnel_VoteRe();
        List <Tunnel.Model.Tunnel_VoteRe> tvrList = tvr.GetModelList("vate_voteId=" + id + "");

        foreach (Tunnel.Model.Tunnel_VoteRe item in tvrList)
        {
            tvr.Delete(item.vote_Id);
        }
        Tunnel.BLL.Tunnel_Votei          tvi     = new Tunnel.BLL.Tunnel_Votei();
        List <Tunnel.Model.Tunnel_Votei> tviList = tvi.GetModelList("ivote_voteId=" + id + "");

        foreach (Tunnel.Model.Tunnel_Votei item in tviList)
        {
            tvi.Delete(item.ivote_Id);
        }
        tv.Delete(id);

        Tunnel.BLL.Tunnel_Remind          tr     = new Tunnel.BLL.Tunnel_Remind();
        Tunnel.Model.Tunnel_Remind        trr    = new Tunnel.Model.Tunnel_Remind();
        List <Tunnel.Model.Tunnel_Remind> trList = new List <Tunnel.Model.Tunnel_Remind>();

        trList = tr.GetModelList("m_type=4 and m_typeid=" + id + "");
        foreach (Tunnel.Model.Tunnel_Remind item in trList)
        {
            tr.Delete(item.m_typeid);
        }
    }
Example #2
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (Button1.Text == "投票")
     {
         Tunnel.BLL.Tunnel_Votei   tvi  = new Tunnel.BLL.Tunnel_Votei();
         Tunnel.Model.Tunnel_Votei tvii = new Tunnel.Model.Tunnel_Votei();
         if (voteType == "0")
         {
             for (int i = 0; i < Repeater1.Items.Count; i++)
             {
                 if (((RadioButton)Repeater1.Items[i].FindControl("RadioButton1")).Checked)
                 {
                     tvii.ivote_Id = Convert.ToInt32(((RadioButton)Repeater1.Items[i].FindControl("RadioButton1")).ToolTip.ToString());
                     tvii          = tvi.GetModel(tvii.ivote_Id);
                     tvii.ivote_Count++;
                     Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
                     tvii.ivote_yesUserId += ul.LoginID + ",";
                     tvi.Update(tvii);
                 }
             }
         }
         else
         {
             for (int i = 0; i < Repeater1.Items.Count; i++)
             {
                 if (((CheckBox)Repeater1.Items[i].FindControl("CheckBox1")).Checked)
                 {
                     tvii.ivote_Id = Convert.ToInt32(((CheckBox)Repeater1.Items[i].FindControl("CheckBox1")).ToolTip.ToString());
                     tvii          = tvi.GetModel(tvii.ivote_Id);
                     tvii.ivote_Count++;
                     Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
                     tvii.ivote_yesUserId += ul.LoginID + ",";
                     tvi.Update(tvii);
                 }
             }
         }
         Tunnel.Common.Message.Show("投票成功!");
     }
     else
     {
         Response.Redirect("indexvoteshow.aspx?id=" + id + "");
     }
 }