public ActionResult PageAddSaveRevert(SingerRound singerround) { int round = Utility.GetInt(Request.Form.Get("QueueRound")); string command = Request.Form.Get("command"); singerround.round = round; singerround.command = command; if (round > 0) { switch (command.ToLower()) { case "revert": XmlDocument doc = SessionBag.Current.RoundXml as XmlDocument; XmlDocument docref = SessionBag.Current.RoundXmlReference as XmlDocument; if (doc != null && docref != null) { doc.LoadXml(docref.OuterXml); } break; case "save": QueueGrid model = new QueueGrid(round); model.QueueRound = round; model.queues = QueueRoundData.GetRounds(SessionBag.Current.RoundXml as XmlDocument, round); model.queuesref = QueueRoundData.GetRounds(SessionBag.Current.RoundXmlReference as XmlDocument, round); string result = model.Save(); string _RoundXml = ""; if (result != null && Utility.IsNumber(result) && int.Parse(result) > 0) { SingingClubClient client = new SingingClubClient(); client.Open(); string eventKey = SessionBag.Current.EventKey; if (eventKey.Trim().Length > 0) { MVCQueue q = new MVCQueue(); q.EventKey = eventKey; q.QueueRound = -1; _RoundXml = client.GeneralStore("TSCQueue", "GET", q.GetDataXml()); } client.Close(); XmlDocument RoundXml = new XmlDocument(); XmlDocument RoundXmlReference = new XmlDocument(); RoundXml.LoadXml(_RoundXml); RoundXmlReference.LoadXml(_RoundXml); SessionBag.Current.RoundXml = RoundXml; SessionBag.Current.RoundXmlReference = RoundXmlReference; } break; case "add": break; default: break; } } return(View(singerround)); }
// GET: QueueRound public ActionResult RoundView(int QueueRound = 0) { QueueGrid queueGrid = new QueueGrid(QueueRound); queueGrid.queues = QueueRoundData.GetRounds(SessionBag.Current.RoundXml as XmlDocument, QueueRound); queueGrid.queuesref = QueueRoundData.GetRounds(SessionBag.Current.RoundXmlReference as XmlDocument, QueueRound); queueGrid.queues.Sort(); queueGrid.Bind(); ViewData.Model = queueGrid; return(View()); }