Пример #1
0
        private void backButton_Click(object sender, EventArgs e)
        {
            mainPanel.Controls.Clear();
            ActivityMenu backSubjectMenu = new ActivityMenu(mainPanel);

            mainPanel.Controls.Add(backSubjectMenu);
        }
Пример #2
0
 public ModifyActivitySelectList(Panel mainPanel)
 {
     InitializeComponent();
     try
     {
         LoadActivity();
         this.mainPanel = mainPanel;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         UserControl backMenu = new ActivityMenu(mainPanel);
         mainPanel.Controls.Add(backMenu);
     }
 }
Пример #3
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            ActivityModule module = new ActivityModule();

            try
            {
                module.ModifyActivity(selectedObject, textNameActivity.Text, (int)numericUpDownCost.Value, dateTimePicker1.Value);
                MessageBox.Show("Actividad modificada con exito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                mainPanel.Controls.Clear();
                ActivityMenu backActivityMenu = new ActivityMenu(mainPanel);
                mainPanel.Controls.Add(backActivityMenu);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #4
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            ActivityModule module     = new ActivityModule();
            List <Object>  activities = new List <Object>();

            try
            {
                module.AddNewActivity(textNameActivity.Text, dateTimePicker1.Value, (int)numericUpDownPrice.Value);
                MessageBox.Show("Actividad ingresada con Exito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                mainPanel.Controls.Clear();
                ActivityMenu backActivityMenu = new ActivityMenu(mainPanel);
                mainPanel.Controls.Add(backActivityMenu);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Пример #5
0
 private void confirmRemoveButton_Click(object sender, EventArgs e)
 {
     if (listActivitiesSelected.Items.Count != 0)
     {
         foreach (Object item in listActivitiesSelected.Items)
         {
             ActivityModule module = new ActivityModule();
             module.RemoveActivity(item);
         }
         MessageBox.Show("Actividad(es) Eliminada(s) con Exito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
         mainPanel.Controls.Clear();
         ActivityMenu backMenu = new ActivityMenu(mainPanel);
         mainPanel.Controls.Add(backMenu);
     }
     else
     {
         MessageBox.Show("No se ha seleccionado ninguna Actividad para eliminar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }