コード例 #1
0
        //--------------------------------------------------------------
        public void Init(CProjet projet)
        {
            m_projetEdite = projet;

            if (m_projetEdite != null)
            {
                // Supprime tous les controles du panel contraintes
                ArrayList lstToRemove = new ArrayList(m_panelContraintes.Controls);
                foreach (Control ctrl in lstToRemove)
                {
                    if (ctrl is CControlEditionContrainteDeProjet)
                    {
                        ctrl.Visible = false;
                        ctrl.Parent  = null;
                        m_panelContraintes.Controls.Remove(ctrl);
                        ctrl.Dispose();
                    }
                }

                // Charge tous les parametres Icone
                foreach (IContrainteDeProjet contrainte in m_projetEdite.ContraintesPropres)
                {
                    AjouterControlContrainte(contrainte);
                }
            }
        }
コード例 #2
0
        private DialogResult AfficherEditeur(I2iObjetGraphique o)
        {
            ETypeElementDeProjet?t      = CUtilProjet.GetTypeElement(o);
            CResultAErreur       result = CResultAErreur.True;

            switch (t)
            {
            case ETypeElementDeProjet.Projet:
                CProjet projet = ((CWndProjetBrique)o).Projet;
                result = AfficherEditeur(projet);
                break;

            case ETypeElementDeProjet.Intervention:
                CIntervention inter = ((CWndIntervention)o).Intervention;
                result = AfficherEditeur(inter);
                break;

            case ETypeElementDeProjet.Lien:
            default:
                return(DialogResult.Abort);
            }
            if (!result)
            {
                return(DialogResult.Abort);
            }

            return(DialogResult.OK);
        }
コード例 #3
0
        public CResultAErreur InitChamps(CProjet projet)
        {
            m_bInitialise = false;
            CResultAErreur result = CResultAErreur.True;

            m_projet = projet;

            CWndProjetDetail wnd = CWndProjetDetail.GetNewWnd(projet);

            m_controlEdition.WndProjetEdite = wnd;
            //m_controlEdition.Refresh();

            UpdateBoutonsMode();
            InitCmbFiltreContenu();
            m_spcGauche.SplitterDistance = m_lvContenu.Columns[0].Width + m_lvContenu.Columns[1].Width + 10;

            //if(m_nWithPanelEdit == 0)
            //    m_nWithPanelEdit = m_spcDroite.SplitterDistance;
            m_bEditeurMaque            = true;
            m_panEditionRapide.Visible = false;
            //m_spcDroite.SplitterDistance = m_spcDroite.Width;
            //m_spcDroite.IsSplitterFixed = true;

            m_chkMiniatures.Checked = m_projet.AfficherMiniature;
            m_bInitialise           = true;
            return(result);
        }
コード例 #4
0
ファイル: DAProjet.cs プロジェクト: NHerve/SuiviDeProjet
        public List <CProjet> GetAllProjet()
        {
            List <CProjet> listProjet = new List <CProjet>();

            connection.Open();
            SqlCommand myCommand = new SqlCommand();

            myCommand.Connection = connection;

            myCommand.CommandText = "SELECT [TPro_Id],[TPro_Nom],[TPro_TriProjet],[TPro_FK_TTri] FROM [TProjet] WHERE TPro_Actif = 1";

            SqlDataReader reader = myCommand.ExecuteReader();

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    CProjet projet = new CProjet((int)reader[0], reader[1].ToString(), reader[2].ToString(), (int)reader[3]);
                    listProjet.Add(projet);
                }
            }
            else
            {
                Console.WriteLine("No rows found.");
            }
            reader.Close();

            connection.Close();

            return(listProjet);
        }
