public void KommuniKation_DoubleClick(C1.WPF.DataGrid.C1DataGrid grid)
        {
            try
            {
                var t = (Models.KommunikationModel)grid.SelectedItem;
                if (t.Type == "Termin")
                {
                    String[] size   = CommonTools.Tools.HelperTools.GetConfigEntry("PopUpSizeTermin", "650,950").Split(',');
                    var      Termin = new StandardPopupView(t.ItemID, StandardPopupViewModel.EnumPopupType.Termin, "Termin Nr. : " + t.ItemID, double.Parse(size[0]), double.Parse(size[1]));
                    Termin.ShowDialog();
                }
                else if (t.Type == "Mail")
                {
                    String[] size = CommonTools.Tools.HelperTools.GetConfigEntry("PopUpSizeMail", "800,1100").Split(',');
                    var      Mail = new StandardPopupView(t.ItemID, StandardPopupViewModel.EnumPopupType.Email, "Email Nr. : " + t.ItemID, double.Parse(size[0]), double.Parse(size[1]));

                    Mail.ShowDialog();
                }
            }

            catch (System.IO.IOException ex)
            {
                CommonTools.Tools.ErrorMethods.HandleStandardError(ex, "Fehler beim Öffnen von Mailviewer");
            }
            catch (Exception ex)
            {
                CommonTools.Tools.ErrorMethods.HandleStandardError(ex, "Fehler beim Öffnen von Mailviewer");
            }
        }
        private static IEnumerable <lagerliste> GetFilteredGridRows(C1.WPF.DataGrid.C1DataGrid grid)
        {
            Trace.WriteLine("EditArtikelListeViewModel.cs - GetFilteredGridRows Start");
            Trace.Flush();
            LoggingTool.addDatabaseLogging("", 0, 0, "EditArtikelListeViewModel.cs - GetFilteredGridRows Start", DateTime.Now.ToLongTimeString());
            try
            {
                var res = grid.Rows;
                var li  = new List <lagerliste>();
                foreach (var item in res)
                {
                    if (item.DataItem != null)
                    {
                        li.Add((lagerliste)item.DataItem);
                    }
                }

                var buf = (IEnumerable <lagerliste>)li;
                Trace.WriteLine("EditArtikelListeViewModel.cs - GetFilteredGridRows done");
                Trace.Flush();
                LoggingTool.addDatabaseLogging("", 0, 0, "EditArtikelListeViewModel.cs - GetFilteredGridRows Stop", DateTime.Now.ToLongTimeString());

                return(buf);
            }
            catch (Exception ex)
            {
                CommonTools.Tools.ErrorMethods.HandleStandardError(ex);
                return(new List <lagerliste>());
            }
        }
        private void ReadColumns(C1.WPF.DataGrid.C1DataGrid Grid)
        {
            Filter.Clear();
            filterString = string.Empty;
            //C1.WPF.DataGrid.DataGridColumn[] dc = Grid.FilteredColumns;
            //foreach (var d in dc)
            //{
            //    var fs = d.FilterState;
            //    Filter.Add(d.Name, fs.Tag.ToString());

            //}


            var filterrow = Grid.TopRows[0];

            foreach (var col in Grid.Columns)
            {
                try
                {
                    if (filterrow.Presenter != null)
                    {
                        if ((filterrow.Presenter[col].Content as C1TextBoxBase).C1Text != "")
                        {
                            Filter.Add(col.Name, (filterrow.Presenter[col].Content as C1TextBoxBase).C1Text);
                        }
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Example #4
0
 public void GridGruppen_SelectionChanged(C1.WPF.DataGrid.C1DataGrid grid)
 {
     try
     {
         var item = (AuswahlEintraegeGruppen)grid.SelectedItem;
         _CurrentKategorie = item;
         EintraegeListe    = new ObservableCollection <AuswahlEintraege>(db.AuswahlEintraege.Where(e => e.id_Gruppe == item.id));
     }
     catch (Exception)
     {
     }
 }
 public void TerminListeMouseDoubleClick(C1.WPF.DataGrid.C1DataGrid grid)
 {
     try
     {
         var t = (CRMTermine)grid.SelectedItem;
         _events.Publish(new TerminEvent(t.id, db, t.AppointmentType));
         _events.Publish(new ConfigureUITermineDaten(1, "01"));
         _events.Publish(new SelectUIEvent(false, SelectUIEvent.EnumActivateModule.None));
     }
     catch (Exception)
     {
     }
 }
        private static IEnumerable <SI_InventurenPositionen> GetFilteredGridRows(C1.WPF.DataGrid.C1DataGrid grid)
        {
            var res = grid.Rows;
            var li  = new List <SI_InventurenPositionen>();

            foreach (var item in res)
            {
                if (item.DataItem != null)
                {
                    li.Add((SI_InventurenPositionen)item.DataItem);
                }
            }

            var buf = (IEnumerable <SI_InventurenPositionen>)li;

            return(buf);
        }
 public void Kundenbesuche_DoubleClick(C1.WPF.DataGrid.C1DataGrid grid)
 {
     try
     {
         var t = (Models.KundenbesucheListe)grid.SelectedItem;
         if (t != null)
         {
             int      buf    = t.id;
             String[] size   = CommonTools.Tools.HelperTools.GetConfigEntry("PopUpSizeKundenbesuch", "800,2000").Split(',');
             var      kbView = new StandardPopupView(t.id, StandardPopupViewModel.EnumPopupType.Kundenbesuch, "Kundenbesuch", double.Parse(size[0]), double.Parse(size[1]));
             kbView.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         CommonTools.Tools.ErrorMethods.HandleStandardError(ex, "Fehler beim Anzeigen von Besuchsberichten");
     }
 }
 public string ResetFilter(string prefilter, C1.WPF.DataGrid.C1DataGrid c1Grid, bool bIncludeLike)
 {
     ReadColumns(c1Grid);
     return(ReadDictionary(bIncludeLike, prefilter));
 }
        public static void AddColumns(C1.WPF.DataGrid.C1DataGrid dg, List <ColumnDescription> cList)
        {
            StaticData.DataTypeList.Clear();
            foreach (var cd in cList)
            {
                string buf = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                if (buf.ToLower() != "id")
                {
                    StaticData.DataTypeList.Add(buf, cd.DataType);
                }



                if (cd.TypeEnum == enumType.Date)
                {
                    C1.WPF.DataGrid.DataGridTextColumn col =
                        cd.oBinding != null?TemplateHelper.Getc1TextColumn(cd.header, cd.oBinding)
                            : TemplateHelper.Getc1TextColumn(cd.header, cd.binding);

                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }

                    if (cd.SetFilterPath)
                    {
                        col.FilterMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }
                    if (cd.SetSortPath)
                    {
                        col.SortMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }

                    col.Name   = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    col.Format = "dd.MM.yyyy";
                    col.HorizontalAlignment = HorizontalAlignment.Right;
                    col.VerticalAlignment   = VerticalAlignment.Top;
                    dg.Columns.Add(col);
                }

                else if (cd.TypeEnum == enumType.Currency)
                {
                    C1.WPF.DataGrid.DataGridTextColumn col =
                        cd.oBinding != null?TemplateHelper.Getc1TextColumn(cd.header, cd.oBinding)
                            : TemplateHelper.Getc1TextColumn(cd.header, cd.binding);

                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }

                    if (cd.SetFilterPath)
                    {
                        col.FilterMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }
                    if (cd.SetSortPath)
                    {
                        col.SortMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }

                    col.Name   = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    col.Format = "{0:f}";
                    col.HorizontalAlignment = HorizontalAlignment.Right;
                    col.VerticalAlignment   = VerticalAlignment.Top;
                    dg.Columns.Add(col);
                }



                else if (cd.TypeEnum == enumType.Checkbox)
                {
                    C1.WPF.DataGrid.DataGridCheckBoxColumn col =
                        cd.oBinding != null?TemplateHelper.Getc1CheckBoxColumn(cd.header, cd.oBinding)
                            : TemplateHelper.Getc1CheckBoxColumn(cd.header, cd.binding);

                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }

                    if (cd.SetFilterPath)
                    {
                        col.FilterMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }
                    if (cd.SetSortPath)
                    {
                        col.SortMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }

                    col.Name = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;

                    col.HorizontalAlignment = HorizontalAlignment.Right;

                    dg.Columns.Add(col);
                }

                else if (cd.TypeEnum == enumType.MultiLineText)
                {
                    DataGridMultiLineTextColumn col =
                        cd.oBinding != null?TemplateHelper.Getc1MultiLineTextColumn(cd.header, cd.oBinding)
                            : TemplateHelper.Getc1MultiLineTextColumn(cd.header, cd.binding);

                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }

                    if (cd.SetFilterPath)
                    {
                        col.FilterMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }
                    if (cd.SetSortPath)
                    {
                        col.SortMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }

                    //col.Name = cd.binding;

                    dg.Columns.Add(col);
                }



                else if (cd.TypeEnum == enumType.Hyperlink)
                {
                    C1.WPF.DataGrid.DataGridHyperlinkColumn col =
                        cd.oBinding != null?TemplateHelper.Getc1HyperlinkColumn(cd.header, cd.oBinding)
                            : TemplateHelper.Getc1HyperlinkColumn(cd.header, cd.binding);



                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }

                    if (cd.SetFilterPath)
                    {
                        col.FilterMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }
                    if (cd.SetSortPath)
                    {
                        col.SortMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }

                    //col.Name = cd.binding;

                    dg.Columns.Add(col);
                }



                else if (cd.TypeEnum == enumType.Image)
                {
                    C1.WPF.DataGrid.DataGridImageColumn col =
                        cd.oBinding != null?TemplateHelper.Getc1ImageColumn(cd.header, cd.oBinding)
                            : TemplateHelper.Getc1ImageColumn(cd.header, cd.binding);

                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }

                    if (cd.SetFilterPath)
                    {
                        col.FilterMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }
                    if (cd.SetSortPath)
                    {
                        col.SortMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }

                    col.Name    = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    col.Stretch = System.Windows.Media.Stretch.None;


                    // col.HorizontalAlignment = HorizontalAlignment.Right;

                    dg.Columns.Add(col);
                }

                else if (cd.TypeEnum == enumType.Text)
                {
                    C1.WPF.DataGrid.DataGridTextColumn col =
                        cd.oBinding != null?TemplateHelper.Getc1TextColumn(cd.header, cd.oBinding)
                            : TemplateHelper.Getc1TextColumn(cd.header, cd.binding);

                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }



                    if (cd.SetFilterPath)
                    {
                        if (cd.oBinding != null)
                        {
                            if (cd.oBinding.Path.PathParameters.Count == 1)
                            {
                                col.FilterMemberPath = cd.oBinding.Path.PathParameters[0].ToString();
                            }
                            else
                            {
                                col.FilterMemberPath = cd.oBinding.Path.Path;
                            }
                        }
                        else
                        {
                            col.FilterMemberPath = cd.binding;
                        }
                    }



                    if (cd.SetSortPath)
                    {
                        if (cd.oBinding != null)
                        {
                            if (cd.oBinding.Path.PathParameters.Count == 1)
                            {
                                col.SortMemberPath = cd.oBinding.Path.PathParameters[0].ToString();
                            }
                            else
                            {
                                col.SortMemberPath = cd.oBinding.Path.Path;
                            }
                        }
                        else
                        {
                            col.SortMemberPath = cd.binding;
                        }
                    }


                    col.Name = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;



                    dg.Columns.Add(col);
                }
                else if (cd.TypeEnum == enumType.TemplateBackground)
                {
                    string binding = string.Empty;
                    if (cd.binding == null)
                    {
                        binding = cd.oBinding.Path.Path;
                    }
                    else
                    {
                        binding = cd.binding;
                    }

                    C1.WPF.DataGrid.DataGridTemplateColumn col = TemplateHelper.Getc1TextTemplate(cd.header, binding, cd.BackGroundBinding);


                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }

                    if (cd.SetFilterPath)
                    {
                        col.FilterMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }
                    if (cd.SetSortPath)
                    {
                        col.SortMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }

                    col.Name = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;

                    dg.Columns.Add(col);
                }



                else
                {
                    C1.WPF.DataGrid.DataGridTemplateColumn col = TemplateHelper.Getc1TextTemplate(cd.header, cd.binding);

                    if (cd.WidthAuto)
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width, C1.WPF.DataGrid.DataGridUnitType.Auto);
                    }
                    else
                    {
                        col.Width = new C1.WPF.DataGrid.DataGridLength(cd.width);
                    }

                    if (cd.SetFilterPath)
                    {
                        col.FilterMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }
                    if (cd.SetSortPath)
                    {
                        col.SortMemberPath = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;
                    }

                    col.Name = cd.oBinding != null ? cd.oBinding.Path.Path : cd.binding;

                    dg.Columns.Add(col);
                }
            }
        }
 public void Termin_SelectionChanged(C1.WPF.DataGrid.C1DataGrid grid)
 {
 }