<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      DevExpress XAF 查找列表視圖及聯(lián)級過濾

        主要通過列表視圖,實現(xiàn)聯(lián)級過濾。只是對官方文件做了簡單的代碼復制,以后有機會再整理和修改。

      初始化實現(xiàn)

        使用the DataSourcePropertyAttribute 和 DataSourceCriteriaAttribute實現(xiàn)聯(lián)級過濾。

       1 using System.ComponentModel;
       2 using DevExpress.Data.Filtering;
       3 //... 
       4 [DefaultClassOptions]
       5 public class Order : BaseObject {
       6    public Order(Session session) : base(session) { }
       7    private Product product;
       8    public Product Product {
       9       get {
      10          return product;
      11       }
      12       set {
      13          SetPropertyValue("Product", ref product, value);
      14       }
      15    }
      16    private Accessory accessory;
      17    public Accessory Accessory {
      18       get {
      19          return accessory;
      20       }
      21       set {
      22          SetPropertyValue("Accessory", ref accessory, value);
      23       }
      24    }
      25 }
      26 public class Product : BaseObject {
      27    public Product(Session session) : base(session) { }
      28    private String productName;
      29    public String ProductName {
      30       get { 
      31          return productName;
      32       }
      33       set {
      34          SetPropertyValue("ProductName", ref productName, value);
      35       }
      36    }
      37    [Association("P-To-C")]
      38    public XPCollection<Accessory> Accessories {
      39       get { return GetCollection<Accessory>("Accessories"); }
      40    }
      41 }
      42 public class Accessory : BaseObject {
      43    public Accessory(Session session) : base(session) { }
      44    private String accessoryName;
      45    public String AccessoryName {
      46       get { 
      47          return accessoryName; 
      48       }
      49       set {
      50          SetPropertyValue("AccessoryName", ref accessoryName, value);
      51       }
      52    }
      53    private bool isGlobal;
      54    public bool IsGlobal {
      55       get {
      56          return isGlobal;
      57       }
      58       set {
      59          SetPropertyValue("IsGlobal", ref isGlobal, value);
      60       }
      61    }
      62    private Product product;
      63    [Association("P-To-C")]
      64    public Product Product { 
      65       get {
      66          return product;
      67       } 
      68       set {
      69          SetPropertyValue("Product", ref product, value);
      70       } 
      71    }
      72 }

        效果下圖。

      場景1 -使用指定集合屬性中的對象填充查找

        關鍵代碼:[DataSourceProperty("Product.Accessories")]
       1 [DefaultClassOptions]
       2 public class Order : BaseObject {
       3    // ... 
       4    [DataSourceProperty("Product.Accessories")]
       5    public Accessory Accessory {
       6       get {
       7          return accessory;
       8       }
       9       set {
      10          SetPropertyValue("Accessory", ref accessory, value);
      11       }
      12    }
      13 }

        效果如下圖:

      場景2 -為Lookup屬性集合應用標準

       1 [DefaultClassOptions]
       2 public class Order : BaseObject {
       3    // ... 
       4    [DataSourceCriteria("IsGlobal = true")]
       5    public Accessory Accessory {
       6       get {
       7          return accessory;
       8       }
       9       set {
      10          SetPropertyValue("Accessory", ref accessory, value);
      11       }
      12    }
      13 }
      14 public class Accessory : BaseObject {
      15       // ... 
      16    private bool isGlobal;
      17    public bool IsGlobal {
      18       get { return isGlobal; }
      19       set { 
      20          SetPropertyValue("IsGlobal", ref isGlobal, value);      
      21       }
      22    }
      23 }

      場景3 -如果指定的數(shù)據(jù)源屬性為空,則使用備用標準

       1 [DefaultClassOptions]
       2 public class Order : BaseObject {
       3    // ... 
       4    [DataSourceProperty("Product.Accessories", 
       5       DataSourcePropertyIsNullMode.CustomCriteria, "IsGlobal = true")]
       6    public Accessory Accessory {
       7       get {
       8          return accessory;
       9       }
      10       set {
      11          SetPropertyValue("Accessory", ref accessory, value);
      12       }
      13    }
      14 }

      場景4 -手動填充查找

      [DefaultClassOptions]
      public class Order : BaseObject {
         // ... 
         // Set the AvailableAccessories collection as a data source for the Accessory property 
         [DataSourceProperty("AvailableAccessories")] 
         public Accessory Accessory {
            get {return accessory;}
            set {
               SetPropertyValue("Accessory", ref accessory, value);
            }
         }
         private XPCollection<Accessory> availableAccessories;
         [Browsable(false)] // Prohibits showing the AvailableAccessories collection separately 
         public XPCollection<Accessory> AvailableAccessories {
            get {
               if(availableAccessories == null) {
                  // Retrieve all Accessory objects 
                  availableAccessories = new XPCollection<Accessory>(Session);
                  // Filter the retrieved collection according to current conditions 
                  RefreshAvailableAccessories();
               }
               // Return the filtered collection of Accessory objects 
               return availableAccessories;
            }
         }
         private void RefreshAvailableAccessories() {
            if(availableAccessories == null)
               return;
            // Process the situation when the Product is not specified (see the Scenario 3 above) 
            if(Product == null) {
               // Show only Global Accessories when the Product is not specified 
               availableAccessories.Criteria = CriteriaOperator.Parse("[IsGlobal] = true");
            }
            else {
               // Leave only the current Product's Accessories in the availableAccessories collection 
               availableAccessories.Criteria = new BinaryOperator("Product", Product);
               if(IncludeGlobalAccessories == true) {
                  // Add Global Accessories 
                  XPCollection<Accessory> availableGlobalAccessories = 
                     new XPCollection<Accessory>(Session);
                  availableGlobalAccessories.Criteria = CriteriaOperator.Parse("[IsGlobal] = true");
                  availableAccessories.AddRange(availableGlobalAccessories);
               }
            }
            // Set null for the Accessory property to allow an end-user  
            //to set a new value from the refreshed data source 
            Accessory = null;
         }
         public Product Product {
            get {return product;}
            set {
               SetPropertyValue("Product", ref product, value);
               // Refresh the Accessory Property data source 
               RefreshAvailableAccessories();
            }
         }
         private bool includeGlobalAccessories;
         [ImmediatePostData] //Use this attribute to refresh the Accessory  
         public bool IncludeGlobalAccessories {
            get {return includeGlobalAccessories;}
            set {
               if(includeGlobalAccessories != value) {
                  includeGlobalAccessories = value;
                  if(!IsLoading) {
                     // Refresh the Accessory Property data source                     
                     RefreshAvailableAccessories();
                     SetPropertyValue("IncludeGlobalAccessories", ref includeGlobalAccessories, value);
                  }
               }
            }
         }
      }

       場景5 -根據(jù)當前對象的屬性篩選Lookup屬性集合

       1 using DevExpress.Persistent.Base;
       2 using DevExpress.Persistent.BaseImpl;
       3 // ... 
       4 public class Contact : Person {
       5     // ... 
       6     [DataSourceProperty("Department.Contacts", DataSourcePropertyIsNullMode.SelectAll)]
       7     [DataSourceCriteria("Position.Title = 'Manager' AND Oid != '@This.Oid'")]
       8     public Contact Manager {
       9         get {
      10             return manager;
      11         }
      12         set {
      13             SetPropertyValue("Manager", ref manager, value);
      14         }
      15     }
      16     // ... 
      17 }

        參考網(wǎng)址

        [1] https://documentation.devexpress.com/eXpressAppFramework/112681/Task-Based-Help/Filtering/How-to-Implement-Cascading-Filtering-for-Lookup-List-Views

      posted @ 2019-09-05 14:05  陸陸無為而治者  閱讀(657)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 九九热在线观看精品视频| 国产边打电话边被躁视频| 少妇av一区二区三区无码| 国色精品卡一卡2卡3卡4卡在线| 国内精品久久久久精免费| 精品一区二区无码免费| 亚洲综合网中文字幕在线| 亚洲av无码片在线播放| 中文字幕日韩一区二区不卡| 欧美成人h亚洲综合在线观看| 给我中国免费播放片在线| 人妻中文字幕亚洲精品| 强伦人妻一区二区三区| 国产精品v片在线观看不卡| 日韩精品无码不卡无码| 国产91精品一区二区亚洲| 日本一区二区三区视频版| 国产AV国片精品有毛| 欧美丰满熟妇乱XXXXX网站| 偷拍美女厕所尿尿嘘嘘小便| 少妇特黄a一区二区三区| 久久久久无码精品国产h动漫| 日韩区二区三区中文字幕| 好先生在线观看免费播放| 国产一区日韩二区欧美三区| 成年午夜无码av片在线观看| 日本一道一区二区视频 | 人人爽人人澡人人人妻| 精品免费看国产一区二区| 性猛交ⅹxxx富婆视频| 精品尤物国产尤物在线看| 日韩精品无码区免费专区 | 亚洲人成网站77777在线观看| 日韩精品毛片一区到三区| 三年片在线观看免费观看高清动漫| 99久久婷婷国产综合精品青草漫画| 激情伊人五月天久久综合| 蜜桃无码一区二区三区| 亚洲欧美高清在线精品一区二区| 久久久久四虎精品免费入口| 精品国产免费人成在线观看|