コード例 #5
0
        //--------------------------------------------------------------------------
        public static CResultAErreur CreateSqueletteProjetsInCurrentContext(
            CWorkflow workflow,
            CTypeEtapeWorkflow typeEtapeDebut,
            CProjet projetParent)
        {
            CResultAErreur result = CResultAErreur.True;

            CTypeWorkflow typeWorkflow = workflow.TypeWorkflow;

            //Récupére le type d'étape de base
            CTypeEtapeWorkflow typeEtape = typeEtapeDebut;

            if (typeEtape == null)
            {
                typeEtape = typeWorkflow.EtapeDemarrageDefaut;
            }
            if (typeEtape == null)
            {
                return(result);
            }

            //règle de création : on ne suit que les liens systèmatiques (sans CodeRetour et sans formule)
            result = CreateProjets(workflow, typeEtape, projetParent);
            return(result);
        }
コード例 #6
0
        public void Init(IBaseGantt gantt, DateTime dateDebut, DateTime dateFin)
        {
            DateTime            dt        = DateTime.Now;
            CTreeViewNodeKeeper keepNodes = new CTreeViewNodeKeeper(this);

            m_baseGantt = gantt;
            m_dicNodes.Clear();
            m_bIsFilling = true;
            Nodes.Clear();

            foreach (IElementDeGantt elt in from elt in gantt.GetElements()
                     where elt.ElementParent == null
                     select elt)
            {
                TreeNode node = CreateNode(elt);
                Nodes.Add(node);
            }

            foreach (TreeNode node in Nodes)
            {
                if (node.Tag is CElementDeGanttProjet)
                {
                    CProjet projet = ((CElementDeGanttProjet)node.Tag).ProjetAssocie;
                    if (projet != null && projet.TypeProjet.DefaultExpand)
                    {
                        node.Expand();
                    }
                }
            }

            keepNodes.Apply(this);
            m_bIsFilling = false;
            TimeSpan sp = DateTime.Now - dt;
            //Console.WriteLine("Fill tree : " + sp.TotalMilliseconds);
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int       idProjet = int.Parse(Request.QueryString["idProjet"]);
            CProjet   projet   = daProjet.GetProjetById(idProjet);
            CExigence exigence = daExigence.GetExigenceById(ctrlIdExigence);

            idExi.InnerText = exigence.exi_id.ToString();
            if (exigence.exi_type.ToString() == "1")
            {
                typeExi.InnerText = "Fonctionnelle";
            }
            else if (exigence.exi_type.ToString() == "2")
            {
                typeExi.InnerText = "Données";
            }
            else if (exigence.exi_type.ToString() == "3")
            {
                typeExi.InnerText = "Preformance";
            }
            else if (exigence.exi_type.ToString() == "4")
            {
                typeExi.InnerText = "Interface utilisateur";
            }
            else if (exigence.exi_type.ToString() == "5")
            {
                typeExi.InnerText = "Qualité";
            }
            else if (exigence.exi_type.ToString() == "6")
            {
                typeExi.InnerText = "Services";
            }
            DescExi.InnerText = exigence.exi_description.ToString();
        }
コード例 #8
0
ファイル: DAProjet.cs プロジェクト: NHerve/SuiviDeProjet
        public CProjet GetProjetById(int id)
        {
            CProjet projet = null;

            connection.Open();
            SqlCommand myCommand = new SqlCommand();

            myCommand.Connection = connection;

            myCommand.CommandText = "SELECT [TPro_Id],[TPro_Nom],[TPro_TriProjet],[TPro_FK_TTri] FROM [TProjet] WHERE TPro_Id = @TPro_Id AND TPro_Actif = 1";
            myCommand.Parameters.Add(new SqlParameter("@TPro_Id", id));

            SqlDataReader reader = myCommand.ExecuteReader();

            if (reader.HasRows)
            {
                reader.Read();
                projet = new CProjet((int)reader[0], reader[1].ToString(), reader[2].ToString(), (int)reader[3]);
            }
            else
            {
                Console.WriteLine("No rows found.");
            }
            reader.Close();

            connection.Close();

            return(projet);
        }
コード例 #9
0
 //-------------------------------------------------
 public static CObjetDonneeAIdNumerique GetObjetProjetCandidat(
     CProjet projetRacine,
     CProjet projetCandidat,
     string strNomFichier)
 {
     return(projetCandidat);
 }
