Beispiel #1
0
        public ActionTypeDS GetActionTypes(long issueID)
        {
            //Action types for an issue (state driven)
            ActionTypeDS actionTypes = null;

            try {
                //Get full list
                actionTypes = GetActionTypes();

                //Remove actions that don't apply
                Actions actions = GetIssueActions(issueID);
                if (actions.Count == 0)
                {
                    //New: Open only
                    for (int i = 0; i < actionTypes.ActionTypeTable.Rows.Count; i++)
                    {
                        if (actionTypes.ActionTypeTable[i].ID != 1)
                        {
                            actionTypes.ActionTypeTable[i].Delete();
                        }
                    }
                }
                else if (actions.Count == 1)
                {
                    //Open: Dismiss, Notify All, Notify Agent Systems, Notify CRG
                    for (int i = 0; i < actionTypes.ActionTypeTable.Rows.Count; i++)
                    {
                        if (actionTypes.ActionTypeTable[i].ID == 1)
                        {
                            actionTypes.ActionTypeTable[i].Delete();
                        }
                        else if (actionTypes.ActionTypeTable[i].ID == 3)
                        {
                            actionTypes.ActionTypeTable[i].Delete();
                        }
                    }
                }
                else if (actions.Count > 1)
                {
                    //Unresolved: Close, Notify All, Notify Agent Systems, Notify CRG, Other
                    for (int i = 0; i < actionTypes.ActionTypeTable.Rows.Count; i++)
                    {
                        if (actionTypes.ActionTypeTable[i].ID == 1)
                        {
                            actionTypes.ActionTypeTable[i].Delete();
                        }
                        else if (actionTypes.ActionTypeTable[i].ID == 2)
                        {
                            actionTypes.ActionTypeTable[i].Delete();
                        }
                    }
                }
                actionTypes.AcceptChanges();
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while reading action types.", ex); }
            return(actionTypes);
        }
Beispiel #2
0
        public string GetActionType(int typeID)
        {
            //Get an action type  for the specified id
            string actionType = "";

            try {
                ActionTypeDS actionTypes           = GetActionTypes();
                ActionTypeDS.ActionTypeTableRow at = (ActionTypeDS.ActionTypeTableRow)actionTypes.ActionTypeTable.Select("ID=" + typeID)[0];
                actionType = at.Type;
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while reading action type.", ex); }
            return(actionType);
        }
Beispiel #3
0
        public static ActionTypeDS GetActionTypes(long issueID)
        {
            //Action types for an issue (state driven)
            ActionTypeDS actionTypes = null;

            try {
                _Client     = new IssueMgtServiceClient();
                actionTypes = _Client.GetIssueActionTypes(issueID);
                _Client.Close();
            }
            catch (FaultException fe) { throw new ApplicationException("GetActionTypes() service error.", fe); }
            catch (TimeoutException te) { _Client.Abort(); throw new ApplicationException("GetActionTypes() timeout error.", te); }
            catch (CommunicationException ce) { _Client.Abort(); throw new ApplicationException("GetActionTypes() communication error.", ce); }
            return(actionTypes);
        }
Beispiel #4
0
        public ActionTypeDS GetActionTypes()
        {
            //Action types
            ActionTypeDS actionTypes = new ActionTypeDS();

            try {
                DataSet ds = fillDataset(USP_ACTIONTYPES, TBL_ACTIONTYPES, new object[] {});
                if (ds.Tables[TBL_ACTIONTYPES].Rows.Count > 0)
                {
                    actionTypes.Merge(ds);
                }
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while reading action types.", ex); }
            return(actionTypes);
        }