Example #1
0
        private void getDate()
        {
            System.Globalization.CultureInfo cultureinfo = new System.Globalization.CultureInfo("vi-VN");
            DateTime dateTime;
            string   dt = "";

            if (connection.IsConnect())
            {
                dt = connection.getEntryDateTime(Table_id);

                if (dt != null && dt.Length > 0)
                {
                    dateTime = DateTime.Parse(dt);
                    string dt1 = dateTime.ToString(" HH:mm dd/MM/yyyy");
                    Console.WriteLine("dt1 = " + dt1);
                    lblDate.Text = dt1;
                }
                string to = connection.getEntryTimeOut(Table_id);
                if (to != "aa" || to.Length > 2)
                {
                    label3.Text = "Đã Thanh Toán";
                    BackColor   = Color.Empty;
                    table.DisableButtons();
                }
            }
            if (dt == null || dt.Length == 0)
            {
                dateTime     = DateTime.Now;
                lblDate.Text = dateTime.ToString(cultureinfo);
            }
        }
Example #2
0
        //add new entryTable
        private void btnNew_Click(object sender, EventArgs e)
        {
            FrmNewTable frmNewTable = new FrmNewTable(tableListNum);

            frmNewTable.ShowDialog();
            int  num = frmNewTable.Num;
            long table_id;

            if (num >= 0)
            {
                if (dBConnection.IsConnect())
                {
                    table_id = dBConnection.addToAllTables(num);
                    //Console.WriteLine("table_id = {0}", table_id);
                    dBConnection.addToCurrentTable(table_id);
                    createNewEntryTable(num, true, table_id);
                }
                else
                {
                    createNewEntryTable(num, true, -1);
                }
            }
        }
Example #3
0
        public TableListForm()
        {
            InitializeComponent();
            tableListNum = new List <int>();
            entries      = new List <EntryTableControl>();

            //timer to update the datagridview


            dBConnection = helper.DBConnection.Instance();
            if (dBConnection.IsConnect())
            {
                dataGridView1.DataSource = dBConnection.currentOrderTable();
                dataGridView1.Invalidate();
            }
            else
            {
                MessageBox.Show("Ko ket noi dc voi du lieu");
            }
            dataGridView1.AutoSizeColumnsMode   = DataGridViewAutoSizeColumnsMode.AllCells;
            dataGridView1.Columns["ID"].Visible = false;
        }