コード例 #10
0
        public void Reinit()
        {
            CProjet old = m_projet;

            m_projet = null;
            Init(old);
        }
コード例 #11
0
 //--------------------------------------------
 public CWndProjetDetail(CProjet projet)
     : base()
 {
     m_prj        = projet;
     Position     = new Point(0, 0);
     Size         = new Size(1000, 1000);
     m_bMiniature = false;
 }
コード例 #12
0
        //--------------------------------------------------------------------------
        public static CResultAErreur LinkProjetToWorkflowStep(CProjet projet,
                                                              CWorkflow workflow,
                                                              string strTypeEtape,
                                                              bool bSynchronizeStarts)
        {
            CResultAErreur     result    = CResultAErreur.True;
            CTypeEtapeWorkflow typeEtape = new CTypeEtapeWorkflow(projet.ContexteDonnee);

            if (!typeEtape.ReadIfExists(new CFiltreData(CObjetDonnee.c_champIdUniversel + "=@1",
                                                        strTypeEtape)))
            {
                result.EmpileErreur(I.T("Workflow step type @1 doesn't exists|20196", strTypeEtape));
                return(result);
            }
            if (typeEtape.Workflow.Id != workflow.TypeWorkflow.Id)
            {
                result.EmpileErreur(I.T("Workflow step type @1 doesn't belong to workflow type @2|20197"),
                                    strTypeEtape, workflow.TypeWorkflow.Libelle);
                return(result);
            }
            CBlocWorkflowProjet blocProjet = typeEtape.Bloc as CBlocWorkflowProjet;

            if (blocProjet == null)
            {
                result.EmpileErreur(I.T("Step type @1 is not a valid project step|20198",
                                        typeEtape.Libelle));
                return(result);
            }
            CResultAErreurType <CEtapeWorkflow> resEtape = workflow.CreateOrGetEtapeInCurrentContexte(typeEtape);

            if (!resEtape)
            {
                result.EmpileErreur(resEtape.Erreur);
                return(result);
            }
            if (resEtape.DataType == null)
            {
                result.EmpileErreur(I.T("Erreur while creating step for type '@1'|20199",
                                        typeEtape.Libelle));
                return(result);
            }
            CWorkflow sousWkf = blocProjet.GetOrCreateWorkflowInCurrentContexte(resEtape.DataType);

            if (sousWkf == null)
            {
                result.EmpileErreur(I.T("Erreur while creating workflow for stef @1|20200",
                                        resEtape.DataType.Libelle));
                return(result);
            }
            sousWkf.SetValeurChamp(blocProjet.IdChampProjet.Value, projet);
            projet.GanttId = blocProjet.GetGanttId(resEtape.DataType);
            return(SynchroniseWorkflow(
                       sousWkf,
                       projet,
                       projet.DateDebutReel != null && projet.DateFinRelle == null,
                       bSynchronizeStarts));
        }
コード例 #13
0
ファイル: CLienDeProjet.cs プロジェクト: ykebaili/Timos
        //-------------------------------------------------------------------
        public void TiagSetProjectBKeys(object[] lstCles)
        {
            CProjet projetB = new CProjet(ContexteDonnee);

            if (projetB.ReadIfExists(lstCles))
            {
                ProjetB = projetB;
            }
        }
