Exemplo n.º 1
0
        /// <summary>
        /// Load/Update the specified External Route
        /// </summary>
        internal void Load(int externalRouteId)
        {
            if (externalRouteId <= 0)
            {
                throw new ArgumentException("You must specify an externalRouteId", "externalRouteId");
            }

            UDInfo oInfo = new UDInfo {
                listType = (int)AgentInfoType.GET_SPEED_DIAL, id = externalRouteId
            };

            External oItem = (External)mpApp.Portal.WSAgent.getInfo(mpApp.CurrentAgent.AgentArg, oInfo);

            //If external route is already in list, update it.
            //Otherwise, add it.
            CExternalRoute pExternalRoute;

            if (base.Contains(externalRouteId))
            {
                pExternalRoute             = (CExternalRoute)base.GetByKey(externalRouteId);
                pExternalRoute.description = oItem.externalroutedesc;
                pExternalRoute.phoneNumber = oItem.phonenum;
                pExternalRoute.type        = (ExternalRouteType)oItem.externalroutetype;
            }
            else
            {
                pExternalRoute = new CExternalRoute(oItem.externalrouteid, oItem.externalroutedesc, oItem.phonenum, oItem.externalroutetype);
                base.Add(pExternalRoute.Id, pExternalRoute);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Load all External Routes
        /// </summary>
        internal void Load()
        {
            base.Clear();

            UDInfo oInfo = new UDInfo {
                listType = (int)AgentInfoType.GET_SPEED_DIALS
            };

            Externals[] oItems = (Externals[])mpApp.Portal.WSAgent.getInfo(mpApp.CurrentAgent.AgentArg, oInfo);

            foreach (Externals e in oItems)
            {
                CExternalRoute oExternalRoute = new CExternalRoute(e.externalrouteid, e.externalroutedesc, e.phonenum, e.externalroutetype);
                base.Add(oExternalRoute.Id, oExternalRoute);
            }
        }