コード例 #1
0
        public void Update(String idS, String team1, String team2, String stage, String ticketsS, String priceS)
        {
            Int32  id      = 0;
            Int32  tickets = 0;
            Double price   = 0;

            try
            {
                id      = Int32.Parse(idS);
                tickets = Int32.Parse(ticketsS);
                price   = Double.Parse(priceS);
            }
            catch (Exception)
            {
                CodeThrowExceptionStatement("Invalid parameters");
            }

            try
            {
                Match m = new Match(id, team1, team2, stage, tickets, price);
                this._repository.Update(m);
            }
            catch (Exception e)
            {
                CodeThrowExceptionStatement(e);
            }
        }
コード例 #2
0
        public Match FindById(String id)
        {
            Int32 nr    = 0;
            Match match = null;

            try
            {
                nr = Int32.Parse(id);
            }
            catch (Exception)
            {
                throw new ControllerException("Invalid number format.");
            }

            try
            {
                match = this._repository.FindById(nr);
            }
            catch (RepositoryException e)
            {
                CodeThrowExceptionStatement(e);
            }
            return(match);
        }