public ActionResult DigitizeMap(HttpPostedFileBase file, long eventId)
        {
            long sessionID = sessionService.GetSessionID(this.HttpContext, true, true);

            if (file != null && file.ContentLength > 0)
            {
                try
                {
                    XmlReader reader = XmlReader.Create(file.InputStream);
                    XDocument xDoc = System.Xml.Linq.XDocument.Load(reader);
                    KMLParser kmlParser = new KMLParser();
                    kmlParser.Parse(xDoc, eventId);
                    ViewBag.Message = "File is uploaded and parsed successfully";
                }
                catch (Exception ex)
                {
                    ViewBag.Message = "ERROR:" + ex.Message.ToString();
                }
            }
            else
            {
                ViewBag.Message = "You have not specified a file.";
            }

            var model = events.GetAll();
            if (eventId == -1)
            {
                eventId = model.Where(x => x.year == (DateTime.Now.Year + 1)).First<ipmevent>().ID;
            }
            ViewBag.eventId = eventId;
            var year = model.Where(m => m.ID == eventId).First<ipmevent>().year;
            ViewBag.year = year;

            return View(model);
        }
        public ActionResult DigitizeMap(HttpPostedFileBase file, long eventId)
        {
            if (file != null && file.ContentLength > 0)
            {
                try
                {
                    XmlReader reader = XmlReader.Create(file.InputStream);
                    XDocument xDoc = System.Xml.Linq.XDocument.Load(reader);
                    KMLParser kmlParser = new KMLParser();
                    kmlParser.Parse(xDoc, eventId);
                    ViewBag.Message = "File is uploaded and parsed successfully";
                }
                catch (Exception ex)
                {
                    ViewBag.Message = "ERROR:" + ex.Message.ToString();
                }
            }
            else
            {
                ViewBag.Message = "You have not specified a file.";
            }

            var model = events.GetAll();
            ViewBag.year = model.Max(x => x.year);
            ViewBag.eventId = eventId;
            return View(model);
        }
 public PrototypeUIController()
 {
     kmlParser = new KMLParser();
 }