public LocalizeEntriesListViewModel(IErpServices erp) : base(c => c
                                                                     .Header("{Localization}")
                                                                     .Column("Todo")
                                                                     .Header("{Todo}")
                                                                     .Content(s => s.Todo ? "X" : "-")
                                                                     .Link(s => s.Todo)
                                                                     .Filter()
                                                                     //.PostLink(s => erp.Localization.Localize(s.Name))
                                                                     .Column("Custom")
                                                                     .Header("{Custom}")
                                                                     .Content(s => s.Todo ? "X" : "-")
                                                                     .Link(s => s.Custom)
                                                                     .Filter()

                                                                     .Column("Tag")
                                                                     .Header("{Tag}")
                                                                     .Link(s => s.Tag)
                                                                     .Filter()

                                                                     .Column("Code")
                                                                     .Header("{Code}")
                                                                     .Link(s => s.Code)
                                                                     .Filter()

                                                                     .Column("Value")
                                                                     .Header("{Value}")
                                                                     .Link(s => s.Value)
                                                                     .Filter()

                                                                     )
        {
        }
Пример #2
0
        public void Inject(IOptionsService options, IErpServices erp, Func <Type, object> get)
        {
            Options = options;
            _get    = get;
            Erp     = erp;
            Filters = new(filters);
            H <EntityListViewModel> .Initialize(this);

            PopulatePresets();
        }
        [Import] public QueryListViewModel(IErpServices erp)
        {
            AddAllowed    = false;
            DeleteAllowed = false;

            _erp = erp;
            // List.AddOnCreate(h => h.Entity. = "<Nouveau Critère>").Update();
            Columns
            .Column("{Name}", s => s.Nom)
            ;


            using (List.Suspender.Get())
            {
            }
        }
Пример #4
0
        protected ColumnConfigurator(IColumn <T> .IHelper helper, IErpServices erp)
        {
            Erp    = erp;
            Helper = helper;

            var filter = helper.GetFilter <TFilter>();

            if (filter == null)
            {
                return;
            }

            var link = helper.GetLinkExpression <TLink>();

            if (link == null)
            {
                return;
            }

            filter?.Link(helper.Target.List, link);
        }
Пример #5
0
        public ManufacturersListViewModel(IErpServices erp)
        {
            AddAllowed    = true;
            DeleteAllowed = true;

            _erp = erp;
            // List.AddOnCreate(h => h.Entity. = "<Nouveau Critère>").Update();
            Columns
//                .Column("Ref",  s => s.Caption)
            .Column("{Name}", e => e.Name)
//                .Column("Dose",e => e.Dose)
//                .Column("Form",e => e.Form)
            .ColumnAsync("", async(s) => await _erp.Icon.GetIconAsync(s.Country?.IconPath ?? "", 25), s => s.Country.Name)
            //.Hidden("IsValid",  s => s.Validation != 2)
            ;

            using (List.Suspender.Get())
            {
                Filters.Add(new FilterTextViewModel {
                    Title = "{Name}"
                }.Link(List, e => e.Name));
            }
        }
