Beispiel #1
0
        //
        // GET: /PrimeFactors/

        public ActionResult Index(string number)
        {
            PrimeFactorsModel model    = new PrimeFactorsModel();
            Response          response = model.Decompose(number);

            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        //
        // GET: /PrimeFactors/

        public ActionResult Index(string number)
        {
            string[] numbers = null;

            try
            {
                numbers = Request.QueryString["number"].Split(',');
            }
            catch
            {
            }

            if (numbers == null || numbers.Length == 1)
            {
                PrimeFactorsModel model    = new PrimeFactorsModel();
                Response          response = model.Decompose(number);
                return(Json(response, JsonRequestBehavior.AllowGet));
            }
            else
            {
                PrimeFactorsModel model     = new PrimeFactorsModel();
                List <Response>   responses = model.Decompose(numbers);
                return(Json(responses, JsonRequestBehavior.AllowGet));
            }
        }
        public void ThisModel()
        {
            PrimeFactorsModel model = new PrimeFactorsModel();

            response = (BigNumberResponse)model.Decompose("1000001");
        }
        public void ThisModel()
        {
            PrimeFactorsModel model = new PrimeFactorsModel();

            response = (NumberResponse)model.Decompose("4916");
        }
Beispiel #5
0
        public void ThisModel()
        {
            PrimeFactorsModel model = new PrimeFactorsModel();

            response = (ErrorResponse)model.Decompose("batman");
        }