//------------------------------------------- public static void Show(CFormEditionStandard formMaitresse, CPhaseSpecifications phase) { Instance.SetFormMaitresse(formMaitresse); Instance.m_panelMap.Init(phase); Instance.Show(); Instance.Focus(); }
//------------------------------------------------------------------------------ private void m_menuAfficherProjet_Click(object sender, EventArgs e) { CPhaseSpecifications phase = m_satisfactionSel as CPhaseSpecifications; if (phase != null && phase.Projet != null) { Init(phase.Projet); Refresh(); } }
public void Init(IResumeurDeCouts resumeur) { CPhaseSpecifications phase = resumeur as CPhaseSpecifications; if (phase != null && phase.Projet != null) { resumeur = phase.Projet; } m_resumeur = resumeur; FillDatas(); }
//------------------------------------------------------------------------------ private void afficherLaPhaseToolStripMenuItem_Click(object sender, EventArgs e) { CBesoin besoin = m_satisfactionSel as CBesoin; if (besoin != null && besoin.PhaseSpecifications != null) { CPhaseSpecifications phase = besoin.PhaseSpecifications; Init(phase); Refresh(); } }
//--------------------------------------------------------------- public static void ShowPhase(CPhaseSpecifications phase) { if (phase != null && !phase.IsNew()) { CFormPhaseSpecificationsPopup frm = new CFormPhaseSpecificationsPopup(); phase = phase.GetObjetInContexte(sc2i.win32.data.CSc2iWin32DataClient.ContexteCourant) as CPhaseSpecifications; frm.m_phase = phase; frm.Text = phase.Libelle; frm.Show(); } }
//------------------------------------------------------------------------------ private void m_menuSatisfaction_Opening(object sender, CancelEventArgs e) { m_menuAfficherPhase.Visible = m_satisfactionSel != null && m_satisfactionSel is CBesoin; if (m_satisfactionSel != null) { CDessinSatisfaction dessin = m_baseMap.GetDessin(m_satisfactionSel); CPhaseSpecifications phase = m_satisfactionSel as CPhaseSpecifications; m_menuAfficherProjet.Visible = dessin != null && phase != null && phase.Projet != null && dessin.DessinParent == null; } m_menuMasquerProjet.Visible = false; /*m_menuDetaillerSatisfaction.Visible = m_satisfactionSel is ISatisfactionBesoinAvecSousBesoins && m_satisfactionSel != m_satisfactionRacine; * m_menuDetaillerSatisfaction.Checked = m_satisfactionSel != null && m_setSatisfactionsExpanded.Contains(m_satisfactionSel);*/ }
//------------------------------------------------------- private void FillDatas() { m_bIsInitializing = true; if (m_resumeur != null) { double fCoutPrevisionnel = m_resumeur.GetCoutResume(false); double fCoutReel = m_resumeur.GetCoutResume(true); /*foreach (IElementACout elt in CUtilElementACout.GetElementsACoutFinaux(m_resumeur, false)) * fCoutPrevisionnel += elt.CoutPrevisionnel; * foreach ( IElementACout elt in CUtilElementACout.GetElementsACoutFinaux(m_resumeur, true )) * fCoutReel += elt.CoutReel;*/ /*CUtilElementACout.RecalculeCoutDescendant(m_resumeur, true, false, null); * CUtilElementACout.RecalculeCoutDescendant(m_resumeur, false, false, null); * m_txtCoutReel.DoubleValue = m_resumeur.CoutReel; * m_txtCoutCalculé.DoubleValue = m_resumeur.CoutPrevisionnel;*/ m_txtCoutReel.DoubleValue = fCoutReel; m_txtCoutCalculé.DoubleValue = fCoutPrevisionnel; CPhaseSpecifications phase = m_resumeur as CPhaseSpecifications; if (m_resumeur is CProjet) { phase = ((CProjet)m_resumeur).Specifications; } if (phase != null) { m_txtCoutSaisi.DoubleValue = phase.CoutSaisi; m_panelSaisi.Visible = true; } else { m_panelSaisi.Visible = false; } m_lblRegroupement.Text = m_resumeur.Libelle; } else { m_txtCoutCalculé.DoubleValue = 0; m_txtCoutReel.DoubleValue = 0; m_txtCoutSaisi.IntValue = 0; } m_bIsInitializing = false; }
//------------------------------------------------------------------------------ private void afficherLaPhaseToolStripMenuItem_Click(object sender, EventArgs e) { CBesoin besoin = m_satisfactionSel as CBesoin; if (besoin != null && besoin.PhaseSpecifications != null) { ISatisfactionBesoin sat = null; CPhaseSpecifications phase = besoin.PhaseSpecifications; if (phase != null && phase.Projet != null) { sat = phase.Projet; } else { sat = phase; } Init(sat); Refresh(); } }
//------------------------------------- void txtSelectTemplate_OnSelectObject(object sender, CObjetDonneeEventArgs args) { CPhaseSpecifications phase = args.Objet as CPhaseSpecifications; if (phase != null) { CElementDeGanttProjet prj = m_gantt.SelectedElement as CElementDeGanttProjet; CProjet projetParent = prj != null ? prj.ProjetAssocie : null; if (projetParent != null) { if (CFormAlerte.Afficher(I.T("Apply template '@1' to project '@2'|20730", phase.Libelle, projetParent.Libelle), EFormAlerteBoutons.OuiNon, EFormAlerteType.Question) == DialogResult.Yes) { CListeObjetsDonnees lst = phase.Besoins; lst.Filtre = new CFiltreData(CBesoin.c_champTypeBesoin + "=@1 and " + CTypeProjet.c_champId + " is null", (int)ETypeDonneeBesoin.Projet); CTypeProjet typeProjetDefault = null; if (lst.Count > 0) { typeProjetDefault = CFormSelectUnObjetDonnee.SelectObjetDonnee( I.T("Select default project type (for needs without project type)|20737"), typeof(CTypeProjet), null, "Libelle") as CTypeProjet; if (typeProjetDefault == null) { return; } } using (CWaitCursor waiter = new CWaitCursor()) { projetParent.ApplySpecificationTemplate(phase, typeProjetDefault); Reinit(); } } } } }
//-------------------------------------------------------------------- public void Init(CPhaseSpecifications phaseSpecifications) { CancelEdit(); CurrentItemIndex = null; Items = new CCustomizableListItem[0]; m_phaseSpecifications = phaseSpecifications; if (m_phaseSpecifications != null) { List <CCustomizableListItem> items = new List <CCustomizableListItem>(); CListeObjetsDonnees lstBesoins = m_phaseSpecifications.Besoins; lstBesoins.ReadDependances("BesoinsFils", "TypeProjet", "TypeEquipement", "TypeConsommable", "TypeOperation"); CRelationBesoin_Satisfaction.PreloadBesoinsSatisfaits(lstBesoins); lstBesoins.Filtre = new CFiltreData(CBesoin.c_champIdBesoinParent + " is null"); foreach (CBesoin besoin in lstBesoins) { AddItemBesoinEtFils(null, besoin, items); } Items = items.ToArray(); } m_panelResumeElementACout.Init(m_phaseSpecifications); Refresh(); }
//------------------------------------------------------------------------- public CFormEditionPhaseSpecifications(CPhaseSpecifications PhaseSpecifications, CListeObjetsDonnees liste) : base(PhaseSpecifications, liste) { // Cet appel est requis par le Concepteur Windows Form. InitializeComponent(); }
//------------------------------------------------------------------------- public CFormEditionPhaseSpecifications(CPhaseSpecifications PhaseSpecifications) : base(PhaseSpecifications) { // Cet appel est requis par le Concepteur Windows Form. InitializeComponent(); }