Example #1
0
 private void addNewClient_Load(object sender, EventArgs e)
 {
     _currentDateTime = DateTime.Now;
     db = new dbDataContext();
     _opt = new Options();
     _db = new dbDataContext();
     StartTimer();
     OpenTables();
     if (table_numComboBox.Items.Count > 0)
     {
         table_numComboBox.SelectedIndex = 0;
     }
     else
     {
         MessageBox.Show("There is no available free consoles. Sorry for that!");
         Close();
     }
 }
Example #2
0
 public CellClickContent(List<string> dataList)
 {
     _dailyId = int.Parse(dataList[0]);
     _opt = new Options();
     InitializeComponent();
 }
Example #3
0
        private void SetPrice()
        {
            Options opt = new Options();
            DateTime currentTime = DateTime.Now;
            if (numericUpDownHoursLeft.Value < 0 || numericUpDownMinutesLeft.Value < 0)
            {
                numericUpDownHoursLeft.Value = 0;
                numericUpDownMinutesLeft.Value = 0;
            }
            if (radioButtonTimeOut.Checked == true)
            {
                if (numericUpDownHoursLeft.Value >= 0 || numericUpDownMinutesLeft.Value >= 0)
                {
                    TimeSpan toPlay = new TimeSpan((int)numericUpDownHoursLeft.Value/24, (int)numericUpDownHoursLeft.Value, (int)numericUpDownMinutesLeft.Value, 0);

                    double price = opt.GetSumToPay(table_numComboBox.Text, toPlay,currentTime);
                    if (price < 0)
                    {
                        paid_price_numeric_up_down.Value = 0;
                    }
                    else if ((decimal)price < paid_price_numeric_up_down.Minimum && (decimal)price > paid_price_numeric_up_down.Maximum)
                    {
                        MessageBox.Show("Price is lower than 0 or higher than 30 000 \nIt is very high price please check entered data");
                    }
                    else
                    {
                        paid_price_numeric_up_down.Value = Math.Round((decimal)price, 2);
                    }
                }
            }
        }