예제 #1
0
 private void BtnAddLine_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var line = new LineInput();
         var form = new ItemForm(line);
         form.Closed += Form_Closed;
         form.ShowDialog();
     }
     catch (Exception ex)
     {
         FormHelper.MessageError(ex);
     }
 }
예제 #2
0
        private void BtnUpdateLine_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var line = gridLines.SelectedItem as LineInput;

                if (line is null)
                {
                    throw new Exception("Nenhuma linha selecionada");
                }

                var form = new ItemForm(line);
                form.ShowDialog();

                var lineToUpdated = Lines.FirstOrDefault(c => line.Id.Equals(c.Id));
                lineToUpdated = line;
            }
            catch (Exception ex)
            {
                FormHelper.MessageError(ex);
            }
        }