コード例 #1
0
        public override void MapDataFields(System.Data.DataRow currentRow)
        {
            String selectStatement = String.Empty;


            base.MapDataFields(currentRow);


            workflowId = (currentRow["WorkflowId"] is DBNull) ? 0 : (Int64)currentRow["WorkflowId"];


            scheduleValue = (Int32)currentRow["ScheduleValue"];

            scheduleQualifier = (Mercury.Server.Core.Enumerations.DateQualifier)(Int32) currentRow["ScheduleQualifier"];

            thresholdValue = (Int32)currentRow["ThresholdValue"];

            thresholdQualifier = (Mercury.Server.Core.Enumerations.DateQualifier)(Int32) currentRow["ThresholdQualifier"];

            initialConstraintValue = (Int32)currentRow["InitialConstraintValue"];

            initialConstraintQualifier = (Mercury.Server.Core.Enumerations.DateQualifier)(Int32) currentRow["InitialConstraintQualifier"];

            initialMilestoneValue = (Int32)currentRow["InitialMilestoneValue"];

            initialMilestoneQualifier = (Mercury.Server.Core.Enumerations.DateQualifier)(Int32) currentRow["InitialMilestoneQualifier"];


            GetWorkViewId = (Int64)currentRow["GetWorkViewId"];

            GetWorkUseGrouping = (Boolean)currentRow["GetWorkUseGrouping"];


            // LOAD WORK QUEUE USER VIEWS

            selectStatement = "SELECT * FROM dbo.WorkQueueGetWorkUserView WHERE WorkQueueId = " + Id.ToString() + " ORDER BY SecurityAuthorityId, UserAccountName";

            System.Data.DataTable userViewsTable = application.EnvironmentDatabase.SelectDataTable(selectStatement);

            getWorkUserViews = new List <WorkQueueGetWorkUserView> ();


            foreach (System.Data.DataRow currentUserViewRow in userViewsTable.Rows)
            {
                WorkQueueGetWorkUserView userView = new WorkQueueGetWorkUserView(application);

                userView.MapDataFields(currentUserViewRow);

                getWorkUserViews.Add(userView);
            }



            // ALWAYS LOAD WORK TEAMS

            selectStatement = "SELECT WorkQueueTeam.*, WorkTeam.WorkTeamName FROM WorkQueueTeam JOIN WorkTeam ON WorkQueueTeam.WorkTeamId = WorkTeam.WorkTeamId WHERE WorkQueueId = " + id.ToString() + " ORDER BY WorkTeamName";

            System.Data.DataTable workTeamsTable = application.EnvironmentDatabase.SelectDataTable(selectStatement.ToString(), 0);

            foreach (System.Data.DataRow currentWorkTeamRow in workTeamsTable.Rows)
            {
                WorkQueueTeam team = new WorkQueueTeam(application);

                team.MapDataFields(currentWorkTeamRow);

                workTeams.Add(team);
            }

            return;
        }
コード例 #2
0
        public override List <ImportExport.Result> XmlImport(System.Xml.XmlNode objectNode)
        {
            List <ImportExport.Result> response = base.XmlImport(objectNode);

            System.Xml.XmlNode propertiesNode;

            String exceptionMessage = String.Empty;


            try {
                propertiesNode = objectNode.SelectSingleNode("Properties");

                foreach (System.Xml.XmlNode currentPropertyNode in propertiesNode)
                {
                    switch (currentPropertyNode.Attributes["Name"].InnerText)
                    {
                    case "WorkflowName": WorkflowId = application.CoreObjectGetIdByName("Workflow", currentPropertyNode.InnerText); break;

                    case "ScheduleValue": ScheduleValue = Convert.ToInt32(currentPropertyNode.InnerText); break;

                    case "ScheduleQualifier": ScheduleQualifier = (Core.Enumerations.DateQualifier)Convert.ToInt32(currentPropertyNode.InnerText); break;

                    case "ThresholdValue": ThresholdValue = Convert.ToInt32(currentPropertyNode.InnerText); break;

                    case "ThresholdQualifier": ThresholdQualifier = (Core.Enumerations.DateQualifier)Convert.ToInt32(currentPropertyNode.InnerText); break;

                    case "InitialConstraintValue": InitialConstraintValue = Convert.ToInt32(currentPropertyNode.InnerText); break;

                    case "InitialConstraintQualifier": InitialConstraintQualifier = (Core.Enumerations.DateQualifier)Convert.ToInt32(currentPropertyNode.InnerText); break;

                    case "InitialMilestoneValue": InitialMilestoneValue = Convert.ToInt32(currentPropertyNode.InnerText); break;

                    case "InitialMilestoneQualifier": InitialMilestoneQualifier = (Core.Enumerations.DateQualifier)Convert.ToInt32(currentPropertyNode.InnerText); break;

                    case "GetWorkViewName": GetWorkViewId = application.CoreObjectGetIdByName("WorkQueueView", currentPropertyNode.InnerText); break;

                    case "GetWorkUseGrouping": GetWorkUseGrouping = Convert.ToBoolean(currentPropertyNode.InnerText); break;

                    case "WorkQueueTeams":

                        foreach (System.Xml.XmlNode currentWorkQueueTeamNode in currentPropertyNode.ChildNodes)
                        {
                            String workTeamName = currentWorkQueueTeamNode.Attributes["WorkTeamName"].InnerText;

                            Int64 workTeamId = application.WorkTeamGetIdByName(workTeamName);

                            if (workTeamId != 0)
                            {
                                Boolean workTeamExists = false;

                                foreach (WorkQueueTeam currentWorkTeam in workTeams)
                                {
                                    if (currentWorkTeam.Id == workTeamId)
                                    {
                                        workTeamExists = true; break;
                                    }
                                }

                                if (!workTeamExists)
                                {
                                    WorkQueueTeam workQueueTeam = new WorkQueueTeam(application);

                                    workQueueTeam.WorkTeamId = workTeamId;

                                    workQueueTeam.WorkTeamName = workTeamName;

                                    workQueueTeam.Permission = (Enumerations.WorkQueueTeamPermission)Convert.ToInt32(currentWorkQueueTeamNode.Attributes["Permission"].InnerText);

                                    workTeams.Add(workQueueTeam);
                                }
                            }
                        }

                        break;
                    }
                }
            }

            catch (Exception importException) {
                response.Add(new ImportExport.Result(ObjectType, Name, importException));
            }

            return(response);
        }