Esempio n. 1
0
        //-------------------------------------------------------------------------
        public CResultAErreur InitChamps(CIntervention intervention)
        {
            CResultAErreur result = m_exLinkField.FillDialogFromObjet(intervention);

            m_intervention = intervention;


            //Initialise le text du lien et le panel de l'onglet opération
            if (intervention.PhaseTicket != null && intervention.PhaseTicket.Ticket != null)
            {
                m_panelLienTicket.Visible        = true;
                m_lnkTicket.Text                 = intervention.PhaseTicket.Ticket.Numero;
                m_lblDescriptionTicket.Text      = intervention.PhaseTicket.Ticket.DescriptionGenerale;
                m_panelDescriptionTicket.Visible = true;
            }
            else
            {
                m_panelDescriptionTicket.Visible = false;
                m_panelLienTicket.Visible        = false;
            }

            //Initialise le combo
            if (!Intervention.IsNew())
            {
                m_gestionnaireModeEdition.SetModeEdition(m_cmbTypeIntervention, TypeModeEdition.Autonome);
                m_cmbTypeIntervention.LockEdition = true;
                InitComboTypeIntervention(false);
            }
            else
            {
                m_gestionnaireModeEdition.SetModeEdition(m_cmbTypeIntervention, TypeModeEdition.EnableSurEdition);
                m_cmbTypeIntervention.LockEdition = !m_gestionnaireModeEdition.ModeEdition;
                InitComboTypeIntervention(true);
            }
            m_cmbTypeIntervention.ElementSelectionne = intervention.TypeIntervention;


            m_selectSite.Init <CSite>("Libelle", true);
            m_selectSite.ElementSelectionne = Intervention.Site;

            InitListeVersions();

            m_gestionnaireTabControl.Reset();

            m_gestionnaireTabControl.ForceInitPageActive();

            return(result);
        }
Esempio n. 2
0
        //---------------------------- TAB CONTROL --------------------------
        private CResultAErreur m_gestionnaireTabControl_OnInitPage(object page)
        {
            CResultAErreur result = CResultAErreur.True;

            using (CWaitCursor waiter = new CWaitCursor())
            {
                if (page == tb_checklist)
                {
                    m_panelCheckList.InitChamps(m_intervention);
                }
                else if (page == tb_fiche)
                {
                    m_panelChampsCustom.ElementEdite = Intervention;
                }
                else if (page == tb_operations)
                {
                    int nb  = Intervention.RelationsListesOperations.CountNoLoad;
                    int nb2 = Intervention.RelationsListesOperations.Count;
                    m_gestionnaireEditionListeOp.ObjetEdite = Intervention.RelationsListesOperations;
                    InitSelectListeOperations();
                    InitOperationsPrev();

                    m_panelInfosListeOp.Visible = m_gestionnaireEditionListeOp.ObjetEnCours is CIntervention_ListeOperations;
                }
                else if (page == tb_planification)
                {
                    m_dtDebutPreplanifier.Value   = Intervention.DateDebutPrePlanifiee;
                    m_dtFinPreplanification.Value = Intervention.DateFinPrePlanifiee;
                    UpdateFractions();

                    CDonneesActeurUtilisateur user = CUtilSession.GetUserForSession(Intervention.ContexteDonnee);
                    if (Intervention.IsNew())
                    {
                        if (Intervention.UserPreplanifieur == null)
                        {
                            Intervention.UserPreplanifieur = user;
                        }
                        if (Intervention.UserPlanifieur == null)
                        {
                            Intervention.UserPlanifieur = user;
                        }
                    }

                    InitListesPlannifieurs(false);

                    if (Intervention.UserPreplanifieur != null)
                    {
                        m_txtSelectPreplanificateur.ElementSelectionne = Intervention.UserPreplanifieur.Acteur;
                    }
                    if (Intervention.UserPlanifieur != null)
                    {
                        m_txtSelectPlanificateur.ElementSelectionne = Intervention.UserPlanifieur.Acteur;
                    }

                    UpdateVisuForUser();

                    m_wndDureePrevue.UseValueFormat = false;
                    m_wndDureePrevue.DefaultFormat  = CGestionnaireUnites.GetUnite(CClasseUniteTemps.c_idH).LibelleCourt;
                    if (Intervention.DureePrevisionnelle != null)
                    {
                        m_wndDureePrevue.UnitValue = new CValeurUnite(Intervention.DureePrevisionnelle, CClasseUniteTemps.c_idH);
                    }

                    m_txtNbOperateursPrévus.IntValue = Intervention.NbOperateurSPrevus;

                    m_txtTauxHorairePrévu.InitAvecFiltreDeBase <CTypeConsommable>(
                        "Libelle",
                        new CFiltreData(CTypeConsommable.c_champClasseUniteString + "=@1",
                                        CClasseUniteTemps.c_idClasse),
                        false);
                    m_txtTauxHorairePrévu.ElementSelectionne = Intervention.TauxHorairePrevu;

                    m_panelFraction.Visible = m_editeurFraction.ObjetEnCours is CFractionIntervention;
                }
                else if (page == tb_realisation)
                {
                    InitCRs();
                    m_panelInfoGel.Init(Intervention);
                }
                else if (page == tb_ressources)
                {
                    InitIntervenants();
                    InitRessources();
                }
            }
            return(result);
        }