Ejemplo n.º 1
0
        private void btnHome_Click(object sender, EventArgs e, bool clickAccess)
        {
            UC_Dashboard dashboard = new UC_Dashboard();

            mainPanel.Controls.Clear();
            mainPanel.Controls.Add(dashboard);
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            UC_Dashboard vh = new UC_Dashboard(true);

            mainPanel.Controls.Clear();
            mainPanel.Controls.Add(vh);
        }
        private void btnUpdateAll_Click(object sender, EventArgs e)
        {
            UpdateAll();
            MessageBox.Show("Updated successfully!", "Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
            UC_Dashboard dc = new UC_Dashboard();

            this.Controls.Clear();
            Controls.Add(dc);
        }
Ejemplo n.º 4
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (_vehicle != null)
            {
                if (blClients.GetClient(txbId.Text) != null)
                {
                    _vehicle.Client = blClients.GetClient(txbId.Text);
                    blVehicle.InsertVehicle(_vehicle);
                }
                else if (blClients.GetClient(txbId.Text) == null)
                {
                    Client c1 = new Client(txbId.Text, txbName.Text, txbLastName.Text, new ContactInfo(txbCity.Text, txbAddress.Text, txbPhoneNumber.Text, txbEmail.Text));
                    blClients.InsertClient(c1);
                    _vehicle.Client = c1;
                    blVehicle.InsertVehicle(_vehicle);
                }
                DialogResult dg = MessageBox.Show("This car has successfully registred!", "Car Registration", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (dg == DialogResult.OK)
                {
                    UC_Dashboard allCars = new UC_Dashboard(true);
                    this.Controls.Clear();
                    this.Controls.Add(allCars);
                }
            }

            else if (_vehicle == null)
            {
                if (btnEdit.Text == "VALIDATE EDIT")
                {
                    try
                    {
                        blClients.UpdateClient(ChangeClientDetails(_client));

                        CallPanel(2);
                    }
                    catch
                    {
                        MessageBox.Show("Please fill the fields correctly!", "Invalid atempt input", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else if (btnEdit.Text == "EDIT THIS CLIENT")
                {
                    try
                    {
                        btnEdit.Text = "VALIDATE EDIT";
                        ReadClient(_client, false);
                    }
                    catch
                    {
                        MessageBox.Show("Please fill the fields correctly!", "Invalid atempt input", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        public void Paraqit()
        {
            DialogResult dr = MessageBox.Show($"Vehicle type: {app2.Vehicle.Type}\r\nVehicle Plate: {app2.Vehicle.LicensePlate}\r\nOwner: {app2.Vehicle.Client.Name}", "Appointment info", MessageBoxButtons.OK, MessageBoxIcon.Information);

            if (dr == DialogResult.OK)
            {
                this.Controls.Clear();
                UC_Dashboard db = new UC_Dashboard(null, app2.Vehicle.LicensePlate);
                this.Controls.Add(db);
            }
        }
Ejemplo n.º 6
0
        private void CallPanel(int number)
        {
            switch (number)
            {
            case 1:
                UC_Dashboard dash = new UC_Dashboard();
                this.Controls.Clear();
                this.Controls.Add(dash);
                break;

            case 2:
                UC_Company cc = new UC_Company();
                this.Controls.Clear();
                this.Controls.Add(cc);
                break;
            }
        }
Ejemplo n.º 7
0
        private void MainPage_Load(object sender, EventArgs e)
        {
            if (_appRegister != null)
            {
                UC_Dashboard dashboard = new UC_Dashboard();
                mainPanel.Controls.Clear();
                mainPanel.Controls.Add(dashboard);
            }

            btnAppointments.Enabled    = Access.Appointment;
            btnHome.Enabled            = Access.Dashboard;
            btnKlient.Enabled          = Access.Clients;
            btnRaports.Enabled         = Access.Reports;
            btnStaff.Enabled           = Access.Reports;
            btnStock.Enabled           = Access.Stock;
            btnGeneralSettings.Enabled = Access.Settings;
            button1.Enabled            = Access.Vehicles;
        }