public static frmCashCount CreateInstance()
        {
            frmCashCount theInstance = new frmCashCount();

            theInstance.Form_Load();
            return(theInstance);
        }
Esempio n. 2
0
        private void cbLogOff_Click(Object eventSender, EventArgs eventArgs)
        {
            DialogResult result = (DialogResult)0;
            frmCashCount cash   = null;

            if (MainModule.IsShiftStarted())
            {
                result = MessageBox.Show("Are you ready to end your shift", Application.ProductName, MessageBoxButtons.YesNo);
                if (result == System.Windows.Forms.DialogResult.Yes)
                {
                    cash = frmCashCount.CreateInstance();
                    cash.ShowDialog();
                    this.Hide();
                }
            }
        }
        private void cbLogOff_Click(Object eventSender, EventArgs eventArgs)
        {
            Mobilize.Web.DialogResult result = (Mobilize.Web.DialogResult) 0;
            frmCashCount cash = null;

            if (MainModule.IsShiftStarted())
            {
                result = Mobilize.Web.MessageBox.Show("Are you ready to end your shift", System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).ProductName, Mobilize.Web.MessageBoxButtons.YesNo);
                if (result == Mobilize.Web.DialogResult.Yes)
                {
                    cash = frmCashCount.CreateInstance();
                    cash.ShowDialog();
                    this.Hide();
                }
            }
        }
Esempio n. 4
0
        private void cbReturn_Click(Object eventSender, EventArgs eventArgs)
        {
            decimal      MINIMUM_CASH = 0;
            decimal      Total        = 0;
            frmCashCount cash         = null;
            int          ShiftID      = 0;

            if (MainModule.CurrentShift.UserID == 0)
            {
                // And we need a shift
                MessageBox.Show("You are starting your shift, please count cash on drawer", Application.ProductName);
                Total = 0;
                while (Total < 300)
                {
                    cash = frmCashCount.CreateInstance();
                    cash.ShowDialog();
                    Total = cash.Total;
                    // Validate that the POS has enough cash on Drawer to
                    // Begin shift
                    if (Total > MINIMUM_CASH)
                    {
                        // Start a shift and register it into database
                        ShiftID = MainModule.StartShiftWithAmount(MainModule.CurrentPOS.POSID, MainModule.CurrentShift.UserID, DateTime.Now, Total);
                        if (ShiftID > 0)
                        {
                            this.Hide();
                            MainModule.CurrentShift.ShiftID = ShiftID;
                        }
                    }
                    else
                    {
                        MessageBox.Show("You need to have a minimum of " + MINIMUM_CASH.ToString() + " to Start a Shift", Application.ProductName);
                    }
                }
            }
            else
            {
                this.Hide();
            }
        }