-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormSelectionMethodsGrid.cs
67 lines (59 loc) · 1.85 KB
/
FormSelectionMethodsGrid.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace PBioManager
{
public partial class FormSelectionMethodsGrid : Form
{
public FormSelectionMethodsGrid()
{
InitializeComponent();
}
private void FormSelectionMethodsGrid_Load(object sender, EventArgs e)
{
// TODO: esta línea de código carga datos en la tabla 'webappDBDataSet.MetodoSeleccion' Puede moverla o quitarla según sea necesario.
this.metodoSeleccionTableAdapter.Fill(this.webappDBDataSet.MetodoSeleccion);
}
private void SaveChanges()
{
metodoSeleccionTableAdapter.Update(webappDBDataSet.MetodoSeleccion);
}
private void CheckExit(object sender, FormClosingEventArgs e)
{
if (webappDBDataSet.HasChanges())
{
DialogResult resp = MessageBox.Show(
"Do you want to save changes?",
"Close",
MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Question
);
if (resp.Equals(DialogResult.Yes))
SaveChanges();
else if (resp.Equals(DialogResult.Cancel))
e.Cancel = true;
}
}
/*
* EVENTOS
*/
private void FormSelectionMethodsGrid_FormClosing(object sender, FormClosingEventArgs e)
{
CheckExit(sender, e);
}
private void btnSave_Click(object sender, EventArgs e)
{
SaveChanges();
this.Close();
}
private void btnDiscard_Click(object sender, EventArgs e)
{
this.Close();
}
}
}