Пример #1
0
        public EntitySearch(DataTable _TimeEntryCache, String _User)
        {
            InitializeComponent();

            searchInfo.Content = "";
            this.Title         = "";
            TimeEntryCache     = _TimeEntryCache;

            SearchResult = new DataTable("favorites");

            SearchResult.Columns.Add("gctype", typeof(String));
            SearchResult.Columns.Add("gcdescription", typeof(String));
            SearchResult.Columns.Add("gcinfo1", typeof(String));
            SearchResult.Columns.Add("gcinfo2", typeof(String));

            SearchGrid.ItemsSource = SearchResult;

            SearchGrid.IsFilterEnabled = true;
            SearchGrid.RefreshData();
            SearchGrid.GroupBy(SearchGrid.Columns["gctype"], DevExpress.Data.ColumnSortOrder.Ascending);

            SearchGrid.ExpandAllGroups();

            //Boolean _check_failed = false;

            //// Check marked time entries
            //Int32 _sync_count = 0;
            //for (int i = 0; i < _parent_tv.SelectedRows.Count; i++)
            //{
            //    System.Data.DataRowView _drv = (System.Data.DataRowView)_parent_tv.SelectedRows[i];
            //    DataRow _dr = _drv.Row;
            //    String _status = "";
            //    String _tekz = "";
            //    try
            //    {
            //        _tekz = _dr["tekz"].ToString().Trim().ToUpper();
            //        _status = _dr["status"].ToString().Trim().ToUpper();
            //    }
            //    catch
            //    {
            //    }

            //    if (_status == "NOSYNC")
            //    {
            //        _sync_count++;
            //        if (Sync_Entity_Type == "")
            //        {
            //            Sync_Entity_Type = _tekz;
            //        }
            //        else
            //        {
            //            if (Sync_Entity_Type != _tekz)
            //            {
            //                MessageBox.Show("Es können nur Zeiteinträge vom gleichen MSCRM Typ (AP, ANF, VC) zugewiesen werden!", "Wichtiger Hinweis", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            //                _check_failed = true;
            //                break;
            //            }
            //        }
            //    }
            //}

            //if (_sync_count == 0)
            //{
            //    MessageBox.Show("Bitte markieren Sie mindestens einen Zeiteintrag für die Übertragung nach MSCRM!", "Wichtiger Hinweis", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            //    _check_failed = true;
            //}

            //if (_check_failed)
            //{
            //    this.Close();
            //} else
            //{
            //    if (Sync_Entity_Type == "AP")
            //    {
            //        if (_sync_count == 1)
            //             this.Title = "Zeiteintrag zu MSCRM Arbeitspaket zuweisen ...";
            //        else this.Title = _sync_count.ToString()+" Zeiteinträge zu MSCRM Arbeitspaket zuweisen ...";
            //    }
            //    else if (Sync_Entity_Type == "ANF")
            //    {
            //        if (_sync_count == 1)
            //             this.Title = "Zeiteintrag zu MSCRM Anfrage zuweisen ...";
            //        else this.Title = _sync_count.ToString()+" Zeiteinträge zu MSCRM Anfrage zuweisen ...";
            //    }
            //    else if (Sync_Entity_Type == "VC")
            //    {
            //        if (_sync_count == 1)
            //            this.Title = "Zeiteintrag zu MSCRM Verkaufschance zuweisen ...";
            //        else this.Title = _sync_count.ToString() + " Zeiteinträge zu MSCRM Verkaufschance zuweisen ...";
            //    }
            //}
        }