protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { ZWL.BLL.ERPVote Model = new ZWL.BLL.ERPVote(); Model.TitleStr = this.TextBox1.Text; Model.ContentStr = this.TextBox2.Text; Model.ScoreStr = ""; for (int i = 0; i < Model.ContentStr.Split('|').Length; i++) { if (Model.ScoreStr.Trim().Length > 0) { Model.ScoreStr = Model.ScoreStr + "|0"; } else { Model.ScoreStr = "0"; } } Model.ID = int.Parse(Request.QueryString["ID"].ToString()); Model.Update(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户修改投票信息(" + this.TextBox1.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "投票信息修改成功!", "Vote.aspx"); }
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>"); }
public void DataBindToGridview() { DataEntityDataContext context = new DataEntityDataContext(); ZWL.BLL.ERPVote MyLanEmail = new ZWL.BLL.ERPVote(); var T = context.ERPVote.Where(p => p.ID != 0).OrderByDescending(p => p.ID); EmailList = T.ToList(); }
public void DataBindToGridview() { ZWL.BLL.ERPVote MyModel = new ZWL.BLL.ERPVote(); GVData.DataSource = MyModel.GetList("TitleStr Like '%" + this.TextBox1.Text + "%' order by ID desc"); GVData.DataBind(); LabPageSum.Text = Convert.ToString(GVData.PageCount); LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1)); this.GoPage.Text = LabCurrentPage.Text.ToString(); }
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; } }
public void DataBindToGridview() { GVData.PageSize = AspNetPager1.PageSize; GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1; ZWL.BLL.ERPVote MyModel = new ZWL.BLL.ERPVote(); DataSet ds = MyModel.GetList("TitleStr Like '%" + this.TextBox1.Text + "%' order by ID desc"); GVData.DataSource = ds; GVData.DataBind(); AspNetPager1.RecordCount = ds.Tables[0].Rows.Count; }
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(); } }