示例#1
0
        public ShowRow(Controller c, Show s, string venue, string date)
        {
            _controller = c;
            _model = s;
            InitializeComponent();

            this.venueLabel.Text = venue;
            this.dateLabel.Text = date;
        }
示例#2
0
 public bool addShow(Show s)
 {
     try
     {
         shows.Add(s);
     }
     catch
     {
         return false;
     }
     return true;
 }
示例#3
0
        internal bool saveShow(string date, string venue, bool _isEdit, int index)
        {
            if (_isEdit)
            {
                showHighlight.setDate(index, date);
                showHighlight.setVenue(index, venue);
            }
            else
            {
                bool createNew = false;
                if (showHighlight == null)
                {
                    showHighlight = new Show();
                    createNew = true;
                }

                showHighlight.addDate(date);
                showHighlight.addVenue(venue);

                if (createNew)
                    bandHighlight.addShow(showHighlight);
            }

            ((MainView)_current_view).initializeBandTab(bandHighlight);
            ((MainView)_current_view).disableEdit(MainView.BAND_TAB_SHOW);
            ((MainView)_current_view).disableDelete(MainView.BAND_TAB_SHOW);

            saveXML();

            return true;
        }
示例#4
0
        internal void addShow()
        {
            if (showHighlight == null)
            {
                if (bandHighlight.getShows().Length > 0)
                    showHighlight = bandHighlight.getShows()[0];
                else
                {
                    bandHighlight.addShow(new Show());
                    showHighlight = bandHighlight.getShows()[0];
                }

            }
            else if (!bandHighlight.getShows().Contains(showHighlight))
            {
                if (bandHighlight.getShows().Length > 0)
                    showHighlight = bandHighlight.getShows()[0];
            }
            else
            {
                bandHighlight.addShow(new Show());
                showHighlight = bandHighlight.getShows()[0];
            }

            AddShow addShowView = new AddShow(this, false, 0);
            addShowView.Show();
        }
示例#5
0
        public void showClick(ShowRow row, Show s)
        {
            //Set them all normal
            foreach (ShowRow r in ((MainView)_current_view).getShowRows())
                r.setNormal();

            //set ours green
            row.setGreen();

            showRowHighlight = row;
            showHighlight = s;

            //enable show buttons
            ((MainView)_current_view).enableEdit(MainView.BAND_TAB_SHOW);
            ((MainView)_current_view).enableDelete(MainView.BAND_TAB_SHOW);
        }
示例#6
0
        private Show showParser(XmlNodeReader reader)
        {
            Show s = new Show();

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (reader.Name == "date")
                    {
                        reader.Read();
                        s.addDate(reader.Value);
                        reader.Read();
                        reader.Read();
                        reader.Read();
                        s.addVenue(reader.Value);
                    }
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                    if (reader.Name == "show")
                        break;
            }

            return s;
        }