Ejemplo n.º 1
0
        private void btnAddUserFunction_Click(object sender, EventArgs e)
        {
            PhantomForm PhantomForm = new Infinium.PhantomForm();

            PhantomForm.Show();

            int StaffListID = UsersResponsibilities.GetStaffListID(iFactoryID, iDepartmentID, Security.CurrentUserID, iPositionID);
            FunctionsManagementForm FunctionsManagementForm = new FunctionsManagementForm(StaffListID, Security.CurrentUserID);

            TopForm = FunctionsManagementForm;

            FunctionsManagementForm.ShowDialog();

            PhantomForm.Close();
            PhantomForm.Dispose();

            TopForm = null;

            FunctionsManagementForm.Close();
            FunctionsManagementForm.Dispose();

            if (iFactoryID == 1)
            {
                tUsersResponsibilities.UpdateProfilFunctions();
                dgvUsersFunctions.DataSource = tUsersResponsibilities.GetProfilPositionFunctions(iPositionID);
            }
            if (iFactoryID == 2)
            {
                tUsersResponsibilities.UpdateTPSFunctions();
                dgvUsersFunctions.DataSource = tUsersResponsibilities.GetTPSPositionFunctions(iPositionID);
            }
        }
Ejemplo n.º 2
0
        private void btnAddResponsibility_Click(object sender, EventArgs e)
        {
            Thread T = new Thread(delegate() { SplashWindow.CreateSplash(); });

            T.Start();

            int FactoryID    = 0;
            int DepartmentID = 0;
            int UserID       = 0;
            int PositionID   = 0;

            if (cmbFactory.SelectedItem != null)
            {
                FactoryID = Convert.ToInt32(cmbFactory.SelectedValue);
            }
            if (cmbDepartments.SelectedItem != null)
            {
                DepartmentID = Convert.ToInt32(cmbDepartments.SelectedValue);
            }
            if (cmbUsers.SelectedItem != null)
            {
                UserID = Convert.ToInt32(cmbUsers.SelectedValue);
            }
            if (cmbPositions.SelectedItem != null)
            {
                PositionID = Convert.ToInt32(cmbPositions.SelectedValue);
            }
            int StaffListID = UsersResponsibilities.GetStaffListID(FactoryID, DepartmentID, UserID, PositionID);
            FunctionsManagementForm FunctionsManagementForm = new FunctionsManagementForm(ref AdminFunctionsEdit, StaffListID, UserID);

            TopForm = FunctionsManagementForm;

            FunctionsManagementForm.ShowDialog();

            FunctionsManagementForm.Close();
            FunctionsManagementForm.Dispose();
            UsersResponsibilities.UpdateUsersResponsibilities();
            while (SplashWindow.bSmallCreated)
            {
                SmallWaitForm.CloseS = true;
            }
        }