Exemplo n.º 1
0
 protected void DataViewSourceChanged(DataViewParameter parameter)
 {
     if (service == null)
     {
         this.service = AppServices.Instance.GetDataService(parameter.BusinessObject.UiDataType);
         CurrentType  = parameter.BusinessObject.UiDataType;
         //this.associatedParent = parameter.Filter;
         this.dataSource     = this.service.GetList();
         view.GridDataSource = this.dataSource;
         if (parameter.Filter != null)
         {
             SetChildFilter(parameter.Filter);
         }
     }
     else
     {
         CloseCurrentService();
         dataViewSourceHandler.Dispose();
     }
 }
Exemplo n.º 2
0
        private void SelectService(IDataClientService newService, Type dataType, UiBase parent, IEnumerable <string> reports = null)
        {
            // reset filter
            this.SearchValue = string.Empty;

            service = newService;
            service.UpdateStatus += service_UpdateStatus;
            //view.SetDetail(dataType);/* no need : detail items bound directly to grid's selection */
            dataSource = service.GetList(GetListParent());
            RefreshService(dataSource);
            RaisePropertyChanged("ForwardLinks");
            HasParent = parent != null;

            // TODO
            //if (reports != null)
            //    view.SetReports(reports);

            // TODO : remove temporary hack
            if (dataType == typeof(UiEmployee))
            {
                (dataSource as ObservableCollection <UiEmployee>)[1].IsLocked = true;
            }
        }
Exemplo n.º 3
0
 public MasterDetailController(IDetailCustomView view)
     : base(view)
 {
     UiProjectItemsCategory.InitService();
     detailService = UiProjectItemsCategory.Service;
 }