Exemplo n.º 1
0
        public virtual void SetDataType(Type type, UiBase parent)
        {
            CloseCurrentService();

            CurrentType           = type;
            this.associatedParent = parent;

            if (type == typeof(UiClient))
            {
                UiClient.InitService();
                SelectService(UiClient.Service, typeof(UiClient), parent);
                return;
            }

            if (type == typeof(UiEmployee))
            {
                UiEmployee.InitService();
                SelectService(UiEmployee.Service, typeof(UiEmployee), parent);
                return;
            }

            if (type == typeof(UiProjectItemsCategory))
            {
                // only as DetailController
                UiProjectItemsCategory.InitService();
                SelectService(UiProjectItemsCategory.Service, typeof(UiProjectItemsCategory), parent);
                return;
            }

            if (type == typeof(UiProject))
            {
                UiProject.InitService();
                SelectService(UiProject.Service, typeof(UiProject), parent, new[] { "Budgets" });
                return;
            }

            if (type == typeof(UiMaterial))
            {
                UiMaterial.InitService();
                SelectService(UiMaterial.Service, typeof(UiMaterial), parent);
                return;
            }

            if (type == typeof(UiProjectCategory))
            {
                UiProjectCategory.InitService();
                SelectService(UiProjectCategory.Service, typeof(UiProjectCategory), parent);
                return;
            }

            // TODO : throw an exception
        }
Exemplo n.º 2
0
        private static void CategoryUpdate(UiProjectItemsCategory item)
        {
            if (item.IsDirty)
            {
                item.Update();
            }

            foreach (var detail in item.Details)
            {
                if (detail.IsDirty)
                {
                    detail.Update();
                }
            }
        }
Exemplo n.º 3
0
 public MasterDetailController(IDetailCustomView view)
     : base(view)
 {
     UiProjectItemsCategory.InitService();
     detailService = UiProjectItemsCategory.Service;
 }