示例#1
0
 /// <summary>
 /// Adds a new use case
 /// </summary>
 /// <param name="useCase"></param>
 /// <returns></returns>
 private UMLUseCase AddUseCase(UMLUseCase useCase)
 {
     foreach (UMLUseCase u in UseCases)
     {
         //if (useCase.Name == u.Name && useCase.Owner == u.Owner)
         if (useCase.Name == u.Name)
         {
             u.Owner          = useCase.Owner;
             u.Collaborations = useCase.Collaborations;
             return(u);
         }
     }
     UseCases.Add(useCase);
     return(useCase);
 }
示例#2
0
        /// <summary>
        /// Loads the use cases and collaborations
        /// </summary>
        public void LoadUseCasesCollaborationsExcel()
        {
            DataTable dtResult = new DataTable();

            dtResult = GetDataTable(_fileName, COLLABORATION_SHEET, "Name <> ''");

            UMLPackage pack = new UMLPackage();

            pack.Name  = "UseCaseImport";
            pack.Owner = _scenariosModel;
            Packages.Add(pack);

            foreach (DataRow dr in dtResult.Rows)
            {
                UMLUseCase useCase = new UMLUseCase();
                useCase.Name  = dr["UseCase"].ToString().Trim();
                useCase.Owner = pack;
                useCase       = AddUseCase(useCase);

                UMLCollaboration collaboration = new UMLCollaboration();
                collaboration.Name = dr["Name"].ToString().Trim();
                collaboration.Type = dr["Type"].ToString();

                if (dr["SendMessage"].ToString() == "X")
                {
                    collaboration.SendMessage = true;
                }

                if (dr["GenerateAction"].ToString() == "X")
                {
                    collaboration.GenerateAction = true;
                }

                string[] filesName = dr["FilesList"].ToString().Split(',');
                foreach (string fName in filesName)
                {
                    UMLFile file = new UMLFile();
                    file.Name = fName.Trim();
                    file      = AddFile(file);
                    collaboration.Files.Add(file);
                }

                collaboration.Owner = useCase;
                collaboration       = AddCollaboration(collaboration);
                useCase.Collaborations.Add(collaboration);
            }
        }
示例#3
0
        /// <summary>
        /// Loads the iterations and phases
        /// </summary>
        public void LoadPhasesIterationsExcel()
        {
            DataTable dtResult = new DataTable();

            dtResult = GetDataTable(_fileName, PHASE_SHEET, "Phase <> ''");
            UMLPackage pack = new UMLPackage();

            pack.Name  = "IterationsFaseImport";
            pack.Owner = _iterationModel;

            Packages.Add(pack);
            foreach (DataRow dr in dtResult.Rows)
            {
                UMLPhase phase = new UMLPhase();
                phase.Name  = dr["Phase"].ToString().Trim();
                phase.Owner = pack;
                phase       = AddPhase(phase);

                UMLIteration iteration = new UMLIteration();
                iteration.Name = dr["Name"].ToString().Trim();
                string[] usecasesName = dr["UseCaseList"].ToString().Split(',');
                foreach (string useCaseName in usecasesName)
                {
                    UMLUseCase useCase = new UMLUseCase();
                    useCase.Name = useCaseName.Trim();
                    useCase      = AddUseCase(useCase);
                    iteration.UseCases.Add(useCase);
                }

                //iteration.Owner = _logical;
                iteration.Owner = phase;
                iteration       = AddIteration(iteration);
                iteration.Prev  = getIterationByName(dr["Prev"].ToString());
                phase.Iterations.Add(iteration);
            }
        }
示例#4
0
 public void AddUseCaseToTag(UMLUseCase usecase)
 {
     AddElementToTagCollection(Constants.UMLProfile.ESTIMATION, Constants.UMLIteration.TDS_ESTIMATION, UMLIteration.TagUseCaseList, usecase);
 }