コード例 #1
0
 private void lokUser_SearchFilterChanged(object sender, MyCommonWPFControls.SearchFilterArg e)
 {
     if (UserSearchFilterChanged != null)
     {
         UserSearchFilterChanged(this, e);
     }
 }
コード例 #2
0
 private void lokEntity_SearchFilterChanged(object sender, MyCommonWPFControls.SearchFilterArg e)
 {
     if (EntitySearchFilterChanged != null)
     {
         EntitySearchFilterChanged(this, e);
     }
 }
コード例 #3
0
 private void LokEntitiesSecond_SearchFilterChanged(object sender, MyCommonWPFControls.SearchFilterArg e)
 {
     if (e.SingleFilterValue != null)
     {
         if (!e.FilterBySelectedValue)
         {
             var list = bizTableDrivedEntity.GetAllEntities(MyProjectManager.GetMyProjectManager.GetRequester(), e.SingleFilterValue, false);
             e.ResultItemsSource = list;
         }
         else
         {
             var id = Convert.ToInt32(e.SingleFilterValue);
             if (id > 0)
             {
                 //lokSecondSideEntity.ItemsSource = bizTableDrivedEntity.GetAllEntities();
                 var entity = bizTableDrivedEntity.GetSimpleEntity(MyProjectManager.GetMyProjectManager.GetRequester(), id);
                 e.ResultItemsSource = new List <TableDrivedEntityDTO> {
                     entity
                 };
             }
             else
             {
                 e.ResultItemsSource = null;
             }
         }
     }
 }
コード例 #4
0
 private void LokSubject_SearchFilterChanged(object sender, MyCommonWPFControls.SearchFilterArg e)
 {
     if (e.SingleFilterValue != null)
     {
         if (!e.FilterBySelectedValue)
         {
             var subjects = bizSecuritySubject.GetSecuritySubjects(e.SingleFilterValue);
             e.ResultItemsSource = subjects;
         }
         else
         {
             var id = Convert.ToInt32(e.SingleFilterValue);
             if (id > 0)
             {
                 var subject = bizSecuritySubject.GetSecuritySubject(id);
                 e.ResultItemsSource = new List <SecuritySubjectDTO> {
                     subject
                 };
             }
             else
             {
                 e.ResultItemsSource = null;
             }
         }
     }
 }
コード例 #5
0
        private void CellEditElement_SearchFilterChanged(object sender, SearchFilterArg e)
        {
            if (e.FilterBySelectedValue)
            {
                //یعنی از داخل صدا زده شده..بالایی
                var foundItems = FindItemInItemsSource(lookupItemsSource, e.SingleFilterValue);
                if (foundItems.Count == 0)
                {
                    //قاعدتا اینجا نباید هیچوقت بیاد
                    //چون در موقع نمایش ایتم سورس با تمام مقادیر ساخته شده
                    var filterArg = new MyCommonWPFControls.SearchFilterArg();
                    filterArg.FilterBySelectedValue = true;
                    filterArg.SingleFilterValue     = e.SingleFilterValue.ToString();
                    SearchFilterChanged(this, filterArg);
                    if (lastSearchItemsSource == null)
                    {
                        lookupItemsSource = filterArg.ResultItemsSource;
                    }
                    else
                    {
                        lookupItemsSource = MergeSources(filterArg.ResultItemsSource, lookupItemsSource);
                    }

                    e.ResultItemsSource = lookupItemsSource;
                }
                else
                {
                    e.ResultItemsSource = lookupItemsSource;
                }
            }
            else if (SearchFilterChanged != null)
            {
                //با خود سرچ لوکاپ میاد اینجا
                SearchFilterChanged(sender, e);
                lastSearchItemsSource = e.ResultItemsSource;
            }
        }