protected void Page_Load(object sender, EventArgs e) { ZWL.BLL.ERPVote MyModel = new ZWL.BLL.ERPVote(); MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString())); string[] ScoreList = MyModel.ScoreStr.Split('|'); //当前得票数 string DangQianInt = ScoreList[int.Parse(Request.QueryString["TouPiaoTextID"].ToString())]; //得票+1 int NewCount = int.Parse(DangQianInt) + 1; ScoreList[int.Parse(Request.QueryString["TouPiaoTextID"].ToString())] = NewCount.ToString(); //获得新的得票数序列 string UpdateStr = string.Empty; for (int i = 0; i < ScoreList.Length; i++) { if (UpdateStr.Length > 0) { UpdateStr = UpdateStr + "|" + ScoreList[i].ToString(); } else { UpdateStr = UpdateStr + ScoreList[i].ToString(); } } //更新投票,并把当前用户加入已投票用户 string SqlStr = "update ERPVote set ScoreStr='" + UpdateStr + "',TouPiaoRenList=TouPiaoRenList+'|" + ZWL.Common.PublicMethod.GetSessionValue("UserName") +"|' where ID=" + Request.QueryString["ID"].ToString(); ZWL.DBUtility.DbHelperSQL.ExecuteSQL(SqlStr); Response.Write("<script>alert('投票成功!');window.location='VoteView.aspx?ID=" + Request.QueryString["ID"].ToString() + "'</script>"); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPVote MyModel = new ZWL.BLL.ERPVote(); MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString())); if (MyModel != null) { this.Label1.Text = MyModel.TitleStr; this.Label2.Text = ZWL.Common.PublicMethod.GetVoteTable(MyModel.ContentStr, MyModel.ScoreStr, Request.QueryString["ID"].ToString(), ZWL.Common.PublicMethod.StrIFIn("|" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "|", ZWL.DBUtility.DbHelperSQL.GetSHSL("select TouPiaoRenList from ERPVote where ID=" + Request.QueryString["ID"].ToString()))); this.Label3.Text = MyModel.UserName; this.Label4.Text = MyModel.TimeStr.ToString(); } string bt = Request.QueryString["bt"]; if (!string.IsNullOrEmpty(bt)) { if (bt == "2") { PublicMethod.WriteCookie("goBackNo", "-2"); } } else { PublicMethod.WriteCookie("goBackNo", ""); } } }
protected void Page_Load(object sender, EventArgs e) { ZWL.BLL.ERPVote MyModel = new ZWL.BLL.ERPVote(); MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString())); string[] ScoreList = MyModel.ScoreStr.Split('|'); //当前得票数 string DangQianInt = ScoreList[int.Parse(Request.QueryString["TouPiaoTextID"].ToString())]; //得票+1 int NewCount = int.Parse(DangQianInt) + 1; ScoreList[int.Parse(Request.QueryString["TouPiaoTextID"].ToString())] = NewCount.ToString(); //获得新的得票数序列 string UpdateStr = string.Empty; for (int i = 0; i < ScoreList.Length; i++) { if (UpdateStr.Length > 0) { UpdateStr = UpdateStr + "|" + ScoreList[i].ToString(); } else { UpdateStr = UpdateStr + ScoreList[i].ToString(); } } //更新投票,并把当前用户加入已投票用户 string SqlStr = "update ERPVote set ScoreStr='" + UpdateStr + "',TouPiaoRenList=TouPiaoRenList+'|" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "|' where ID=" + Request.QueryString["ID"].ToString(); ZWL.DBUtility.DbHelperSQL.ExecuteSQL(SqlStr); Response.Write("<script>alert('投票成功!');window.location='VoteView.aspx?ID=" + Request.QueryString["ID"].ToString() + "'</script>"); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPVote MyModel = new ZWL.BLL.ERPVote(); MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.TextBox1.Text = MyModel.TitleStr; this.TextBox2.Text = MyModel.ContentStr; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); ZWL.BLL.ERPVote MyModel = new ZWL.BLL.ERPVote(); MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString())); this.Label1.Text = MyModel.TitleStr; this.Label2.Text = ZWL.Common.PublicMethod.GetVoteTable(MyModel.ContentStr, MyModel.ScoreStr, Request.QueryString["ID"].ToString(), ZWL.Common.PublicMethod.StrIFIn("|" + ZWL.Common.PublicMethod.GetSessionValue("UserName") + "|", ZWL.DBUtility.DbHelperSQL.GetSHSL("select TouPiaoRenList from ERPVote where ID="+Request.QueryString["ID"].ToString()))); this.Label3.Text = MyModel.UserName; this.Label4.Text = MyModel.TimeStr.ToString(); } }