Beispiel #1
0
        public void setEvent(GCFestivalRelated r)
        {
            if (r == null)
            {
                editEventBase2.EventTitle          = "(Untitled)";
                editEventBase2.EventStartYear      = -10000;
                editEventBase2.EventFastingSubject = string.Empty;
                editEventBase2.EventBook           = -1;
                editEventBase2.DaysOffset          = 0;
                editEventBase2.Fast = FastType.FAST_NULL;
            }
            else
            {
                editEventBase2.EventTitle          = r.Text;
                editEventBase2.EventStartYear      = r.StartYear;
                editEventBase2.EventFastingSubject = r.FastingSubject;
                editEventBase2.EventBook           = r.BookID;
                editEventBase2.DaysOffset          = r.DayOffset;
                editEventBase2.Fast = r.FastID;
            }

            p_related = r;
        }
Beispiel #2
0
        /// <summary>
        /// User interface handler for EDIT related event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex >= 0 &&
                listBox1.SelectedIndex < listBox1.Items.Count)
            {
                GCListBoxEntry lbe = listBox1.Items[listBox1.SelectedIndex] as GCListBoxEntry;
                if (lbe != null && lbe.Tag != null && lbe.Tag is GCFestivalRelated)
                {
                    GCFestivalRelated             r  = lbe.Tag as GCFestivalRelated;
                    EventRelatedDetails           d  = new EventRelatedDetails();
                    EventRelatedDetailsController dc = new EventRelatedDetailsController(d);

                    dc.ViewContainer = Controller.ViewContainer;
                    d.setEvent(r);
                    d.setParentEvent(EventObject);
                    d.OnEventDetailChanged += new TBButtonPressed(onRelatedEventChanged);

                    if (ViewContainer != null)
                    {
                        ViewContainer.AddControl(dc, GVControlAlign.Fill);
                    }
                }
            }
        }
 public void updateEvent(GCFestivalRelated ev)
 {
 }
 public void setEvent(GCFestivalRelated ev)
 {
 }
Beispiel #5
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            bool isNewEvent = false;

            if (p_related == null)
            {
                p_related  = new GCFestivalRelated();
                isNewEvent = true;
            }

            if (p_related != null)
            {
                GCFestivalBook book = null;
                if (p_eventObject.BookID >= 0)
                {
                    book = GCFestivalBookCollection.getSafeBook(p_eventObject.BookID);
                }

                if (p_related.BookID != editEventBase2.EventBook)
                {
                    p_related.BookID = editEventBase2.EventBook;
                    if (book != null)
                    {
                        book.Changed = true;
                    }
                }
                if (p_related.DayOffset != editEventBase2.DaysOffset)
                {
                    p_related.DayOffset = editEventBase2.DaysOffset;
                    if (book != null)
                    {
                        book.Changed = true;
                    }
                }
                if (p_related.FastID != editEventBase2.Fast)
                {
                    p_related.FastID = editEventBase2.Fast;
                    if (book != null)
                    {
                        book.Changed = true;
                    }
                }
                if (p_related.FastingSubject == null ||
                    !p_related.FastingSubject.Equals(editEventBase2.EventFastingSubject))
                {
                    p_related.FastingSubject = editEventBase2.EventFastingSubject;
                    if (book != null)
                    {
                        book.Changed = true;
                    }
                }
                if (p_related.StartYear != editEventBase2.EventStartYear)
                {
                    p_related.StartYear = editEventBase2.EventStartYear;
                    if (book != null)
                    {
                        book.Changed = true;
                    }
                }
                if (p_related.Text == null ||
                    !p_related.Text.Equals(editEventBase2.EventTitle))
                {
                    p_related.Text = editEventBase2.EventTitle;
                    if (book != null)
                    {
                        book.Changed = true;
                    }
                }

                if (isNewEvent)
                {
                    p_eventObject.AddRelatedFestival(p_related);
                }

                p_related = null;

                if (OnEventDetailChanged != null)
                {
                    OnEventDetailChanged(this, e);
                }
            }

            Controller.RemoveFromContainer();
        }