public void Dispose() { if (systemHandler != null) { systemHandler.Dispose(); systemHandler = null; } if (customerHandler != null) { customerHandler.Dispose(); customerHandler = null; } if (supplierHandler != null) { supplierHandler.Dispose(); supplierHandler = null; } if (salesmanHandler != null) { salesmanHandler.Dispose(); salesmanHandler = null; } if (otherContactHandler != null) { otherContactHandler.Dispose(); otherContactHandler = null; } }
/// <summary> /// Event handlers SETUP /// </summary> /// <param name="EntityID"></param> /// <param name="EventHandler"></param> public void SetExtenderEventHandler(string EntityID, ExtenderEvents EventHandler) { switch (EntityID.ToLower()) { case "customer": //Clientes if (customerHandler == null) { customerHandler = new CustomerHandler(); customerHandler.SetEventHandler(EventHandler); } break; case "supplier": //Fornecedores if (supplierHandler == null) { supplierHandler = new SupplierHandler(); } supplierHandler.SetEventHandler(EventHandler); break; case "salesman": //Vendedores if (salesmanHandler == null) { salesmanHandler = new SalesmanHandler(); } salesmanHandler.SetEventHandler(EventHandler); break; case "othercontact": //Vendedores if (otherContactHandler == null) { otherContactHandler = new OtherContactHandler(); } otherContactHandler.SetEventHandler(EventHandler); break; } }