예제 #1
0
 /// <summary>
 /// Called when activating.
 /// </summary>
 protected override void OnActivate()
 {
     base.OnActivate();
     if (ServiceId != 0)
         GetDetail();
     else
         DataService = new DataService();
 }
예제 #2
0
 public void InsertDataService(DataService dataService)
 {
     if ((dataService.EntityState != EntityState.Detached))
     {
         this.ObjectContext.ObjectStateManager.ChangeObjectState(dataService, EntityState.Added);
     }
     else
     {
         this.ObjectContext.DataService.AddObject(dataService);
     }
 }
예제 #3
0
 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&lt;T&gt; property instead.
 /// </summary>
 public void AddToDataService(DataService dataService)
 {
     base.AddObject("DataService", dataService);
 }
 private bool FilterDataService(DataService entity)
 {
     return (entity.Id == this.ServiceId);
 }
예제 #8
0
 public void UpdateDataService(DataService currentDataService)
 {
     this.ObjectContext.DataService.AttachAsModified(currentDataService, this.ChangeSet.GetOriginal(currentDataService));
 }