private void bunifuThinButton21_Click(object sender, EventArgs e) { // string hora = DateTime.Now.Hour <= 9 ? "0" + DateTime.Now.Hour. : DateTime.Now.Hour; Turno t = new Turno() { Data = DateTime.Now, Estado = "Aberto", Hora = DateTime.Now.ToShortTimeString(), Caixa = decimal.Parse(textEdit1.Text), Abertura = decimal.Parse(textEdit1.Text), Tpa = 0, UserId = UserCurrent.getCurrentUser().Id, UserName = UserCurrent.getCurrentUser().Nome, DataF = DateTime.Now, HoraF = DateTime.Now.ToShortTimeString(), }; TurnoController _turnoController = new TurnoController(); _turnoController.insert(t); TurnoCurrent.initialize(t); frmC.setButtonFalse(); frmC.fillData(); FrmReportView frm = new FrmReportView(); frm.PrintOpenBox(TurnoCurrent.getTurnoCurrent()); Close(); // Hide(); }
private void bunifuThinButton24_Click(object sender, EventArgs e) { if (TurnoCurrent.getTurnoCurrent() == null) { frmOpenBox frmOpen = new frmOpenBox(this); frmOpen.ShowDialog(); } else { if (MessageBox.Show("Fechar o Caixa ? ", "Fechar caixa", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { FrmReportView frm = new FrmReportView(); Turno t = TurnoCurrent.getTurnoCurrent(); t.DataF = DateTime.Now; t.HoraF = DateTime.Now.ToShortTimeString(); t.Estado = "Fechado"; new TurnoController().update(t); fillData(); btnOpenClose.ButtonText = "Abrir Caixa"; frm.PrintCloseBox(t); TurnoCurrent.initialize(null); } else { return; } } }
private void btnOpenClose_Click(object sender, EventArgs e) { Turno t = TurnoCurrent.getTurnoCurrent(); t.Estado = "Fechado"; new TurnoController().update(t); TurnoCurrent.initialize(null); frmC.fillData(); Close(); }