示例#1
0
        //------------------------------------------------------------------------------
        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);
        }
示例#2
0
        //---------------------------------------------
        public CImputationsCouts GetImputationsAFaireSurUtilisateursDeCout()
        {
            CImputationsCouts imputations = new CImputationsCouts(this);

            foreach (CRelationBesoin_Satisfaction rel in RelationsSatisfaits)
            {
                imputations.AddImputation(rel.Besoin, rel.RatioCoutReelApplique, rel);
            }
            return(imputations);
        }
示例#3
0
        //-----------------------------------------------------------------------
        public CImputationsCouts GetImputationsAFaireSurUtilisateursDeCout()
        {
            CImputationsCouts imputations = new CImputationsCouts(this);

            if (Intervention != null)
            {
                imputations.AddImputation(Intervention, 1, null);
            }
            return(imputations);
        }
示例#4
0
        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);
        }