public ucCategoryPanel(frmClient client, Category category)
        {
            InitializeComponent();
            Client        = client;
            Category      = category;
            lblTitle.Text = category.Name;
            picGroupIcon.BackgroundImage = Category.LoadIconImage();

            // starting values for position of shortcuts
            int x       = 90;
            int y       = 55;
            int columns = 1;

            foreach (ProgramShortcut psc in this.Category.ShortcutList) // since this is calculating uc height it cant be placed in load
            {
                if (columns == 8)
                {
                    x            = 90; // resetting x
                    y           += 40; // adding new row
                    this.Height += 40;
                    columns      = 1;
                }
                CreateShortcut(x, y, psc);
                x += 50;
                columns++;
            }
        }
示例#2
0
        public ucCategoryPanel(frmClient client, Category category)
        {
            InitializeComponent();
            Client        = client;
            Category      = category;
            lblTitle.Text = Regex.Replace(category.Name, @"(_)+", " ");
            picGroupIcon.BackgroundImage = Category.LoadIconImage();

            // starting values for position of shortcuts
            int x       = 90;
            int y       = 55;
            int columns = 1;

            if (!Directory.Exists((@"config\" + category.Name) + "\\Icons\\"))
            {
                category.cacheIcons();
            }

            foreach (ProgramShortcut psc in Category.ShortcutList)     // since this is calculating uc height it cant be placed in load
            {
                if (columns == 8)
                {
                    x            = 90; // resetting x
                    y           += 40; // adding new row
                    this.Height += 40;
                    columns      = 1;
                }
                CreateShortcut(x, y, psc);
                x += 50;
                columns++;
            }
        }
示例#3
0
        private void clientsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmClient fr = new frmClient();

            fr.MdiParent = this;
            fr.Show();
        }
示例#4
0
 private void btnEditClient_Click(object sender, EventArgs e)
 {
     if (clientID != 0)
     {
         frmClient user = new frmClient(clientID, this);
         user.Show();
     }
     else
     {
         MessageBox.Show("Please Select User to Edit");
     }
 }
示例#5
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            frmAdmin  fa = new frmAdmin();
            frmClient fc = new frmClient();

            if (txtUser.Text == "" || txtPass.Text == "")
            {
                MessageBox.Show("¡Los espacios no pueden quedar en blanco!", "Error de inicio de sesion",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                try
                {
                    string Uquery = $"SELECT userType FROM APPUSER WHERE" +
                                    $" username = '******' AND " +
                                    $"password = '******'";

                    var dt    = ConnectionDB.ExecuteQuery(Uquery);
                    var dr    = dt.Rows[0];
                    var admin = Convert.ToString(dr[0].ToString());

                    if (admin.Equals("true", StringComparison.OrdinalIgnoreCase))
                    {
                        this.Hide();
                        fa.Show();
                    }
                    else
                    {
                        this.Hide();
                        fc.Show();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("¡Usuario no registrado o los datos ingresados incorrectos!", "Error de inicio de sesion",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
        }
示例#6
0
        private void button3_Click(object sender, EventArgs e)
        {
            frmClient myForm = new frmClient();

            myForm.Show();
        }
示例#7
0
        private void GenerateContentForClickItems(string formName, bool clickForSearch)
        {
            if (formName == VehicleReports)
            {
                frmVehiclesReport frm = new frmVehiclesReport();
                frm.MdiParent   = this;
                frm.WindowState = FormWindowState.Maximized;
                frm.Show();
            }

            if (formName == Branches)
            {
                if (clickForSearch)
                {
                    frmBranch frm = new frmBranch();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateBranch frm = new frmAddUpdateBranch();
                    frm.Show();
                }
            }

            if (formName == Clients)
            {
                if (clickForSearch)
                {
                    frmClient frm = new frmClient();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateClient frm = new frmAddUpdateClient();
                    frm.Show();
                }
            }

            if (formName == Countries)
            {
                if (clickForSearch)
                {
                    frmCountries frm = new frmCountries();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddCountry frm = new frmAddCountry();
                    frm.Show();
                }
            }

            if (formName == Employees)
            {
                if (clickForSearch)
                {
                    frmEmployees frm = new frmEmployees();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateEmployee frm = new frmAddUpdateEmployee();
                    frm.Show();
                }
            }

            if (formName == EmployeeRoles)
            {
                if (clickForSearch)
                {
                    frmEmployeeRoles frm = new frmEmployeeRoles();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateEmployeeRoles frm = new frmAddUpdateEmployeeRoles();
                    frm.Show();
                }
            }

            if (formName == Insurance)
            {
                if (clickForSearch)
                {
                    frmInsurance frm = new frmInsurance();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateInsurance frm = new frmAddUpdateInsurance();
                    frm.Show();
                }
            }

            if (formName == Ratings)
            {
                if (clickForSearch)
                {
                    frmRating frm = new frmRating();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
            }

            if (formName == Reservations)
            {
                if (clickForSearch)
                {
                    frmReservation frm = new frmReservation();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
            }

            if (formName == VehicleCategories)
            {
                if (clickForSearch)
                {
                    frmVehicleCategory frm = new frmVehicleCategory();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateVehicleCategory frm = new frmAddUpdateVehicleCategory();
                    frm.Show();
                }
            }

            if (formName == Vehicles)
            {
                if (clickForSearch)
                {
                    frmVehicle frm = new frmVehicle();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateVehicle frm = new frmAddUpdateVehicle();
                    frm.Show();
                }
            }

            if (formName == VehicleFuelTypes)
            {
                if (clickForSearch)
                {
                    frmVehicleFuelType frm = new frmVehicleFuelType();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateVFuelType frm = new frmAddUpdateVFuelType();
                    frm.Show();
                }
            }

            if (formName == VehicleManufacturers)
            {
                if (clickForSearch)
                {
                    frmVehicleManufacturer frm = new frmVehicleManufacturer();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateVehicleManufacturer frm = new frmAddUpdateVehicleManufacturer();
                    frm.Show();
                }
            }

            if (formName == VehicleModels)
            {
                if (clickForSearch)
                {
                    frmVehicleModel frm = new frmVehicleModel();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateVehicleModel frm = new frmAddUpdateVehicleModel();
                    frm.Show();
                }
            }

            if (formName == VehicleTransmissionTypes)
            {
                if (clickForSearch)
                {
                    frmVehicleTransmissionType frm = new frmVehicleTransmissionType();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateVehicleTransmissionType frm = new frmAddUpdateVehicleTransmissionType();
                    frm.Show();
                }
            }

            if (formName == VehicleTypes)
            {
                if (clickForSearch)
                {
                    frmVehicleType frm = new frmVehicleType();

                    frm.MdiParent   = this;
                    frm.WindowState = FormWindowState.Maximized;
                    frm.Show();
                }
                else
                {
                    frmAddUpdateVehicleType frm = new frmAddUpdateVehicleType();
                    frm.Show();
                }
            }
        }
示例#8
0
        private void gestionClientsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmClient client = new frmClient();

            client.ShowDialog();
        }
示例#9
0
 // On appelle l'objet frmClient pour envoyer le statut du client
 public Download(frmClient myForm)
 {
     f = myForm;
 }
示例#10
0
        private void btnCreateClient_Click(object sender, EventArgs e)
        {
            frmClient user = new frmClient(0, this);

            user.Show();
        }
示例#11
0
 // On appelle l'objet frmClient pour envoyer le statut
 public Upload(frmClient myForm)
 {
     f = myForm;
 }