private void RegisterNewSaleFrom_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the other Products option
                registerNewProductMenuSubOption.Visible = false;
                registerNewProductMenuSubOption.Enabled = false;
                restockProductsMenuSubOption.Visible    = false;
                restockProductsMenuSubOption.Enabled    = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;

                SystemProtocols.ApplyActivityProtocols("SAL1", null, null);
            }
            else
            {
                SystemProtocols.ApplyActivityProtocols("SAL4", null, null);
            }

            PopulateProductDataGrid();
            UpdateCartSummaryDataGrid();
        }
Ejemplo n.º 2
0
        private void ReportsAnalyticsForm_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the other Products option
                registerNewProductMenuSubOption.Visible = false;
                registerNewProductMenuSubOption.Enabled = false;
                restockProductsMenuSubOption.Visible    = false;
                restockProductsMenuSubOption.Enabled    = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            // Initializing latest date time pickers
            #region Users' Timesheet Report
            newestTimesheetDateTimePicker.Value   = DateTime.Now;
            newestTimesheetDateTimePicker.MaxDate = DateTime.Today.AddDays(1);
            #endregion

            #region Users's Sales Record
            newestSalesRecordDateTimePicker.Value   = DateTime.Now;
            newestSalesRecordDateTimePicker.MaxDate = DateTime.Today.AddDays(1);
            #endregion

            // Recording admin access to this form
            SystemProtocols.ApplyActivityProtocols("REP1", null, null);
        }
        private void CreateAndReturnButton_Click(object sender, EventArgs e)
        {
            if (ValidateUserInput())                                                                          // Verifying if user input confirm with all requirements
            {
                String message = UserInformationManager.CreateNewUserProfileInformation(CreateUserProfile()); // Confimring the user creation process

                if (message == "SUCCESS")                                                                     // Creation process has been successful
                {
                    messageLabel.Text = "User has been created succesfully!";
                    ClearTextBoxBuffers(); // cleaning textboxes

                    // Closing form while freeing system resources
                    FormsMenuList.registerNewUserForm.Dispose();

                    // Summon Users Registry Form
                    FormsMenuList.usersRegistryForm = new UsersRegistryForm();
                    FormsMenuList.usersRegistryForm.Show();
                }
                else
                {
                    // Executing correct activity according to given code
                    SystemProtocols.ApplyActivityProtocols("ERR2", null, null);
                    messageLabel.Text = "A Fatal Error has occured!"; // The new user profile has not been created due to en error
                }
            }
            else
            {
                messageLabel.Text = "Please fill in every information correctly"; // user input has not been validated
            }
        }
        private void RegisterNewUserForm_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the other Products option
                registerNewProductMenuSubOption.Visible = false;
                registerNewProductMenuSubOption.Enabled = false;
                restockProductsMenuSubOption.Visible    = false;
                restockProductsMenuSubOption.Enabled    = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            // Inictializing message labels
            messageLabel.Text                      = "";
            usernameErrorLable.Visible             = false;
            passwordErrorLabel.Text                = "Invalid Password";
            passwordErrorLabel.Visible             = false;
            confirmationPasswordErrorLabel.Visible = false;

            // Executing correct activity according to given code
            SystemProtocols.ApplyActivityProtocols("USE2", null, null);
        }
Ejemplo n.º 5
0
        private void GraphsAnalyticsForm_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the entire Products option given the remainder of options are prohibited for a basic user
                registerNewProductMenuSubOption.Visible = false;
                registerNewProductMenuSubOption.Enabled = false;
                restockProductsMenuSubOption.Visible    = false;
                restockProductsMenuSubOption.Enabled    = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            // Recording user access to this form
            SystemProtocols.ApplyActivityProtocols("GRA1", null, null);

            // Hiding message lables
            missingMessageLabel.Visible = false;
            shownMessageLabel.Visible   = false;

            // Initilizing combo box
            timeComboBox.Items.Add("24 hours");
            timeComboBox.Items.Add("72 hours");
            timeComboBox.Items.Add("week");
            timeComboBox.Items.Add("2 weeks");
            timeComboBox.Items.Add("month");
            timeComboBox.Items.Add("2 months");
            timeComboBox.SelectedIndex = 0;

            // Populating Graphs
            PopulateUsernameTimesheetListBox();
            PopulateUsernameSalesListBox();

            // Initializing date time pickers
            #region Bubble Chart
            newestBubbleDateTimePicker.Value   = DateTime.Now;
            newestBubbleDateTimePicker.MaxDate = DateTime.Today.AddDays(1);
            #endregion

            #region Sales Bar Chart
            newestSalesBarChartDateTimePicker.Value   = DateTime.Now;
            newestSalesBarChartDateTimePicker.MaxDate = DateTime.Today.AddDays(1);
            #endregion
        }