コード例 #14
0
        public void Init(CMetaProjet metaProjet)
        {
            if (metaProjet != m_metaProjet)
            {
                DateTime dateDebut = DateTime.Now;
                dateDebut = metaProjet.DateDebutPlanifiee;
                m_parametreAffichage.DateDebut = m_parametreAffichage.AddCells(dateDebut, -1);
            }
            m_metaProjet = metaProjet;
            m_projet     = null;
            if (metaProjet != null)
            {
                m_contexteDonnee = metaProjet.ContexteDonnee;
            }

            CParametreDessinLigneGantt parametreDessinGantt;

            m_composantSauvegardePreferences.InitFromRegistre();

            if (m_parametreDessinLigne != null)
            {
                parametreDessinGantt = m_parametreDessinLigne;
            }
            else
            {
                parametreDessinGantt = CParametreDessinLigneGantt.ParametreParDefaut;
            }

            m_parametreAffichage.LineHeight = parametreDessinGantt.HauteurLigne;

            m_gantt.Visible   = false;
            m_gantt.Parametre = m_parametreAffichage;
            CFiltreData filtre = m_filtreDeBase;

            if (m_filtreUser != null)
            {
                filtre = CFiltreData.GetAndFiltre(filtre, m_filtreUser);
            }
            m_iconeHasFilter.Visible = m_filtreUser != null && m_filtreUser.Filtre != "" && m_filtreUser.Filtre != "1=1";
            CResultAErreur result = CParametrageGantt.CreateGantt(
                metaProjet,
                m_parametreGroupement == null ? null : m_parametreGroupement.GroupeRacine,
                filtre);

            if (result)
            {
                m_baseGantt     = result.Data as CBaseGantt;
                m_gantt.Visible = true;
                m_gantt.Init(m_baseGantt);
                m_gantt.ParametreDessinLigne = parametreDessinGantt;
            }
            m_cmbDisplayMode.Init(typeof(CParametrageGantt), "Libelle", false);
            if (m_parametreGroupement != null)
            {
                m_cmbDisplayMode.ElementSelectionne = m_parametreGroupement;
            }
        }
コード例 #15
0
ファイル: CBlocWorkflowProjet.cs プロジェクト: ykebaili/Timos
        //--------------------------------------------------------------------------
        private CResultAErreur StartOrRestartProjet(CEtapeWorkflow etape)
        {
            CResultAErreur result = CResultAErreur.True;
            CResultAErreurType <CProjet> resProjet = CGestionnaireProjetsDeWorkflow.AssureProjetRunnable(etape, this);

            if (!resProjet)
            {
                result.EmpileErreur(resProjet.Erreur);
                return(result);
            }
            CProjet projet = resProjet.DataType;

            if (projet == null)
            {
                return(result);
            }

            if (etape.DateDebut == null)
            {
                etape.DateDebut = DateTime.Now;
            }

            if (projet.ProjetsFils.Count == 0)
            {
                if (projet.DateDebutReel == null || GererIteration)
                {
                    projet.DateDebutReel = etape.DateDebut.Value;
                    projet.DateFinRelle  = null;
                }
                else if (!projet.HasOptionLienEtape(EOptionLienProjetEtape.StepKeepDates))
                {
                    projet.DateDebutReel = etape.DateDebut.Value;
                    projet.DateFinRelle  = null;
                }
            }
            CContexteEvaluationExpression ctxEval = new CContexteEvaluationExpression(etape);

            foreach (CAffectationsProprietes affectation in AffectationsCreationEtDemarrage)
            {
                bool bAppliquer = affectation.FormuleCondition == null || affectation.FormuleCondition is C2iExpressionVrai;
                if (affectation.FormuleCondition != null)
                {
                    CResultAErreur res = affectation.FormuleCondition.Eval(ctxEval);
                    if (res && res.Data != null && CUtilBool.BoolFromString(res.Data.ToString()) == true)
                    {
                        bAppliquer = true;
                    }
                }
                if (bAppliquer)
                {
                    affectation.AffecteProprietes(projet, etape, new CFournisseurPropDynStd());
                }
            }
            System.Console.WriteLine("Démarrage projet " + projet.Libelle);
            return(result);
        }
