Пример #1
0
 public override string Print(int depth)
 {
     if (!string.IsNullOrEmpty(Operation))
     {
         return("filter " + SetName.Print(depth) + " " + RuleInput.Print(depth) + " " + Operation);
     }
     return("filter " + SetName.Print(depth) + " " + TempVar.Print(depth) + " " + Expression.Print(depth));
 }
Пример #2
0
        public async Task <IActionResult> OnGet()
        {
            Rule = new RuleInput();

            var actions = await DbHelper.FromProcAsync <List <Action> >("WJbActions_Lst_Demo");

            ViewData["Actions"] = new SelectList(actions, "ActionId", "ActionName");

            return(Page());
        }
Пример #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Rule = await DbHelper.FromProcAsync <RuleInput>("WJbRules_Get_Demo", id);

            if (Rule.RuleId == 0)
            {
                return(NotFound());
            }

            var actions = await DbHelper.FromProcAsync <List <Action> >("WJbActions_Lst_Demo");

            ViewData["Actions"] = new SelectList(actions, "ActionId", "ActionName");

            return(Page());
        }
Пример #4
0
        internal static bool FileToObject_1(ref LabelViewModel labelData, FileData_1 fileData)
        {
            try
            {
                labelData.Label        = new LabelObject();
                labelData.Label.Name   = fileData.Label.Name;
                labelData.Label.Width  = fileData.Label.Width;
                labelData.Label.Height = fileData.Label.Height;

                labelData.Label.Margin = fileData.Label.Margin;
                labelData.Label.Radius = fileData.Label.Radius;

                labelData.Label.SelectedPrinter = fileData.Label.SelectedPrinter;
                labelData.Label.SelectedDpi     = fileData.Label.SelectedDpi;
                labelData.Label.OffsetX         = fileData.Label.OffsetX;
                labelData.Label.OffsetY         = fileData.Label.OffsetY;
                labelData.Label.NumberOfCopies  = fileData.Label.NumberOfCopies;

                labelData.Label.RepeatOfInputs         = fileData.Label.RepeatOfInputs;
                labelData.Label.EnableSequentialInputs = fileData.Label.EnableSequentialInputs;
                labelData.Label.SerialNumberStartIndex = fileData.Label.SerialNumberStartIndex;
                labelData.Label.SerialNumberLength     = fileData.Label.SerialNumberLength;
                labelData.Label.LastSerialNumber       = fileData.Label.LastSerialNumber;

                foreach (var to in fileData.TextList)
                {
                    labelData.ObjectList.Add(new TextObject()
                    {
                        Name   = to.Name,
                        Width  = to.Width,
                        Height = to.Height,
                        PosX   = to.PosX,
                        PosY   = to.PosY,

                        Text      = to.Text,
                        MaxLength = to.MaxLength,

                        FontSize      = to.FontSize,
                        FontFamily    = to.FontFamily,
                        FontStyle     = to.FontStyle,
                        FontWeight    = to.FontWeight,
                        TextAlignment = to.TextAlignment
                    });
                }

                foreach (var bo in fileData.BarcodeList)
                {
                    labelData.ObjectList.Add(new BarcodeObject()
                    {
                        Name        = bo.Name,
                        Width       = bo.Width,
                        Height      = bo.Height,
                        PosX        = bo.PosX,
                        PosY        = bo.PosY,
                        MaxLength   = bo.MaxLength,
                        BarcodeType = bo.BarcodeType,
                        Text        = bo.Text
                    });
                }

                foreach (var file in fileData.RuleSequentialNumList)
                {
                    var rsn = new RuleSequentialNum()
                    {
                        NumLength    = file.Contents.NumLength,
                        MinNum       = file.Contents.MinNum,
                        MaxNum       = file.Contents.MaxNum,
                        CurrNum      = file.Contents.CurrNum,
                        Increment    = file.Contents.Increment,
                        OnZeroFiller = file.Contents.OnZeroFiller,
                    };
                    labelData.RuleList.Add(new RuleMain()
                    {
                        Format      = file.Format,
                        Name        = file.Name,
                        Description = file.Description,
                        Content     = rsn
                    });
                }
                foreach (var file in fileData.RuleTimeList)
                {
                    var rt = new RuleTime()
                    {
                        Pattern = file.Contents.Pattern
                    };
                    labelData.RuleList.Add(new RuleMain()
                    {
                        Format      = file.Format,
                        Name        = file.Name,
                        Description = file.Description,
                        Content     = rt
                    });
                }
                foreach (var file in fileData.RuleManualList)
                {
                    var rml = new RuleManualList()
                    {
                        ContentList     = XMLSerializer.XmlToDictionary(file.Contents),
                        SelectedContent = file.SelectedContent
                    };
                    labelData.RuleList.Add(new RuleMain()
                    {
                        Format      = file.Format,
                        Name        = file.Name,
                        Description = file.Description,
                        Content     = rml
                    });
                }
                foreach (var file in fileData.RuleInputList)
                {
                    var ri = new RuleInput()
                    {
                        Order      = file.Contents.Order,
                        StartIndex = file.Contents.StartIndex,
                        CharLength = file.Contents.CharLength,
                        InputData  = file.Contents.InputData
                    };
                    labelData.RuleList.Add(new RuleMain()
                    {
                        Format      = file.Format,
                        Name        = file.Name,
                        Description = file.Description,
                        Content     = ri
                    });
                }
                foreach (var file in fileData.RuleInputCombineList)
                {
                    var ric = new RuleInputCombine()
                    {
                        Seperator  = file.Contents.Seperator,
                        StartIndex = file.Contents.StartIndex,
                        Length     = file.Contents.Length,
                        InputList  = file.Contents.InputList
                    };
                    labelData.RuleList.Add(new RuleMain()
                    {
                        Format      = file.Format,
                        Name        = file.Name,
                        Description = file.Description,
                        Content     = ric
                    });
                }
                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }
        }