コード例 #1
0
 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;
         }
     }
 }