示例#1
0
        protected void saveButton_Click(object sender, EventArgs e)
        {
            VoteCast voteCast = new VoteCast();

            voteCast.VoterId     = voterIdTextBox.Text;
            voteCast.CandidateId = Convert.ToInt32(symbolDropDownList.SelectedValue);
            CastVoteManager castVoteManager = new CastVoteManager();
            bool            isSuccess       = castVoteManager.Save(voteCast);
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CastVoteManager castVoteManager = new CastVoteManager();

            if (!IsPostBack)
            {
                symbolDropDownList.DataSource     = castVoteManager.GetAllSymbols();
                symbolDropDownList.DataTextField  = "Symbol";
                symbolDropDownList.DataValueField = "Id";
                symbolDropDownList.DataBind();
            }
        }