示例#1
0
        /// <summary>
        /// Saves vote data to Database
        /// </summary>
        /// <param name="vote">Vote structure</param>
        public void SaveVote(EmployeeVote vote)
        {
            SqlConnection connect = GetConnection();

            try
            {
                using (SqlCommand command = new SqlCommand("proc_SGI_AddVote", connect))
                {
                    command.CommandType = CommandType.StoredProcedure;

                    command.Parameters.Add("@AccountFrom", SqlDbType.VarChar).Value = vote.AccountFrom;
                    command.Parameters.Add("@AccountTo", SqlDbType.VarChar).Value   = vote.AccountTo;
                    command.Parameters.Add("@Value", SqlDbType.VarChar).Value       = vote.CorporateValue.ToString();
                    command.Parameters.Add("@Comment", SqlDbType.NVarChar).Value    = vote.Comment;
                    command.ExecuteNonQuery();
                }
            }
            finally
            {
                connect.Close();
            }
        }
示例#2
0
 public void SaveVote(EmployeeVote vote)
 {
     _voteList.Add(vote);
 }