Example #1
0
 public win_add_item(win_pos winPOS)
 {
     InitializeComponent();
     win_pos = winPOS;
     checkBarcode.Focus();
     cbBrand();
 }
Example #2
0
 public addDiscount(win_pos pos)
 {
     InitializeComponent();
     win_pos = pos;
     discountContent();
     totalDue = win_pos.pay_total.Text;
 }
Example #3
0
        public window_change_quantity(win_pos winPOS, string trans_no, string sales_item)
        {
            InitializeComponent();
            win_pos = winPOS;

            transNo   = trans_no;
            salesItem = sales_item;
        }
        public win_settings(win_pos winPOS)
        {
            InitializeComponent();
            win_pos = winPOS;

            st_cashier_name.Text = win_pos.cashierName.Text;
            st_acc_no.Text       = win_pos.accNo.Text;

            fetchCashier();
        }
        public void Login()
        {
            string username = txtUsername.Text.Trim();
            string pwd      = txtPassword.Password.Trim();
            // Call Auth Class
            Authentication auth = new Authentication(username, pwd);

            acc_no = auth.getAccNo(username);
            if (auth.isEmpty())
            {
                MessageBox.Show("Fields cannot be empty", "Notice", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            else
            {   // Check if username in database
                if (auth.checkUsername())
                {
                    // If Password is Correct
                    if (auth.checkUserPassword())
                    {
                        try
                        {
                            string userPrev = auth.getUserPrevilages(); // Users Previleges
                            if (userPrev.Equals("Admin"))
                            {                                           // Go to Admin Dashboard
                                admin_window adminDashboard = new admin_window();
                                adminDashboard.Show();                  // Show Dashboard
                                this.Close();                           // Close Login
                            }
                            else if (userPrev.Equals("Users"))
                            {                         // Go to Users Dashboard
                                MainWindow usersDashbord = new MainWindow(acc_no, userTimeIn);
                                usersDashbord.Show(); // Show Dashboard
                                this.Close();         // Close Login
                            }
                            else if (userPrev.Equals("Cashier"))
                            {                           // Go to Users Dashboard
                                win_pos checkoutCashier = new win_pos(this);
                                checkoutCashier.Show(); // Show Dashboard
                                this.Close();           // Close Login
                            }
                            else
                            {   // IF Something Went Wrong // Error
                                MessageBox.Show("Something went wrong.", "Notice", MessageBoxButton.OK, MessageBoxImage.Error);
                            }
                        }
                        catch (Exception x)
                        {
                            MessageBox.Show(x.Message);
                        }
                    }
                    else
                    {
                        // Wrong Pass
                        MessageBox.Show("Invalid Username or Password", "Notice", MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                }
                else
                {   // No user
                    MessageBox.Show("Your account is pending/deactivated", "Notice", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }
            }
        }
Example #6
0
 public win_receipt(win_pos winPOS)
 {
     InitializeComponent();
     win_pos = winPOS;
     //ReportViewerDemo.RenderingComplete += new RenderingCompleteEventHandler(RenderingCompleteEventHandler);
 }