Ejemplo n.º 6
0
        private void ErrorsLogForm_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the entire Products option given the remainder of options are prohibited for a basic user
                registerNewProductMenuSubOption.Visible = false;
                registerNewProductMenuSubOption.Enabled = false;
                restockProductsMenuSubOption.Visible    = false;
                restockProductsMenuSubOption.Enabled    = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            SystemProtocols.ApplyActivityProtocols("ERR1", null, null);
        }
        private void InventorySearchForm_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the entire Products option given the remainder of options are prohibited for a basic user
                productsMenuOption.Visible = false;
                productsMenuOption.Enabled = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            PopulateProductListDataGrid(); // Initializing the data grid upon load

            // Executing correct activity according to given code
            SystemProtocols.ApplyActivityProtocols("INV1", null, null);
        }
Ejemplo n.º 8
0
        private void RestockProductsForm_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the other Products option
                registerNewProductMenuSubOption.Visible = false;
                registerNewProductMenuSubOption.Enabled = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            SystemProtocols.ApplyActivityProtocols("PRO1", null, null);

            PopulateProductListDataGrid();
            UpdateDisplayLabels();
        }
Ejemplo n.º 9
0
        private void ActivitiesLogForm_Load(object sender, EventArgs e)
        {
            // Limiting option according to current user's access level
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the entire Products option given the remainder of options are prohibited for a basic user
                registerNewProductMenuSubOption.Visible = false;
                registerNewProductMenuSubOption.Enabled = false;
                restockProductsMenuSubOption.Visible    = false;
                restockProductsMenuSubOption.Enabled    = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            // Executing correct activity according to given code
            SystemProtocols.ApplyActivityProtocols("ACT1", null, null);

            PopulateActivityListDataGrid();
        }
Ejemplo n.º 10
0
        private void RegisterNewProductForm_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the other Products option
                restockProductsMenuSubOption.Visible = false;
                restockProductsMenuSubOption.Enabled = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            PopulateBrandListBox();
            PopulateSupplierListBox();
            PopulateCategoryComboBox();
            PopulateTypeComboBox();

            // Executing correct activity according to given code
            SystemProtocols.ApplyActivityProtocols("PRO2", null, null);
        }
        private void CreateNewUserButton_Click(object sender, EventArgs e)
        {
            if (ValidateUserInput())                                                                          // Verifying if user input confirm with all requirements
            {
                String message = UserInformationManager.CreateNewUserProfileInformation(CreateUserProfile()); // Confimring the user creation process

                if (message == "SUCCESS")                                                                     // Creation process has been successful
                {
                    messageLabel.Text = "User " + usernameTextBox.Text + " has been created succesfully!";
                    ClearTextBoxBuffers(); // cleaning textboxes
                }
                else
                {
                    // Executing correct activity according to given code
                    SystemProtocols.ApplyActivityProtocols("ERR2", null, null);
                    messageLabel.Text = "A Fatal Error has occured!"; // The new user profile has not been created due to en error
                }
            }
            else
            {
                messageLabel.Text = "Please fill in every information correctly"; // user input has not been validated
            }
        }
        private void UsersRegistryForm_Load(object sender, EventArgs e)
        {
            // Identifying correct protocol for current user in session
            if (SystemProtocols.ApplySessionsProtocols(1, null, null))
            {
                // Disabling the other Products option
                registerNewProductMenuSubOption.Visible = false;
                registerNewProductMenuSubOption.Enabled = false;
                restockProductsMenuSubOption.Visible    = false;
                restockProductsMenuSubOption.Enabled    = false;

                // Disabling all admin options
                adminMenuOption.Visible = false;
                adminMenuOption.Enabled = false;
            }

            PopulateUserResigtryDataGrid();

            // Executing correct activity according to given code
            SystemProtocols.ApplyActivityProtocols("USE1", null, null);

            PopulateActicityListDataGrid();
        }