예제 #1
0
        public bool Delete()
        {
            bool ret = true;

            try
            {
                Pin pn = Pin.Load(SetName, Context, ID);
                pn.Delete();
                ConfigurationController.RegisterChangeCall(
                    typeof(PinnedRoutePlan),
                    new ADialPlan.sUpdateConfigurationsCall(
                        (ExtensionNumber != null ? "DeleteAdvancedPin" : "DeleteBasicPin"),
                        new NameValuePair[] {
                    new NameValuePair("context", Context),
                    new NameValuePair("name", SetName),
                    new NameValuePair("pin", (ExtensionNumber != null ? (object)new PinnedRoutePlan.sAdvancedPin(ExtensionNumber, ExtensionDomain, PinNumber) : (object)PinNumber))
                }
                        ),
                    new IEvent[] {
                    new GenericEvent("PinSetUpdated",
                                     new NameValuePair[] {
                        new NameValuePair("Name", SetName),
                        new NameValuePair("Context", Context),
                        new NameValuePair("IsAdvanced", (ExtensionNumber != null))
                    })
                }
                    );
            }
            catch (Exception e)
            {
                Log.Error(e);
                EventController.TriggerEvent(new ErrorOccuredEvent(e));
                ret = false;
            }
            return(ret);
        }