public void Top(int id, int top) { Tunnel.Model.Tunnel_Vote tvv = new Tunnel_Vote(); tvv = tbll.GetModel(id); tvv.vote_top = tvv.vote_top == 0 ? 1 : 0; tbll.Update(tvv); }
/// <summary> /// 页面数据绑定 /// </summary> public void PageBind() { allCount = 0f; tvv = tv.GetModel(voteId); if (tvv != null) { tviiList = tvi.GetModelList("ivote_voteId = " + voteId + ""); if (tviiList.Count > 0) { foreach (Tunnel.Model.Tunnel_Votei item in tviiList) { allCount += Convert.ToInt32(item.ivote_Count.ToString()); } Repeater1.DataSource = tviiList; Repeater1.DataBind(); } } PageBase pb = new PageBase(); pb.TblName = "Tunnel_VoteRe"; pb.FldName = "vote_Id"; pb.ProcedureName = "pagination"; pb.PageSize = pageSize; if (cuttentPage == 0) { cuttentPage = pb.PageIndex; } pb.PageIndex = cuttentPage; pb.StrWhere = "vate_voteId=" + voteId + ""; pb.OrderName = "vate_Date"; pb.OrderType = 1; int count = 0; List <Tunnel.Model.Tunnel_VoteRe> modelList = new List <Tunnel.Model.Tunnel_VoteRe>(); modelList = tbll.GetList(pb, ref count); //获取分页结果 pb.DoCount = 1; tbll.GetList(pb, ref count); //获取总条数 //数据绑定 Repeater2.DataSource = modelList; Repeater2.DataBind(); //数据分页 MTCPager1.PageSize = pageSize; MTCPager1.RecordCount = count; MTCPager1.PageIndex = cuttentPage; if (count <= pb.PageSize) { MTCPager1.Visible = false; } else { MTCPager1.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { id = Convert.ToInt32(Request.QueryString["id"].ToString()); Tunnel.BLL.Tunnel_Vote t = new Tunnel.BLL.Tunnel_Vote(); Tunnel.Model.Tunnel_Vote tt = new Tunnel.Model.Tunnel_Vote(); Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); tt = t.GetModel(id); voteTitle = tt.vote_Title; voteUserName = tm.GetModel(Convert.ToInt32(tt.vote_userId)).m_name; voteDate = Convert.ToDateTime(tt.vote_startDate).ToShortDateString(); voteMark = tt.vote_mark; voteMax = tt.vote_max.ToString(); voteType = tt.vote_Type.ToString(); max.Value = voteMax; tvList = tv.GetModelList("ivote_voteId=" + id + ""); Repeater1.DataSource = tvList; Repeater1.DataBind(); if (voteType == "0") { foreach (RepeaterItem item in Repeater1.Items) { ((CheckBox)item.FindControl("CheckBox1")).Visible = false; } } else { foreach (RepeaterItem item in Repeater1.Items) { ((RadioButton)item.FindControl("RadioButton1")).Visible = false; } } Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin(); bool b = false; foreach (Tunnel.Model.Tunnel_Votei item in tvList) { string[] temp = item.ivote_yesUserId.Split(','); foreach (string item1 in temp) { if (ul.LoginID.ToString() == item1) { b = true; } } } if (b) { //Button1.Text = "查看结果"; Response.Redirect("VoteShow.aspx?id=" + Request.QueryString["id"].ToString()); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { tempId = Convert.ToInt32(Request.QueryString["id"].ToString()); Tunnel.BLL.Tunnel_Vote tv = new Tunnel.BLL.Tunnel_Vote(); voteTitle = tv.GetModel(tempId).vote_Title; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { voteId = Convert.ToInt32(Request.QueryString["id"].ToString()); Tunnel.BLL.Tunnel_Vote t = new Tunnel.BLL.Tunnel_Vote(); Tunnel.Model.Tunnel_Vote tt = new Tunnel.Model.Tunnel_Vote(); Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); tt = t.GetModel(voteId); voteTitle = tt.vote_Title; voteMark = tt.vote_mark; PageBind(); } } }
public void Pagebind() { tvv = tv.GetModel(tempId); if (tvv != null) { if (!string.IsNullOrEmpty(tvv.vote_bumGroup) && tvv.vote_bumGroup != "|") { TextbumName.Value = tvv.vote_bumGroup.Split('|')[1]; } else { TextbumName.Value = tvv.vote_bumGroup; } TextbumId.Value = tvv.vote_bumGroup; txtTitle.Text = tvv.vote_Title; txtText.Text = tvv.vote_mark; TextBox3.Text = tvv.vote_max.ToString(); DropDownList1.SelectedIndex = Convert.ToInt32(tvv.vote_Type.ToString()); TextBox1.Text = Convert.ToDateTime(tvv.vote_startDate).ToShortDateString(); TextBox2.Text = Convert.ToDateTime(tvv.vote_endDate).ToShortDateString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { id = Convert.ToInt32(Request.QueryString["id"].ToString()); Tunnel.BLL.Tunnel_Vote t = new Tunnel.BLL.Tunnel_Vote(); Tunnel.Model.Tunnel_Vote tt = new Tunnel.Model.Tunnel_Vote(); Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber(); tt = t.GetModel(id); voteTitle = tt.vote_Title; voteUserName = tm.GetModel(Convert.ToInt32(tt.vote_userId)).m_name; voteDate = Convert.ToDateTime(tt.vote_startDate).ToShortDateString(); if (!string.IsNullOrEmpty(tt.vote_mark)) { voteMark = "<img src=../image/info.png width=20px />" + tt.vote_mark; } voteMax = tt.vote_max.ToString(); voteType = tt.vote_Type.ToString(); max.Value = voteMax; tvList = tv.GetModelList("ivote_voteId=" + id + ""); Repeater1.DataSource = tvList; Repeater1.DataBind(); if (voteType == "0") { for (int i = 0; i < Repeater1.Items.Count; i++) { ((CheckBox)Repeater1.Items[i].FindControl("CheckBox1")).Visible = false; } } else { for (int i = 0; i < Repeater1.Items.Count; i++) { ((RadioButton)Repeater1.Items[i].FindControl("RadioButton1")).Visible = false; } } Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin(); bool b = false; for (int i = 0; i < tvList.Count; i++) { string[] temp = tvList[i].ivote_yesUserId.Split(','); for (int j = 0; j < temp.Length; j++) { if (ul.LoginID.ToString() == temp[j]) { b = true; } } } if (b) { Button1.Text = "查看结果"; } } else { Tunnel.BLL.Tunnel_Vote tv = new Tunnel.BLL.Tunnel_Vote(); List <Tunnel.Model.Tunnel_Vote> tvList = new List <Tunnel.Model.Tunnel_Vote>(); tvList = tv.GetModelList("(getdate()>vote_startDate and getdate()<vote_endDate) and vote_state=0 and vote_top =1 order by vote_startDate desc"); if (tvList.Count > 0) { Response.Redirect("indexvote.aspx?id=" + tvList[0].vote_Id + ""); } } } }