Exemplo n.º 1
0
 private void buttonNew_Click(object sender, EventArgs e)
 {
     try
     {
         var model = new LabelModel();
         var form  = new LabelModelEditForm(model);
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             Program.ShowSuccessfullMessage();
             FillGrid();
         }
     }
     catch (Exception ex)
     {
         Program.ShowMessageError(ex);
     }
 }
Exemplo n.º 2
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            try
            {
                var model = gridViewModel.GetFocusedRow() as LabelModel;
                if (model == null)
                {
                    throw new Exception("Selecione um modelo");
                }

                var form = new LabelModelEditForm(model);
                if (form.ShowDialog(this) == DialogResult.OK)
                {
                    Program.ShowSuccessfullMessage();
                    FillGrid();
                }
            }
            catch (Exception ex)
            {
                Program.ShowMessageError(ex);
            }
        }