protected OAVotingRecord GetOAVotingRecord() { OAVotingRecord oAVotingRecord = new OAVotingRecord(); oAVotingRecord.VotingRecordID = this.RecordCode; oAVotingRecord.Voter = this.Session["yhdm"].ToString(); oAVotingRecord.VoteDate = DateTime.Now; OAVotingInfoAction oAVotingInfoAction = new OAVotingInfoAction(); DataTable list = oAVotingInfoAction.GetList(" RecordID=" + this.RecordCode); if (list.Rows.Count > 0) { this.votetype = list.Rows[0]["VoteType"].ToString(); if (this.votetype == "0") { oAVotingRecord.SelectOptions = this.rbl.SelectedValue; } if (this.votetype == "1") { for (int i = 0; i < this.cbl.Items.Count; i++) { if (this.cbl.Items[i].Selected) { OAVotingRecord expr_DE = oAVotingRecord; expr_DE.SelectOptions = expr_DE.SelectOptions + this.cbl.Items[i].Value + ","; } } } } return(oAVotingRecord); }
protected void btnAdd_Click(object sender, EventArgs e) { OAVotingRecord oAVotingRecord = this.GetOAVotingRecord(); OAVotingInfoAction oAVotingInfoAction = new OAVotingInfoAction(); DataTable list = oAVotingInfoAction.GetList(" RecordID=" + this.RecordCode); if (this.ora.Add(oAVotingRecord) > 0) { this.votetype = list.Rows[0]["VoteType"].ToString(); if (this.votetype == "0") { this.rid += this.rbl.SelectedValue; this.ooa.UpdatePoll(" RecordID =" + Convert.ToInt32(this.rid)); } if (this.votetype == "1") { for (int i = 0; i < this.cbl.Items.Count; i++) { if (this.cbl.Items[i].Selected) { this.rid = this.rid + this.cbl.Items[i].Value + ","; } } this.ooa.UpdatePoll(" RecordID in(" + this.rid.Substring(0, this.rid.Length - 1) + ")"); } this.JS.Text = "alert('提交成功!');"; JavaScriptControl expr_16E = this.JS; expr_16E.Text += "returnValue=true;window.close();"; } }
protected void BindVoteType() { OAVotingInfoAction oAVotingInfoAction = new OAVotingInfoAction(); DataTable list = oAVotingInfoAction.GetList(" RecordID=" + this.RecordCode); if (list.Rows.Count > 0) { this.votetype = list.Rows[0]["VoteType"].ToString(); this.labzdname.Text = list.Rows[0]["Title"].ToString(); if (this.votetype == "0") { this.BindRB(); } if (this.votetype == "1") { this.BindCBL(); } } }