Exemplo n.º 1
0
 // TODO: test
 protected override void SelectionChanged(Dal.IUiBase item)
 {
     if (item is UiProject)
     {
         // master
         base.SelectionChanged(item);
         (view as IDetailCustomView).GridDetailSource = item == null ?
                                                        null :
                                                        detailService.GetList(item);
     }
     else
     {
         // detail
         if (item == null)
         {
             return;
         }
         if (item is UiProjectItemsCategory)
         {
             CategoryUpdate(item as UiProjectItemsCategory);
         }
         else
         if (item.IsDirty)
         {
             item.Update();
         }
     }
 }
Exemplo n.º 2
0
        public void SetChildFilter(IUiBase parent)
        {
            this.searchValue = string.Empty;
            this.parent      = parent;
            HasParent        = parent != null;
            var dataSource = service.GetList(GetListParent());

            RefreshService(dataSource);
        }
Exemplo n.º 3
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.º 4
0
 private void RefreshData()
 {
     SetDataSource(service.GetList(GetListParent(), SearchValue));
 }