Esempio n. 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string          user    = txtUsername.Text;
            string          pass    = txtPassword.Text;
            BidaDataContext bida    = new BidaDataContext();
            var             account = bida.Accounts.SingleOrDefault(x => x.UserName.Equals(user));

            if (account != null)
            {
                lblUserError.Text = "";
                if (account.Password.Equals(pass))
                {
                    lblPassEreor.Text = "";
                    frmHome frm = new frmHome(account);
                    frm.Show();
                    this.Hide();
                }
                else
                {
                    lblPassEreor.Text = "Mật khẩu không đúng";
                    txtPassword.Text  = "";
                    txtPassword.Focus();
                }
            }
            else
            {
                lblUserError.Text = "Tên tài khoản không đúng";
                txtUsername.Focus();
                txtPassword.Text = "";
            }
        }
Esempio n. 2
0
 public frmShowBill(Customer customer, OrderTable order)
 {
     InitializeComponent();
     db  = new BidaDataContext();
     ord = order;
     cus = customer;
 }
Esempio n. 3
0
        private void LoadTable()
        {
            bida = new BidaDataContext();
            flpTableList.Controls.Clear();
            var lstTable = from t in bida.BidaTables
                           join c in bida.TableCategories
                           on t.TableCatID equals c.TableCatId
                           select new
            {
                Id      = t.TableId,
                Name    = t.TableName,
                CatName = c.TableCatName,
                Status  = t.TableStatus
            };

            //tạo button as bàn
            foreach (var table in lstTable)
            {
                BidaTable bidaTable = bida.BidaTables.SingleOrDefault(x => x.TableId == table.Id);
                string    status;
                Button    btn = new Button()
                {
                    Width = 120, Height = 120
                };
                btn.Click += btn_Click;
                btn.Leave += btn_Leave;
                btn.Tag    = bidaTable;
                if (table.Status == 1)
                {
                    status = "Trống";
                }
                else
                {
                    status = "Đang chơi";
                }
                switch (status)
                {
                case "Trống":
                    c = btn.BackColor = Color.LimeGreen;
                    break;

                default:
                    c = btn.BackColor = Color.OrangeRed;
                    break;
                }
                btn.Text = table.Name + Environment.NewLine + Environment.NewLine + table.CatName + Environment.NewLine + Environment.NewLine + status;
                //thêm btn vào flpanel
                flpTableList.Controls.Add(btn);
            }
        }
Esempio n. 4
0
 public frmTable()
 {
     InitializeComponent();
     bida                   = new BidaDataContext();
     lstSv                  = new List <TableService>();
     timer                  = new Timer();
     timer.Interval         = 1000;
     timer.Tick            += timer_Tick;
     btnUpdateTable.Enabled = false;
     btnStartTime.Enabled   = false;
     btnEndTime.Enabled     = false;
     btnAddService.Enabled  = false;
     btnEndTime.Enabled     = false;
 }
Esempio n. 5
0
 public frmShowBill(OrderTable order)
 {
     InitializeComponent();
     db  = new BidaDataContext();
     ord = order;
 }
Esempio n. 6
0
 public frmUpdateTable(BidaTable table)
 {
     InitializeComponent();
     tb = table;
     db = new BidaDataContext();
 }
Esempio n. 7
0
 public frmAccount()
 {
     InitializeComponent();
     db = new BidaDataContext();
 }
Esempio n. 8
0
 public frmChangeTable(BidaTable table)
 {
     InitializeComponent();
     db = new BidaDataContext();
     tb = table;
 }
Esempio n. 9
0
 public frmNewTable()
 {
     InitializeComponent();
     db = new BidaDataContext();
 }
Esempio n. 10
0
 public frmViewer()
 {
     InitializeComponent();
     db = new BidaDataContext();
 }
Esempio n. 11
0
 public frmFindCustomer(OrderTable order)
 {
     InitializeComponent();
     db  = new BidaDataContext();
     ord = order;
 }
Esempio n. 12
0
 public frmOrderDetails(OrderTable order)
 {
     InitializeComponent();
     db  = new BidaDataContext();
     ord = order;
 }
Esempio n. 13
0
 public frmAddService()
 {
     InitializeComponent();
     db       = new BidaDataContext();
     services = new List <TableService>();
 }
Esempio n. 14
0
 public frmReport()
 {
     InitializeComponent(); hasCus = true;
     db = new BidaDataContext();
     btnOrderDetails.Enabled = false;
 }
Esempio n. 15
0
 public frmCustomer()
 {
     InitializeComponent();
     db = new BidaDataContext();
 }
Esempio n. 16
0
 public frmService()
 {
     InitializeComponent();
     db = new BidaDataContext();
 }