-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormAddAlt.cs
More file actions
67 lines (55 loc) · 1.84 KB
/
FormAddAlt.cs
File metadata and controls
67 lines (55 loc) · 1.84 KB
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.Threading.Tasks;
using System.Windows.Forms;
using SaudeDay.DAL;
namespace Saude_Day
{
public partial class FormAddAlt : Form
{
public FormAddAlt()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (MeusFormularios.FormAddAlt == null)
MeusFormularios.FormAddAlt = new FormAddAlt();
MeusFormularios.FormAddAlt.Show();
MeusFormularios.FormAddAlt.Focus();
}
private void FormAddAlt_Load(object sender, EventArgs e)
{
this.remediooBindingSource.DataSource = DataContextFactory.DataContext.Remedioo;
}
private void btnAdd_Click(object sender, EventArgs e)
{
this.remediooBindingSource.EndEdit();
DataContextFactory.DataContext.SubmitChanges();
MessageBox.Show("Salvo!");
}
private void btnAlt_Click(object sender, EventArgs e)
{
this.remediooBindingSource.EndEdit();
DataContextFactory.DataContext.SubmitChanges();
MessageBox.Show("Alterado!");
}
private void btnNovo_Click(object sender, EventArgs e)
{
this.remediooBindingSource.AddNew();
}
private void pictureBox1_Click(object sender, EventArgs e)
{
if (MeusFormularios.FormPrincipal == null)
MeusFormularios.FormPrincipal = new FormPrincipal();
MeusFormularios.FormPrincipal.Show();
MeusFormularios.FormPrincipal.Focus();
this.Hide();
}
}
}