//
 // GET: /Specifications/
 public ActionResult Index(string subdomain, string space, string username, string password)
 {
     var assemblaApi = new Assembla.Api(username, password);
     var tickets = assemblaApi.GetTicketsForSpace(subdomain ?? "www", space);
     ViewData["space"] = space;
     return View(tickets);
 }
 public ActionResult Tickets(string space, string secret)
 {
     _api = new Assembla.Api(_apiKey, secret);
     var tickets = _api.GetTicketsForSpace(space);
     ViewData["space"] = space;
     return View(tickets.OrderBy(x => x.Summary));
 }
        public ActionResult Delete(string space, string secret)
        {
            _api = new Assembla.Api(_apiKey, secret);
            var tickets = _api.GetTicketsForSpace(space).Select(x => x.Number).ToList();

            foreach(var t in tickets)
            {
                try
                {
                    _api.DeleteTicket(space, t);
                }
                catch (Exception)
                {
                }
            }

            return RedirectToAction("Tickets", new {space, secret});
        }
        public ActionResult Create(string space, string secret)
        {
            _api = new Assembla.Api(_apiKey, secret);
            var actors =
                FreeMind.Converter.GetActorsFromFile(@"D:\Personal\AssemblaScaper\AssemblaScaper\UserStories.mm");
            ResetTIcketNumbering(space);

            foreach (var actor in actors)
            {
                var tickets = GetTicketsFromActor(actor);
                foreach (var ticket in tickets)
                {
                    _api.CreateTicket(space, ticket);
                }
            }

            return RedirectToAction("Tickets", new {space, secret});
        }