Пример #6
0
        [Import] public ListSampleViewModel(IErpServices erp)
        {
            var n = SampleWorkflow.Reception; // TODO : this is a hack to force top level static constructor

            AddAllowed    = true;
            DeleteAllowed = true;

            _erp = erp;
            // List.AddOnCreate(h => h.Entity. = "<Nouveau Critère>").Update();
            Columns
            .Column("{Ref}", s => s.Reference)
            .Column("{FileId}", s => s.FileId?.ToString() ?? "", s => s.FileId)
            .Icon("", s => s.Customer?.Country?.IconPath ?? "", s => s.Customer.Country.Name)
            .Column("{Customer}", s => s.Customer?.Name, s => s.Customer?.Caption)
            .Column("{Product}", s => s.Product?.Caption)
            .Icon("{Form}", (s) => s.Product?.Form?.IconPath ?? "", s => s.Product?.Form?.Name)
            .Column("{Manufacturer}", s => s.Manufacturer?.Name)
            .Column("{Qty}", s => s.ReceivedQuantity)
            .Column("{Expiration}", s => s.ExpirationDate?.ToString(s.ExpirationDayValid ? "dd/MM/yyyy" : "MM/yyyy"), s => s.ExpirationDate)
            .Column("{Notification}", s => s.NotificationDate?.ToString("dd/MM/yyyy") ?? "", s => s.NotificationDate)
            .Column("{Validator}", s => s.Validator)
            .Column("{Progress}", s => new ProgressViewModel {
                Value = s.Progress ?? 0
            }, s => s.Progress)
            .Icon("", s => s.Stage != null ? GetStateIcon(s.Stage) : "", s => s.Stage)
            //                .Column("{Stage}",  s => new Localize { Id = GetStateCaption(s.Stage) })
            .Localize("{Stage}", s => GetStateCaption(s.Stage), s => s.Stage)
//                .Icon("{State}",  s => s.State != null ? GetStateIcon(s.State.Value) : "", s=> s.State)
//                .Hidden("IsValid",  s => s.Stage != SampleWorkflow.Invalidated.Name)
            ;


            using (List.Suspender.Get())
            {
                Filters.Add(new FilterTextViewModel()
                {
                    Title = "{Reference}",
                }.Link(List, s => s.Reference));


                Filters.Add(new FilterDateViewModel()
                {
                    Title   = "{Expiration}",
                    MinDate = DateTime.Now.AddYears(-5),
                    MaxDate = DateTime.Now.AddYears(+5)
                }.Link(List, s => s.ExpirationDate));

                //Filters.Add(new FilterDateViewModel()
                //{
                //    Title = "{Notification}",
                //    MinDate = DateTime.Now.AddYears(-10),
                //    MaxDate = DateTime.Now.AddYears(10)
                //}.Link(List,s => s.NotificationDate));

                Filters.Add(new FilterDateViewModel()
                {
                    Title   = "{Manufacturing}",
                    MinDate = DateTime.Now.AddYears(-10),
                    MaxDate = DateTime.Now.AddYears(10)
                }.Link(List, s => s.ManufacturingDate));

                Filters.Add(new FilterDateViewModel()
                {
                    Title   = "{Sampling}",
                    MinDate = DateTime.Now.AddYears(-10),
                    MaxDate = DateTime.Now.AddYears(10)
                }.Link(List, s => s.SamplingDate));

                Filters.Add(new FilterTextViewModel()
                {
                    Title = "{Origin}",
                }.Link(List, s => s.SamplingOrigin));

                Filters.Add(new FilterTextViewModel()
                {
                    Title = "{Commercial Name}",
                }.Link(List, s => s.CommercialName));
                //Filters.Add(new FilterEntityViewModel<Product>(new ListProductPopupViewModel())
                //    {
                //        Title = "Product",
                //        Filters = {new FilterTextViewModel{Title = "Inn"}}
                //    }.Link(List, s => s.Product)
                //);



                /*            var f3 = new EntityFilterViewModel
                 *          {
                 *              Title = "^Customer"
                 *          };
                 *          List.AddFilter(s => f3.Match(s.CustomerId));
                 *          Filters.Add(f3);
                 *
                 *          var f4 = new EntityFilterViewModel
                 *          {
                 *              Title = "^Manufacturer"
                 *          };
                 *          List.AddFilter(s => f4.Match(s.ManufacturerId));
                 *          Filters.Add(f4);
                 */
            }
        }
Пример #7
0
 public BrowserServiceModule(IErpServices erp)
 {
     _erp = erp;
     H.Initialize(this);
 }
Пример #8
0
 public ColumnHelper(IColumn <T> column, IEntityListViewModel <T> target, IErpServices erp)
 {
     Column = column;
     Target = target;
     Erp    = erp;
 }
Пример #9
0
 public ColumnConfigurator(IEntityListViewModel <T> list, IErpServices erp)
     : this(new ColumnHelper <T>(new Column <T>(), list, erp), erp)
 {
 }
 public SampleFormViewModel(IErpServices erp, Func <FormHelper> getFormHelper)
 {
     Erp = erp;
     H.Initialize(this);
     FormHelper = getFormHelper();
 }
Пример #11
0
 public void Inject(IErpServices erp)
 {
     Erp = erp;
 }
Пример #12
0
 public ImportUsersModule(IErpServices erp)
 {
     _erp = erp;
     H.Initialize(this);
 }
Пример #13
0
 public AboutViewModel(IErpServices erp)
 {
     _erp = erp;
     H <AboutViewModel> .Initialize(this);
 }