private void btnUpdate_Click(object sender, EventArgs e) { if (this.newStaff) { this.tStaff = new tStaff(); if (this.txtFirstName.Text != "") staff.SaveStaff(PopulateStaff()); } else { this.PopulateStaff(); staff.SaveStaff(); } this.newStaff = false; this.LoadStaff(); }
private void FrmMain_Load(object sender, EventArgs e) { if (staff != null) { return; } using (var loginForm = new frmLogin { TopLevel = true, AutoScroll = true, Dock = DockStyle.Fill }) { loginForm.ShowDialog(); staff = loginForm.tStaff; if (staff != null) { this.Text = "Empresa - Administración - Monitor " + (GetTime() > 0 ? "Tarde: " : "Dia: ") +staff.Firstname; } } }
private void loginToolStripMenuItem_Click(object sender, EventArgs e) { using (var loginForm = new frmLogin { TopLevel = true, AutoScroll = true, Dock = DockStyle.Fill }) { loginForm.ShowDialog(); staff = loginForm.tStaff; this.Text = "Empresa - Administración - Monitor " + (GetTime() > 0 ? "Tarde: " : "Dia: ") + staff.Firstname; } }
public void SaveStaff(tStaff staff) { Wrapper.SaveStaff(staff); }