Ejemplo n.º 1
0
        private void tlCategory_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {
            try
            {
                if (tlCategory.FocusedNode != null)
                {
                    BindingSourceMetaData.Clear();
                    Int64 categoryId = (tlCategory.GetDataRecordByNode(tlCategory.FocusedNode) as DB.CAT_Category).Id;
                    pceCategory.EditValue = categoryId;
                    var metastruc = DataContext.EntityCatalogueContext.CAT_Meta.Where(n => n.CategoryId == categoryId);

                    foreach (DB.CAT_Meta meta in metastruc)
                    {
                        BindingSourceMetaData.Add(new EntryMeta()
                        {
                            Id = meta.Id, CategoryId = meta.CategoryId, Grouping = meta.Grouping, Type = meta.Type, Name = meta.Name, Value = ""
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
                {
                    throw ex;
                }
            }
        }
Ejemplo n.º 2
0
        private void PopupulateMeta()
        {
            var metastruc = DataContext.EntityCatalogueContext.CAT_Meta.Where(n => n.CategoryId == TopCategoryId).ToList();

            BindingSourceMetaData.Clear();

            //foreach (DB.CAT_Meta meta in metastruc)
            metastruc.ForEach(meta =>
            {
                BindingSourceMetaData.Add(new EntryMeta()
                {
                    Id = meta.Id, CategoryId = meta.CategoryId, Grouping = meta.Grouping, Type = meta.Type, Name = meta.Name, Value = ""
                });
            });

            grvMetaData.ExpandAllGroups();
        }