コード例 #16
0
        /// ////////////////////////////////////////////////////////
        protected override CResultAErreur MyExecute(CContexteExecutionAction contexte)
        {
            CResultAErreur result = CResultAErreur.True;

            CContexteEvaluationExpression ctxEval = new CContexteEvaluationExpression(Process);

            if (FormuleProjetParent == null)
            {
                result.EmpileErreur(I.T("Invalid project formula|20147"));
                return(result);
            }
            result = FormuleProjetParent.Eval(ctxEval);
            if (!result)
            {
                return(result);
            }
            CProjet projetParent = result.Data as CProjet;

            if (FormuleWorkflow == null)
            {
                result.EmpileErreur(I.T("Invalid workflow formula|20147"));
                return(result);
            }
            result = FormuleWorkflow.Eval(ctxEval);
            if (!result)
            {
                return(result);
            }
            CWorkflow workflow = result.Data as CWorkflow;

            if (workflow == null)
            {
                result.EmpileErreur(I.T("Invalid workflow|20149"));
                return(result);
            }

            CTypeEtapeWorkflow typeEtapeDebut = null;

            if (FormuleTypeEtapeDebut != null)
            {
                result = FormuleTypeEtapeDebut.Eval(ctxEval);
                if (!result)
                {
                    result.EmpileErreur(I.T("Invalid Start step formula|20155"));
                    return(result);
                }
                typeEtapeDebut = result.Data as CTypeEtapeWorkflow;
            }

            result = CGestionnaireProjetsDeWorkflow.CreateSqueletteProjetsInCurrentContext(
                workflow,
                typeEtapeDebut,
                projetParent);

            return(result);
        }
コード例 #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int       idProjet = int.Parse(Request.QueryString["idProjet"]);
            CProjet   projet   = daProjet.GetProjetById(idProjet);
            CExigence exigence = daExigence.GetExigenceById(ctrlIdTache);

            idExi.InnerText = exigence.exi_id.ToString();

            DescExi.InnerText = exigence.exi_description.ToString();
        }
コード例 #18
0
 public void Init(CProjet projet)
 {
     m_bInitialise                  = false;
     m_projet                       = projet;
     m_chkBoucles.Checked           = ((m_projet.TypesAnomaliesFiltres & ETypeAnomalieProjet.Boucle) == ETypeAnomalieProjet.Boucle);
     m_chkContraintes.Checked       = ((m_projet.TypesAnomaliesFiltres & ETypeAnomalieProjet.NonRespectContrainteDate) == ETypeAnomalieProjet.NonRespectContrainteDate);
     m_chkPrePlannification.Checked = ((m_projet.TypesAnomaliesFiltres & ETypeAnomalieProjet.PrePlanificationIncomplete) == ETypeAnomalieProjet.PrePlanificationIncomplete);
     m_chkPlannification.Checked    = ((m_projet.TypesAnomaliesFiltres & ETypeAnomalieProjet.PlanificationIncomplete) == ETypeAnomalieProjet.PlanificationIncomplete);
     m_chkInclurePrjsFils.Checked   = m_projet.InclureAnomaliesProjetsFils;
     m_bInitialise                  = true;
 }
コード例 #19
0
 //-------------------------------------------------
 private static CObjetDonneeAIdNumerique GetObjetProjetFromTemplate(
     string strTemplateKey,
     CProjet projetRacine)
 {
     if (projetRacine != null)
     {
         return(projetRacine.TousLesProjetsFils.FirstOrDefault(
                    p => p.SourceTemplateKey == strTemplateKey));
     }
     return(null);
 }
コード例 #20
0
 //-----------------------------------------------
 public CElementDeGanttProjet(IElementDeGantt elementParent, CProjet projet)
     : base(elementParent)
 {
     m_projet = projet;
     if (projet.TypeProjet != null)
     {
         Image = projet.TypeProjet.Image;
     }
     SetPctAvancementSansCalculDeParent(projet.PctAvancement);
     SetPoidSansCalculDeParent(Poids = projet.Poids);
 }
コード例 #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CTrigramme trigrammeResponsable = new CTrigramme();

            CProjet projet = daProjet.GetProjetById(ctrlIdProjet);

            idProjet.InnerText    = projet.pro_id.ToString();
            nomProjet.InnerText   = projet.pro_nom;
            trigramme.InnerText   = projet.pro_idTrigramme.ToString();
            trigrammeResponsable  = daTrigramme.GetTrigrammeById(projet.pro_responsable);
            responsable.InnerText = trigrammeResponsable.tri_trigramme;
        }
コード例 #22
0
        //-------------------------------------------------------------------
        public static CProjet FindProjetPourRattrapage(CProjet projetParent,
                                                       CEtapeWorkflow etape,
                                                       CBlocWorkflowProjet blocProjet)
        {
            CProjet projet = GetProjetDirectementAssocie(etape);

            if (projet == null)
            {
                //Cherche dans le projet parent, un projet qui aurait le bon GanttId ou le bon type
                if (projetParent != null)
                {
                    CListeObjetsDonnees lst = projetParent.ProjetsFils;
                    //si formule de gantt, cheche le projet qui a le bon IdGantt
                    if (blocProjet.FormuleGanttId != null)
                    {
                        lst.Filtre = new CFiltreData(CProjet.c_champGanttId + "=@1",
                                                     blocProjet.GetGanttId(etape));
                    }
                    //Si pas de formule de gantt, cherche le projet en fonction de son type
                    else if (blocProjet.DbKeyTypeProjet != null)
                    {
                        lst.Filtre = new CFiltreDataAvance(CProjet.c_nomTable, CTypeProjet.c_nomTable + "." + CObjetDonnee.c_champIdUniversel + "=@1",
                                                           blocProjet.DbKeyTypeProjet.GetValeurInDb());
                    }
                    else
                    {
                        //sinon, impossible de trouver le projet
                        lst.Filtre = new CFiltreDataImpossible();
                    }
                    if (lst.Count > 0)
                    {
                        //Cherche le plus récent, ou celui qui n'est pas terminé
                        foreach (CProjet fils in lst)
                        {
                            if (projet == null)
                            {
                                projet = fils;
                            }
                            else if (projet.DateFinRelle != null && fils.DateFinRelle == null)
                            {
                                projet = fils;
                            }
                            else if (projet.DateFinGantt < fils.DateFinGantt)
                            {
                                projet = fils;
                            }
                        }
                    }
                }
            }
            return(projet);
        }
コード例 #23
0
ファイル: CProjetServeur.cs プロジェクト: ykebaili/Timos
        //-------------------------------------------------------------------
        public override CResultAErreur VerifieDonnees(CObjetDonnee objet)
        {
            CResultAErreur result = CResultAErreur.True;

            try
            {
                CProjet proj = (CProjet)objet;

                if (proj.Libelle == null || proj.Libelle == "")
                {
                    result.EmpileErreur(I.T("The Project label cannot be empty|261"));
                }
                if (proj.TypeProjet == null)
                {
                    result.EmpileErreur(I.T("The Project must have a Project Type|385"));
                }
                if (proj.DateDebutPlanifiee != null && proj.DateFinPlanifiee != null)
                {
                    if (proj.DateDebutPlanifiee != null && proj.DateFinPlanifiee != null)
                    {
                        int comparedate = DateTime.Compare((DateTime)proj.DateDebutPlanifiee, (DateTime)proj.DateFinPlanifiee);
                        if (comparedate > 0)
                        {
                            result.EmpileErreur(I.T("Planned Start Date of the project cannot be greater than Planned End Date|387"));
                        }
                    }
                    if (proj.DateDebutReel != null && proj.DateFinRelle != null)
                    {
                        int comparedate = DateTime.Compare((DateTime)proj.DateDebutReel, (DateTime)proj.DateFinRelle);
                        if (comparedate > 0)
                        {
                            result.EmpileErreur(I.T("Project True Start Date cannot be greater than True End Date|10002"));
                        }
                    }
                }
                if (proj.Projet != null && proj.TypeProjet != null && proj.Projet.TypeProjet != null &&
                    !proj.TypeProjet.AccepteProjetsParentsDuType(proj.Projet.TypeProjet))
                {
                    result.EmpileErreur(I.T("Project @1 doesn't respect project type hierarchy contraints|20141",
                                            proj.Libelle));
                }
                if (proj.Projet == null && proj.TypeProjet != null && proj.TypeProjet.NecessiteParent)
                {
                    result.EmpileErreur(I.T("Project @1 need a parent project|20142", proj.Libelle));
                }
            }
            catch (Exception e)
            {
                result.EmpileErreur(new CErreurException(e));
            }
            return(result);
        }
コード例 #24
0
ファイル: CLienDeProjet.cs プロジェクト: ykebaili/Timos
        //----------------------------------------------------------------
        public CResultAErreur CalcAnomaliesDates(CProjet projet)
        {
            CResultAErreur result = CResultAErreur.True;

            if (projet == null)
            {
                return(result);
            }
            if (((projet.TypesAnomaliesFiltres & ETypeAnomalieProjet.NonRespectContrainteDate) == 0))
            {
                if (ElementA == null && ElementB == null)
                {
                    CAnomalieProjet.CreerAnomalie(ContexteDonnee, projet, ETypeAnomalieProjet.Autre,
                                                  I.T("Invalid project link : no link end|484"), null);
                }
                else if (ElementA == null)
                {
                    CAnomalieProjet.CreerAnomalie(ContexteDonnee, projet, ETypeAnomalieProjet.Autre,
                                                  I.T("No link end for link to @1|485", ElementB.DescriptionElement),
                                                  null);
                }
                else if (ElementB == null)
                {
                    CAnomalieProjet.CreerAnomalie(ContexteDonnee, projet, ETypeAnomalieProjet.Autre,
                                                  I.T("No link end for link to @1|485", ElementA.DescriptionElement),
                                                  null);
                }
                else
                {
                    DateTime?date1 = ElementA.DateDebutGantt;
                    DateTime?date2 = ElementB.DateDebutGantt;
                    if (date1 != null && date2 != null)
                    {
                        TimeSpan sp         = date1.Value - date2.Value;
                        double   fTolerance = 0;
                        if (sp.TotalDays > fTolerance)
                        {
                            result = CAnomalieProjet.CreerAnomalie(ContexteDonnee,
                                                                   projet,
                                                                   ETypeAnomalieProjet.NonRespectContrainteDate,
                                                                   I.T("Constraint error for elements @1 and @2|486",
                                                                       ElementA.DescriptionElement,
                                                                       ElementB.DescriptionElement),
                                                                   this);
                        }
                    }
                }
            }

            return(result);
        }
コード例 #25
0
        //------------------------------------------------
        public void Init(I2iObjetGraphique wndObjet)
        {
            if (!(wndObjet is CWndProjetBrique))
            {
                m_projet = null;
                return;
            }
            m_bInitialise = false;
            m_projet      = ((CWndProjetBrique)wndObjet).Projet;
            m_ctrlState.Init(m_projet);


            RemplitDialog();
        }
コード例 #26
0
        //--------------------------------------------------------
        private void InitListeVersions()
        {
            CProjet projet = null;

            if (m_chkFiltrerSurProjet.Checked)
            {
                projet = m_intervention.Projet;
                if (projet == null)
                {
                    m_chkFiltrerSurProjet.Checked = false;
                    m_chkFiltrerSurProjet.Visible = false;
                }
            }
            string strVersions = "";

            if (projet != null)
            {
                //Gestion des interventions prédécesseurs pour les version (empilement de version)
                //Non utilisé le 21/09/2010

                /*
                 *              CIntervention[] inters = projet.GetInterventionsPrecedent ( m_intervention );
                 *              StringBuilder bl = new StringBuilder ( );
                 *              foreach ( CIntervention intervention in inters )
                 *              {
                 *                      if ( intervention.VersionDonneesAAppliquer != null )
                 *                      {
                 *                              bl.Append(intervention.VersionDonneesAAppliquer.Id);
                 *                              bl.Append(",");
                 *                      }
                 *              }
                 *              if ( bl.Length > 0 )
                 *                      bl.Remove ( bl.Length-1, 1);
                 *              strVersions = bl.ToString();
                 * */
            }
            CFiltreData filtre = new CFiltreData(CVersionDonnees.c_champTypeVersion + "=@1",
                                                 (int)CTypeVersion.TypeVersion.Previsionnelle);

            if (strVersions.Length > 0)
            {
                filtre = CFiltreData.GetAndFiltre(filtre,
                                                  new CFiltreData(CVersionDonnees.c_champId + " in (" + strVersions + ")"));
            }
            m_txtSelectVersionParente.InitAvecFiltreDeBase <CVersionDonnees> (
                "Libelle",
                filtre,
                true);
        }
コード例 #27
0
ファイル: CAnomalieProjet.cs プロジェクト: ykebaili/Timos
        //-----------------------------------------------
        public static CResultAErreur CreerAnomalie(
            CContexteDonnee ctx,
            CProjet projetParent,
            ETypeAnomalieProjet type,
            string message,
            IElementAAnomalieProjet elementConcerne)
        {
            CAnomalieProjet anomalie = new CAnomalieProjet(ctx);

            anomalie.CreateNewInCurrentContexte();
            anomalie.Projet           = projetParent;
            anomalie.TypeAnomalieCode = (int)type;
            anomalie.Message          = message;
            anomalie.ElementConcerne  = elementConcerne;
            return(CResultAErreur.True);
        }
コード例 #28
0
        private void m_menuArbreGanttAdd_Click(object sender, EventArgs e)
        {
            CElementDeGanttProjet eltProjet = m_gantt.SelectedElement as CElementDeGanttProjet;

            if (eltProjet != null)
            {
                CProjet projet = new CProjet(eltProjet.ProjetAssocie.ContexteDonnee);
                projet.CreateNew();
                projet.Projet = eltProjet.ProjetAssocie;
                CFormNavigateurPopup.Show(new CFormEditionProjet(projet), FormWindowState.Maximized);
                if (!projet.IsValide() || !projet.VerifieDonnees(false).Result)
                {
                    return;
                }
                Init();
            }
        }
コード例 #29
0
        //--------------------------------------------------
        private void RecalculeCouts()
        {
            CProjet projet = m_phaseSpecifications.Projet;

            CFormProgressTimos.Indicateur.SetBornesSegment(0, 100);
            CFormProgressTimos.Indicateur.PushSegment(0, 50);
            CFormProgressTimos.Indicateur.SetBornesSegment(0, 100);
            CFormProgressTimos.Indicateur.PushLibelle(I.T("Calculated estimated costs|20707"));
            if (projet != null)
            {
                projet.RecalcEstimatedCost(CFormProgression.Indicateur);
            }
            else
            {
                PhaseSpecifications.RecalcEstimatedCost(CFormProgressTimos.Indicateur);
            }
            CFormProgressTimos.Indicateur.PopLibelle();
            CFormProgressTimos.Indicateur.PopSegment();
            CFormProgressTimos.Indicateur.PushSegment(50, 100);
            CFormProgressTimos.Indicateur.SetBornesSegment(0, 100);
            CFormProgressTimos.Indicateur.PushLibelle(I.T("Calculated actual costs|20708"));
            if (projet != null)
            {
                projet.RecalcActualCost(CFormProgression.Indicateur);
            }
            else
            {
                PhaseSpecifications.RecalcActualCost(CFormProgressTimos.Indicateur);
            }
            CFormProgressTimos.Indicateur.PopLibelle();
            CFormProgressTimos.Indicateur.PopSegment();
            try
            {
                BeginInvoke((MethodInvoker) delegate
                {
                    try
                    {
                        Refill();
                        m_panelResumeElementACout.Init(m_phaseSpecifications);
                    }
                    catch { }
                });
            }
            catch { }
        }
コード例 #30
0
ファイル: CProjetServeur.cs プロジェクト: ykebaili/Timos
        //-------------------------------------------------------------------------------
        private CResultAErreur CreateVersionRecursif(CProjet projet)
        {
            CResultAErreur res = CResultAErreur.True;

            if (projet.Projet != null)
            {
                res = CreateVersionRecursif(projet.Projet);
            }
            if (!res)
            {
                return(res);
            }
            if (projet.IsNew() && projet.TypeProjet != null && projet.TypeProjet.OptionVersion.Code == timos.data.projet.EOptionTypeProjetVersion.VersionAutomatique)
            {
                res = projet.CreateDataVersionInCurrentContext();
            }
            return(res);
        }