Пример #1
0
        public new void getComponents(NSADatabase d, NSAComponent[] allComponents)
        {
            if (components.Count > 0)
            {
                return;
            }
            MySqlDataReader reader     = d.CustomQuery("SELECT component FROM orderitemcomponents WHERE orderitemid = " + id + ";");
            List <int>      favcompIDs = new List <int>();

            if (reader != null)
            {
                while (reader.Read())
                {
                    favcompIDs.Add((int)reader["component"]);
                }
            }

            reader.Close();

            foreach (NSAComponent comp in allComponents)
            {
                if (favcompIDs.Contains(comp.ComponentID))
                {
                    components.Add(comp);
                    if (comp.Category == "Bread")
                    {
                        breadIndex = components.Count - 1;
                    }
                }
            }
        }
Пример #2
0
        //Loads the top 3 entrees to the form.
        private void Load_Top_Entrees()
        {
            NSADatabase db = new NSADatabase();

            db.OpenConnection();

            string[] Top3 = db.getTop3Entrees();

            for (int counter = 0; counter < Top3.Count(); counter++)
            {
                switch (counter)
                {
                case 0:
                    this.lblSandwich1.Visible = true;
                    this.lblSandwich1.Text    = Top3[counter];
                    break;

                case 1:
                    this.lblSandwich2.Visible = true;
                    this.lblSandwich2.Text    = Top3[counter];
                    break;

                case 2:
                    this.lblSandwich3.Visible = true;
                    this.lblSandwich3.Text    = Top3[counter];
                    break;
                }
            }
        }
Пример #3
0
        private NSADatabase db;       //db is used to connect to db

        public LogInForm(CultureInfo language)
        {
            InitializeComponent();
            ci = language;
            setLang();
            db = new NSADatabase();
        }
Пример #4
0
        private NSADatabase db; //db is used to connect to db

        public createLoyalty(CultureInfo language)
        {
            InitializeComponent();
            ci = language;
            db = new NSADatabase();
            setLang();
        }
Пример #5
0
 public CashForm2(long orderID, Decimal cost, NSADatabase db, StringBuilder receipt, string email)
 {
     InitializeComponent();
     this.orderID = orderID;
     this.cost    = cost;
     this.db      = db;
     this.receipt = receipt;
     this.email   = email;
 }
Пример #6
0
 public CreditForm1(long orderID, Decimal cost, NSADatabase db, StringBuilder receipt, string email)
 {
     InitializeComponent();
     this.orderID = orderID;
     this.cost    = cost;
     this.db      = db;
     this.receipt = receipt;
     this.email   = email;
     this.emailAddressText.Text = email;
 }
Пример #7
0
        public CashCreditSelect(long orderID, Decimal cost, NSADatabase db, StringBuilder receipt, string email)
        {
            InitializeComponent();
            this.orderID = orderID;
            this.cost    = cost;
            this.db      = db;
            this.receipt = receipt;
            this.email   = email;

            receipt.Append("Order #: " + orderID);
            receipt.AppendLine();
        }
Пример #8
0
        //constructor called when logging in as guest
        public KioskWindow(CultureInfo language)
        {
            ci = language;                           //set the language
            a  = Assembly.Load("CustomerInterface"); //load the assembly and resourcemanager
            rm = new ResourceManager("CustomerInterface.Lang.lang", a);

            InitializeComponent();
            db = new NSADatabase();
            db.OpenConnection();
            componentsList = db.getComponents();
            menu           = db.getMenu();

            updateMenu();
            currentOrder = new NSAOrder();
            setLang(ci);
        }
Пример #9
0
        //constructor called when logging in with a loyalty account
        public KioskWindow(CultureInfo language, List <string>[] accountNumber)
        {
            ci = language;                           //set the language
            a  = Assembly.Load("CustomerInterface"); //load the assembly and resourcemanager
            rm = new ResourceManager("CustomerInterface.Lang.lang", a);


            account = new NSALoyaltyAccount(accountNumber[0][0], accountNumber[1][0], accountNumber[2][0], accountNumber[3][0]);


            InitializeComponent();

            db = new NSADatabase();
            db.OpenConnection();
            componentsList = db.getComponents();
            menu           = db.getMenu();

            account.FavoriteItems = db.getFavoriteItems(account.getAccountNumber().ToString());
            foreach (NSAFavoriteItem it in account.FavoriteItems)
            {
                ListViewItem lvi = new ListViewItem(it.Name);
                lvi.Tag = it;
                favItemsListView.Items.Add(lvi);
            }

            account.FavoriteOrders = db.getFavoriteOrders(account.getAccountNumber());

            foreach (NSAOrder order in account.FavoriteOrders)
            {
                ListViewItem lvi = new ListViewItem(order.Id.ToString());
                lvi.Tag = order;
                FavOrdersView.Items.Add(lvi);
            }
            setAccountTab();
            updateMenu();
            currentOrder = new NSAOrder();
            setLang(ci);
        }