예제 #1
0
 private void onDeleteConfigTemplateYes(object sender, EventArgs e)
 {
     if (sender is AskDeleteObject)
     {
         AskDeleteObject d = sender as AskDeleteObject;
         GCConfigRatedManager.DeleteConfiguration(d.Tag as GCConfigRatedEvents);
         InitListConfigs();
     }
 }
 private void d_OnButtonYes(object sender, EventArgs e)
 {
     if (sender is AskDeleteObject)
     {
         AskDeleteObject d = sender as AskDeleteObject;
         if (d.Tag is GCConfigRatedMargin)
         {
             RatedEvent.DeleteMargin(d.Tag as GCConfigRatedMargin);
             InitListbox(RatedEvent);
         }
     }
 }
예제 #3
0
 /// <summary>
 /// Deleting related event and hiding dialog
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void askDeleteEvent1_OnButtonYes(object sender, EventArgs e)
 {
     if (sender is AskDeleteObject)
     {
         AskDeleteObject d = sender as AskDeleteObject;
         if (d != null && d.Tag != null && (d.Tag is GCFestivalBase))
         {
             EventObject.Remove(d.Tag as GCFestivalBase);
         }
     }
     FillRelativeEvents();
 }
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            GCConfigRatedMargin sel = SelectedSubevent;

            if (sel != null)
            {
                AskDeleteObject d = new AskDeleteObject();
                d.InitialLabel = "Delete rated subevent?";
                d.DetailLabel  = sel.Title;
                d.Tag          = sel;
                d.OnButtonYes += new TBButtonPressed(d_OnButtonYes);
                AskDeleteObjectController dc = new AskDeleteObjectController(d);
                dc.ShowInContainer(Controller.ViewContainer, GVControlAlign.Center);
            }
        }
예제 #5
0
        /// <summary>
        /// Delete Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button3_Click(object sender, EventArgs e)
        {
            GCListBoxEntry item = GetSelectedItem();

            if (item != null && item.Tag != null && Controller.ViewContainer != null)
            {
                AskDeleteObject           dlg     = new AskDeleteObject();
                AskDeleteObjectController dlgCtrl = new AskDeleteObjectController(dlg);
                dlg.Tag          = item.Tag;
                dlg.InitialLabel = "Are you sure to remove following event?";
                dlg.DetailLabel  = (item.Tag as GCFestivalBase).Text;
                dlg.OnButtonYes += new TBButtonPressed(onDeleteEvent);
                dlgCtrl.ShowInContainer(Controller.ViewContainer, GVControlAlign.Fill);
            }
        }
예제 #6
0
        private void onDeleteEvent(object sender, EventArgs e)
        {
            if (sender is AskDeleteObject)
            {
                AskDeleteObject dlg = sender as AskDeleteObject;
                GCFestivalBase  fb  = dlg.Tag as GCFestivalBase;
                if (fb != null)
                {
                    GCFestivalBook book = GCFestivalBookCollection.getSafeBook(fb.BookID);
                    book.Remove(fb);
                    onNonDeleteEvent(sender, e);

                    RemoveItemFromListBox(fb);
                }
            }
        }
예제 #7
0
        private void toolStripButtonDelete_Click(object sender, EventArgs e)
        {
            if (GCConfigRatedManager.Configurations.Count < 2)
            {
                return;
            }

            GCConfigRatedEvents ev = SelectedTemplateConfig;

            if (ev != null)
            {
                // ask for confirmation
                AskDeleteObject d = new AskDeleteObject();
                d.InitialLabel = "Are you sure to delete following configuration?";
                d.DetailLabel  = ev.Title;
                d.OnButtonYes += new TBButtonPressed(onDeleteConfigTemplateYes);
                d.Tag          = ev;
                AskDeleteObjectController dc = new AskDeleteObjectController(d);
                dc.ShowInContainer(Controller.ViewContainer, GVControlAlign.Fill);
            }
        }
예제 #8
0
 /// <summary>
 /// User interface handler for DELETE related event button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonDelete_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)
         {
             AskDeleteObject d = new AskDeleteObject();
             d.Tag          = lbe.Tag;
             d.InitialLabel = "Are you sure to remove following event?";
             d.DetailLabel  = (lbe.Tag as GCFestivalBase).Text;
             AskDeleteObjectController dc = new AskDeleteObjectController(d);
             d.OnButtonYes += new TBButtonPressed(askDeleteEvent1_OnButtonYes);
             if (ViewContainer != null)
             {
                 ViewContainer.AddControl(dc, GVControlAlign.Fill);
             }
         }
     }
 }
예제 #9
0
 public AskDeleteObjectController(AskDeleteObject v)
 {
     View         = v;
     v.Controller = this;
 }