private void GetDataModelCompleted(GetDataModelResult result) { dataModelEntity = result.DataModel; if (dataModelEntity != null) { CircularReferencesManager.FixDataModelCircularReferences(dataModelEntity); DataModel dataModel = Utilities.ConvertEntityToDataModel(dataModelEntity); if (dataModelLoadedCallback != null) { dataModelLoadedCallback(dataModel); dataModelLoadedCallback = null; } } }
public void BeginSaveCustomerService(ServiceDocument serviceDocument, SaveCustomerServiceCallback callback) { try { CustomerServiceDataEntity customerServiceData = Utilities.ConvertServiceModelToEntity(serviceDocument, this.dataModelEntity); CircularReferencesManager.BrokeCustomerServiceDataCircularReference(customerServiceData); SilverlightServicesClient client = Utils.SilverlightServicesClient; client.BeginSaveCustomerServiceData(customerServiceData, callback); } catch (Exception) { throw; } }
public void BeginSaveDataModel(DataModel dataModel, SaveDataModelCallback callback) { try { DataModelEntity dataModelEntity = Utilities.ConvertDataModelToEntity(dataModel); dataModelEntity.IdStore = customServiceId; CircularReferencesManager.BrokeDataModelCircularReferences(dataModelEntity); SilverlightServicesClient client = Utils.SilverlightServicesClient; client.BeginSaveDataModel(dataModelEntity, callback); } catch (Exception) { throw; } }
public void LoadService(int idService, CustomerServiceLoadedCallback callback) { DataModel currentDataModel = null; // Carga del modelo de datos. BeginLoadDataModel( delegate(DataModel dataModel){ currentDataModel = dataModel; ServiceDocument document = document = new ServiceDocument(); document.DataModel = dataModel; if (idService > 0) { // Es un servicio existente. SilverlightServicesClient client = Utils.SilverlightServicesClient; client.BeginGetCustomerServiceData(idService, delegate(GetCustomerServiceResult result) { if (result.CustomerService != null) { result.CustomerService.DataModel = dataModelEntity; CircularReferencesManager.FixCustomerServiceDataCircularReferences(result.CustomerService); Utilities.ConvertEntityToServiceModel(result.CustomerService, document); } if (callback != null) { callback(document); } } ); } else if (callback != null) { callback(document); } } ); }