Load() public method

开始加载数据
public Load ( ) : void
return void
 /// <summary>
 /// 安检单列表选择改变
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void checkerGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     GeneralObject item = checkerGrid.SelectedItem as GeneralObject;
     if (item == null)
         return;
     GeneralObject go = new GeneralObject();
     go.WebClientInfo = Application.Current.Resources["dbclient"] as WebClientInfo;
     go.EntityType = "T_INSPECTION";
     if (!item.GetPropertyValue("CONDITION").Equals("未检"))
     {
         go.Path = "one/select distinct t from T_INSPECTION t left join fetch t.LINES where t.id ='" + item.GetPropertyValue("id").ToString() + "'";
         go.DataLoaded += go_DataLoaded;
         //if (!item.GetPropertyValue("CONDITION").Equals("正常"))
         //    userfile.IsEnabled = false;
         //else
         //    userfile.IsEnabled = true;
         go.Load();
     }
     else
     {
         userfile.DataContext = null;
         ClearAll();
         //userfile.IsEnabled = false;
     }
 }
Esempio n. 2
0
        private static void OnPathChanged(DependencyObject dp, DependencyPropertyChangedEventArgs args)
        {
            GeneralObject go = (GeneralObject)dp;

            //如果指明Path改变时,不加载数据,则只有当外界要求,加载数据时,才加载
            if (go.loadOnPathChanged)
            {
                go.Load();
            }
        }