Esempio n. 1
0
 public void ClearVoteAll(VotingModel Voting)
 {
     cmd.CommandType = CommandType.StoredProcedure;
     cmd.CommandText = "InternalRegime_ClearVoteAll";
     cmd.Parameters.Clear();
     cmd.Parameters.Add("@Year", SqlDbType.Int).Value   = Voting.VotingTime.Value.Year;
     cmd.Parameters.Add("@ItemId", SqlDbType.Int).Value = Voting.ItemId;
     try
     {
         if (cmd.Connection.State != ConnectionState.Open)
         {
             cmd.Connection.Open();
         }
         cmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 2
0
        public void InternalRegimeBulkVote(VotingModel Voting, Int32 MemberSessionId)
        {
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "InternalRegime_BulkVote";
            cmd.Parameters.Clear();
            cmd.Parameters.Add("@Year", SqlDbType.Int).Value            = Voting.VotingTime.Value.Year;
            cmd.Parameters.Add("@MemberSessionId", SqlDbType.Int).Value = MemberSessionId;
            cmd.Parameters.Add("@ItemId", SqlDbType.Int).Value          = Voting.ItemId;
            cmd.Parameters.Add("@Agree", SqlDbType.Bit).Value           = Voting.Voted;

            try
            {
                if (cmd.Connection.State != ConnectionState.Open)
                {
                    cmd.Connection.Open();
                }
                cmd.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }