/// <summary> /// Called when activating. /// </summary> protected override void OnActivate() { base.OnActivate(); if (ServiceId != 0) GetDetail(); else DataService = new DataService(); }
public void InsertDataService(DataService dataService) { if ((dataService.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(dataService, EntityState.Added); } else { this.ObjectContext.DataService.AddObject(dataService); } }
public void DeleteDataService(DataService dataService) { if ((dataService.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(dataService, EntityState.Deleted); } else { this.ObjectContext.DataService.Attach(dataService); this.ObjectContext.DataService.DeleteObject(dataService); } }
private void GetElement(DataService service) { // SelectedElement = element; SelectedService = new DataServicePo(); SelectedService.Id = service.Id; SelectedService.ServiceMethod = service.Method; SelectedService.ServiceName = service.Service; // DataPermission.Service = SelectedService; NotifyOfPropertyChange(() => SelectedService); (Parent as DataPermissionViewModel).Refresh(); }
/// <summary> /// Create a new DataService object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="service">Initial value of the Service property.</param> /// <param name="method">Initial value of the Method property.</param> public static DataService CreateDataService(global::System.Int32 id, global::System.String service, global::System.String method) { DataService dataService = new DataService(); dataService.Id = id; dataService.Service = service; dataService.Method = method; return dataService; }
/// <summary> /// Deprecated Method for adding a new object to the DataService EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToDataService(DataService dataService) { base.AddObject("DataService", dataService); }
private bool FilterDataService(DataService entity) { return (entity.Id == this.ServiceId); }
public void UpdateDataService(DataService currentDataService) { this.ObjectContext.DataService.AttachAsModified(currentDataService, this.ChangeSet.GetOriginal(currentDataService)); }