//------------------------------------------------------------------------------ public CImputationsCouts GetImputationsAFaireSurUtilisateursDeCout() { CImputationsCouts imputations = new CImputationsCouts(this); COperation operationParente = OperationParente; if (operationParente != null && (operationParente.Row.RowState == DataRowState.Deleted || operationParente.Row.RowState == DataRowState.Detached)) { operationParente.VersionToReturn = DataRowVersion.Original; } if (operationParente != null) { imputations.AddImputation(operationParente, imputations.PoidsTotal == 0 ? 1 : 0, null); } if (FractionIntervention != null) { imputations.AddImputation(FractionIntervention, imputations.PoidsTotal == 0 ? 1 : 0, null); } else if (Intervention != null) { imputations.AddImputation(Intervention, imputations.PoidsTotal == 0 ? 1 : 0, null); } return(imputations); }
//--------------------------------------------- public CImputationsCouts GetImputationsAFaireSurUtilisateursDeCout() { CImputationsCouts imputations = new CImputationsCouts(this); foreach (CRelationBesoin_Satisfaction rel in RelationsSatisfaits) { imputations.AddImputation(rel.Besoin, rel.RatioCoutReelApplique, rel); } return(imputations); }
//----------------------------------------------------------------------- public CImputationsCouts GetImputationsAFaireSurUtilisateursDeCout() { CImputationsCouts imputations = new CImputationsCouts(this); if (Intervention != null) { imputations.AddImputation(Intervention, 1, null); } return(imputations); }
private ToolStripItem CreateItemSatisfaction(IElementACout utilisateur, IElementACout source) { CImputationsCouts imputation = source.GetImputationsAFaireSurUtilisateursDeCout(); if (imputation != null) { CImputationCout i = imputation.GetImputation(utilisateur); if (i != null && i.Poids != 0) { double fVal = imputation.GetCoutImputéeA(utilisateur, m_bMenuForCoutReel); ToolStripMenuItem itemElementACout = new ToolStripMenuItem(); itemElementACout.Text = fVal.ToString("0.####") + " "; if (source is ISatisfactionBesoin) { itemElementACout.Text += ((ISatisfactionBesoin)source).LibelleSatisfactionComplet; } else { itemElementACout.Text += source.Libelle; } if (source is ISatisfactionBesoin && utilisateur is CBesoin) { double fPct = CUtilSatisfaction.GetPourcentageFor((CBesoin)utilisateur, (ISatisfactionBesoin)source); itemElementACout.Text += " (" + fPct.ToString("0.##") + "%)"; } else { itemElementACout.Text += " (100%)"; } itemElementACout.Tag = source; itemElementACout.Image = DynamicClassAttribute.GetImage(source.GetType()); if (fVal == 0) { itemElementACout.BackColor = Color.LightPink; } if (source.GetSourcesDeCout(m_bMenuForCoutReel).Length > 0) { ToolStripMenuItem dummy = new ToolStripMenuItem(); itemElementACout.DropDownItems.Add(dummy); itemElementACout.DropDownOpening += new EventHandler(itemElementACout_DropDownOpening); } itemElementACout.MouseUp += new MouseEventHandler(itemElementACout_MouseUp); return(itemElementACout); } } return(null); }