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 GVVoting_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex > -1) { DataRowView dataRowView = (DataRowView)e.Row.DataItem; e.Row.Attributes["onmouseover"] = "OnMouseOverRecord(this);"; e.Row.Attributes["onclick"] = string.Concat(new string[] { "OnRecord(this);ClickRow('", dataRowView["RecordID"].ToString(), "','", dataRowView["State"].ToString(), "');" }); e.Row.Cells[0].Text = Convert.ToString(e.Row.RowIndex + 1); string[] array = dataRowView["Range"].ToString().Trim(new char[] { ',' }).Split(new char[] { ',' }); string text = ""; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string deptCode = array2[i]; text = text + "," + OAVotingInfoAction.getDeptName(deptCode); } e.Row.Cells[2].Text = text.Trim(new char[] { ',' }); switch (int.Parse(dataRowView["State"].ToString())) { case 0: e.Row.Cells[4].Text = "未启动"; return; case 1: e.Row.Cells[4].Text = "已启动"; return; case 2: e.Row.Cells[4].Text = "已停止"; break; default: return; } } }
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(); } } }