Пример #1
0
        public override Form Init(object model, IPrincipal user = null)
        {
            var       init             = base.Init(model, user);
            CharField printTrayIdField = (CharField)GetField("PrinterTrayId");
            IdField   idField          = (IdField)GetField("Id");

            printTrayIdField.Options = new SelectList(PrintModelContext.GetPrinterTrays(Convert.ToInt32(idField.Value)), "Value", "Text", "Group.Name", printTrayIdField.Value, null);;
            return(init);
        }
Пример #2
0
 public PrintForm()
 {
     FormTitle = "Print";
     Fields.Add(new IdField()
     {
         Name = "Id"
     });
     Fields.Add(new CharField()
     {
         Name = "EntityName", Label = "Entity Name", HelpText = "The model name associated with the table."
     });
     Fields.Add(new CharField()
     {
         Name = "PrimaryKey", Label = "Primary Key", HelpText = "Primary Key of the model's record."
     });
     Fields.Add(new CharMaxField()
     {
         Name = "FileLocation", Label = "File Location", HelpText = "A file path, local or network."
     });
     Fields.Add(new CharField()
     {
         Name = "PrinterId", Label = "Printer", Options = PrintModelContext.GetPrinters()
     });
     Fields.Add(new IntegerField()
     {
         Name = "RetryCount", Label = "Retry Count", HelpText = ""
     });
     Fields.Add(new CharField()
     {
         Name = "Status", Label = "Status", HelpText = "", Options = PrintModel.Statuses
     });
     Fields.Add(new BooleanField()
     {
         Name = "DeleteFile", Label = "Delete File", HelpText = "Check to delete the file after it has been printed."
     });
     Fields.Add(new DateTimeField()
     {
         Name = "PrintedDateTime", Label = "Printed DateTime", HelpText = "The time of the day when it printed.", IsReadOnly = true
     });
     Fields.Add(new CharMaxField()
     {
         Name = "ErrorMessage", Label = "ErrorMessage", IsReadOnly = true
     });
 }
Пример #3
0
        public PrintSearchForm(UrlHelper url) : base(url)
        {
            SetApiUrl("PrintAPI", "Print", url);
            AddSearchField(new SearchField("BatchId", "BatchId", SearchField.Comparators.Equal, SearchField.stringType));
            AddSearchField(new SearchField("PrinterId", "Printer", SearchField.Comparators.Equal, SearchField.intType, null, PrintModelContext.GetPrinters()));
            AddSearchField(new SearchField("EntityName", "EntityName", SearchField.Comparators.StartsWith, SearchField.stringType));
            AddSearchField(new SearchField("PrimaryKey", "PrimaryKey", SearchField.Comparators.StartsWith, SearchField.stringType));
            AddSearchField(new SearchField("PrintedDateTime", "Printed DateTime", SearchField.Comparators.Range, SearchField.datetimeType));
            AddSearchField(new SearchField("Status", "Status", SearchField.Comparators.Equal, SearchField.stringType, null, PrintModel.Statuses));
            AddSearchField(new SearchField("CreatedBy_LastName", "Printed by Last Name", SearchField.Comparators.StartsWith, SearchField.stringType, null));

            AddSortField(new SortField("PrinterName", "PrinterName"));
            AddSortField(new SortField("PrintedDateTime", "PrintedDateTime"));
            AddSortField(new SortField("Status", "Status"));
            Selects = new List <string>()
            {
                "Id",
                "EntityName",
                "PrimaryKey",
                "FileLocation",
                "Printer",
                "PrintedDateTime",
                "RetryCount",
                "Status",
                "ErrorMessage",
                "CreatedBy",
            };


            Expand = "Printer/PrinterTray,CreatedBy";
        }