Exemplo n.º 1
0
        void ContinueCollect()
        {
            bool bUpdateDailySales = true;

            this.Hide();

            /*if (MessageBox.Show("Would you like to overwrite the daily sales information?", "Zeroing Daily Sales", MessageBoxButtons.YesNo) == DialogResult.No)
             * {
             *  bUpdateDailySales = false;
             * }*/
            if (DateTime.Now.DayOfWeek == DayOfWeek.Sunday &&
                MessageBox.Show("It's Sunday, should I skip collection? (If you're unsure, choose yes)", "Sunday", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
            {
                if (MessageBox.Show("Would you like to shut down all tills?", "Shut Down?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                {
                    sEngine.SendCommandToTill("ShutDown");
                }
            }
            else if (sEngine.CollectDataFromTills(InputTextBox("GETDATE").Text, bUpdateDailySales))
            {
                if (MessageBox.Show("Collection Completed OK! Would you like to shutdown all tills?", "Shut Down?", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    sEngine.SendCommandToTill("ShutDown");
                }
            }
            else
            {
                if (MessageBox.Show("Collection finished with errors, please see the console for more information. Shut Down all tills anyway?", "Shut Down", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    sEngine.SendCommandToTill("ShutDown");
                }
            }
            this.Close();
        }