예제 #1
0
 public void GetGlyphsRightAligned()
 {
     var fontData = new FontDescription(ContentLoader.Load<Font>("Verdana12").Data);
     var textConverter = new TextConverter(fontData.GlyphDictionary, fontData.PixelLineHeight);
     var glyphs = textConverter.GetRenderableGlyphs("A a a aaa", HorizontalAlignment.Right);
     Assert.AreEqual(8, glyphs.Length);
 }
예제 #2
0
 public CounterPrinter(TextConverter converter)
 {
     _textConverter = converter;
 }
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write("\r\n");
            this.Write(@"/*
 * You should add your licence here, here is an example :
 *
 * SonarQube, open source software quality management tool.
 * Copyright (C) 2008-2013 SonarSource
 * mailto:contact AT sonarsource DOT com
 *
 * SonarQube is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * SonarQube is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
");

            #line 24 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"

            if (_dataModel != null && _dataModel.Id != null)
            {
                List <string> alreadyImported = new List <string>();
                if (_constructorParametersObj.AsEnumerable() != null)
                {
                    foreach (PropertyInfo property in _constructorParametersObj.AsEnumerable())
                    {
                        if (property.Target != null && property.Type != null && !alreadyImported.AsEnumerable().Contains(property.Type))
                        {
                            alreadyImported.Add(property.Type);
                            if (property.Target.IsEnum)
                            {
            #line default
            #line hidden
                                this.Write("import { ");

            #line 38 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(property.Type)));

            #line default
            #line hidden
                                this.Write("Enum } from \'../models/");

            #line 38 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Type)));

            #line default
            #line hidden
                                this.Write("Enum\';\r\n");

            #line 39 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            }
                            else
                            {
            #line default
            #line hidden
                                this.Write("import { ");

            #line 44 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(property.Type)));

            #line default
            #line hidden
                                this.Write("Model } from \'../models/");

            #line 44 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Type)));

            #line default
            #line hidden
                                this.Write("Model\';\r\n");

            #line 45 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            }
                        }
                    }
                }

                if (_dataModel.References.AsEnumerable() != null)
                {
                    foreach (ReferenceInfo reference in _dataModel.References.AsEnumerable())
                    {
                        if (reference.Target != null && reference.Type != null && !alreadyImported.AsEnumerable().Contains(reference.Type))
                        {
                            alreadyImported.Add(reference.Type);
                            if (reference.Target.IsEnum)
                            {
            #line default
            #line hidden
                                this.Write("import { ");

            #line 61 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(reference.Type)));

            #line default
            #line hidden
                                this.Write("Enum } from \'../models/");

            #line 61 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Type)));

            #line default
            #line hidden
                                this.Write("Enum\';\r\n");

            #line 62 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            }
                            else
                            {
            #line default
            #line hidden
                                this.Write("import { ");

            #line 67 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(reference.Type)));

            #line default
            #line hidden
                                this.Write("Model } from \'../models/");

            #line 67 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Type)));

            #line default
            #line hidden
                                this.Write("Model\';\r\n");

            #line 68 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            }
                        }
                    }
                }


            #line default
            #line hidden
                this.Write("/**\r\n * class: ");

            #line 75 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_dataModel.Id)));

            #line default
            #line hidden
                this.Write("\r\n * You should add a description of your entity here.\r\n * This viewModel is a re" +
                           "ference used in Concerns or\r\n * in APIs\' parameters or return types.\r\n * This mo" +
                           "del is generated from ViewModel domain.\r\n */\r\nexport class ");

            #line 81 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_dataModel.Id)));

            #line default
            #line hidden
                this.Write(" {\r\n");

            #line 82 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"

                if (_dataModel.Properties.AsEnumerable() != null)
                {
                    foreach (PropertyInfo property in _dataModel.Properties.AsEnumerable())
                    {
                        if (property.Id != null && property.TypeScriptType() != null && property.IsCollection)
                        {
            #line default
            #line hidden
                            this.Write("  /**\r\n   * property.\r\n   * isCollection.\r\n   */\r\n  public ");

            #line 94 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id)));

            #line default
            #line hidden
                            this.Write(": ");

            #line 94 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(property.TypeScriptType()));

            #line default
            #line hidden
                            this.Write("[];\r\n");

            #line 95 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                        }
                        else if (property.Id != null && property.TypeScriptType() != null)
                        {
            #line default
            #line hidden
                            this.Write("  /**\r\n   * property.\r\n   */\r\n  public ");

            #line 103 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id)));

            #line default
            #line hidden
                            this.Write(": ");

            #line 103 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(property.TypeScriptType()));

            #line default
            #line hidden
                            this.Write(";\r\n");

            #line 104 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                        }
                    }
                }

                if (_dataModel.References.AsEnumerable() != null)
                {
                    foreach (ReferenceInfo reference in _dataModel.References.AsEnumerable())
                    {
                        if (reference.Id != null && reference.Target != null && reference.Target.IsEnum)
                        {
            #line default
            #line hidden
                            this.Write("  /**\r\n   * reference.\r\n   * isEnum.\r\n   */\r\n  public ");

            #line 120 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Id)));

            #line default
            #line hidden
                            this.Write(": ");

            #line 120 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(reference.TypeScriptType())));

            #line default
            #line hidden
                            this.Write("Enum;\r\n");

            #line 121 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                        }
                        else if (reference.Id != null && reference.TypeScriptType() != null && reference.IsCollection)
                        {
            #line default
            #line hidden
                            this.Write("  /**\r\n   * reference.\r\n   * isCollection.\r\n   */\r\n  public ");

            #line 130 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Id)));

            #line default
            #line hidden
                            this.Write(": ");

            #line 130 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(reference.TypeScriptType())));

            #line default
            #line hidden
                            this.Write("Model[];\r\n");

            #line 131 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                        }
                        else if (reference.Id != null && reference.TypeScriptType() != null)
                        {
            #line default
            #line hidden
                            this.Write("  /**\r\n   * reference.\r\n   */\r\n  public ");

            #line 139 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Id)));

            #line default
            #line hidden
                            this.Write(": ");

            #line 139 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(reference.TypeScriptType())));

            #line default
            #line hidden
                            this.Write("Model;\r\n");

            #line 140 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                        }
                    }
                }


            #line default
            #line hidden
                this.Write("  constructor(\r\n");

            #line 146 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"

                if (_constructorParametersObj.AsEnumerable() != null && _constructorParametersObj.AsEnumerable().Count() > 0)
                {
                    int lastIndex = _constructorParametersObj.AsEnumerable().Count() - 1;
                    int index     = 0;
                    Dictionary <string, int> countConstructor = new Dictionary <string, int>();
                    foreach (PropertyInfo property in _constructorParametersObj.AsEnumerable())
                    {
                        if (property.Id != null && property.TypeScriptType() != null)
                        {
                            string propertyIsModel = IsModel(property);
                            if (!countConstructor.ContainsKey(property.Id))
                            {
                                countConstructor.Add(property.Id, 1);
                            }
                            else
                            {
                                countConstructor[property.Id] = countConstructor[property.Id] + 1;
                            }
                            string type = property.TypeScriptType();
                            if (!propertyIsModel.Equals(""))
                            {
                                type = TextConverter.PascalCase(type);
                            }
                            if (property.IsCollection && index == lastIndex)
                            {
            #line default
            #line hidden
                                this.Write("    ");

            #line 169 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id) + countConstructor[property.Id]));

            #line default
            #line hidden
                                this.Write(": ");

            #line 169 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(type + propertyIsModel));

            #line default
            #line hidden
                                this.Write("[]\r\n");

            #line 170 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            }
                            else if (index == lastIndex)
                            {
            #line default
            #line hidden
                                this.Write("    ");

            #line 175 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id) + countConstructor[property.Id]));

            #line default
            #line hidden
                                this.Write(": ");

            #line 175 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(type + propertyIsModel));

            #line default
            #line hidden
                                this.Write("\r\n");

            #line 176 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            }
                            else if (property.IsCollection)
                            {
            #line default
            #line hidden
                                this.Write("    ");

            #line 181 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id) + countConstructor[property.Id]));

            #line default
            #line hidden
                                this.Write(": ");

            #line 181 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(type + propertyIsModel));

            #line default
            #line hidden
                                this.Write("[],\r\n");

            #line 182 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            }
                            else
                            {
            #line default
            #line hidden
                                this.Write("    ");

            #line 187 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id) + countConstructor[property.Id]));

            #line default
            #line hidden
                                this.Write(": ");

            #line 187 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(type + propertyIsModel));

            #line default
            #line hidden
                                this.Write(",\r\n");

            #line 188 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            }
                        }
                        index++;
                    }
                }


            #line default
            #line hidden
                this.Write("  ) {\r\n");

            #line 196 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"

                Dictionary <string, int> countObj = new Dictionary <string, int>();
                if (_dataModel.Properties.AsEnumerable() != null)
                {
                    foreach (PropertyInfo property in _dataModel.Properties.AsEnumerable())
                    {
                        if (property.Id != null)
                        {
                            if (!countObj.ContainsKey(property.Id))
                            {
                                countObj.Add(property.Id, 1);
                            }
                            else
                            {
                                countObj[property.Id] = countObj[property.Id] + 1;
                            }


            #line default
            #line hidden
                            this.Write("    this.");

            #line 209 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id)));

            #line default
            #line hidden
                            this.Write(" = ");

            #line 209 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id) + countObj[property.Id]));

            #line default
            #line hidden
                            this.Write(";\r\n");

            #line 210 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                        }
                    }
                }

                if (_dataModel.References.AsEnumerable() != null)
                {
                    foreach (ReferenceInfo reference in _dataModel.References.AsEnumerable())
                    {
                        if (reference.Id != null)
                        {
                            if (!countObj.ContainsKey(reference.Id))
                            {
                                countObj.Add(reference.Id, 1);
                            }
                            else
                            {
                                countObj[reference.Id] = countObj[reference.Id] + 1;
                            }


            #line default
            #line hidden
                            this.Write("    this.");

            #line 226 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Id)));

            #line default
            #line hidden
                            this.Write(" = ");

            #line 226 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Id) + countObj[reference.Id]));

            #line default
            #line hidden
                            this.Write(";\r\n");

            #line 227 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
                        }
                    }
                }


            #line default
            #line hidden
                this.Write("  }\r\n}\r\n");

            #line 234 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\ViewModel\Templates\ViewModelTemplate.tt"
            }


            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
 public DataModelTemplate(EntityInfo model, string appliationId, string modelsuffix) : base(model, appliationId)
 {
     _superProperties = GetSuperClassReferences(model.BaseEntity);
     _modelsuffix     = TextConverter.PascalCase(modelsuffix);
 }
        /// <summary>
        /// Translates this object instance into a Mosaic message.
        /// </summary>
        /// <param name="converterStream">The converter stream instance which request the message conversion.</param>
        /// <returns>
        /// The Mosaic message representation of this object.
        /// </returns>
        public MosaicMessage ToMosaicMessage(IConverterStream converterStream)
        {
            var response = new InitiateStockInputResponse(converterStream);

            response.ID                  = this.Id;
            response.Destination         = this.Destination;
            response.Source              = this.Source;
            response.IsDeliveryInput     = TypeConverter.ConvertBool(this.IsNewDelivery);
            response.SetPickingIndicator = TypeConverter.ConvertBool(this.SetPickingIndicator);
            response.InputSource         = (this.Details != null) ? TypeConverter.ConvertInt(this.Details.InputSource) : 0;
            response.InputPoint          = (this.Details != null) ? TypeConverter.ConvertInt(this.Details.InputPoint) : 0;
            response.Status              = (this.Details != null) ?
                                           TypeConverter.ConvertEnum <InitiateStockInputState>(this.Details.Status, InitiateStockInputState.Rejected) :
                                           InitiateStockInputState.Rejected;

            if (this.Article == null)
            {
                return(response);
            }

            foreach (var article in this.Article)
            {
                response.Articles.Add(new Interfaces.Types.Articles.RobotArticle()
                {
                    Code               = TextConverter.UnescapeInvalidXmlChars(article.Id),
                    Name               = TextConverter.UnescapeInvalidXmlChars(article.Name),
                    PackagingUnit      = TextConverter.UnescapeInvalidXmlChars(article.PackagingUnit),
                    DosageForm         = TextConverter.UnescapeInvalidXmlChars(article.DosageForm),
                    MaxSubItemQuantity = TypeConverter.ConvertInt(article.MaxSubItemQuantity)
                });

                foreach (var pack in article.Pack)
                {
                    response.Packs.Add(new Interfaces.Types.Packs.RobotPack()
                    {
                        ScanCode        = TextConverter.UnescapeInvalidXmlChars(pack.ScanCode),
                        DeliveryNumber  = TextConverter.UnescapeInvalidXmlChars(pack.DeliveryNumber),
                        BatchNumber     = TextConverter.UnescapeInvalidXmlChars(pack.BatchNumber),
                        ExternalID      = TextConverter.UnescapeInvalidXmlChars(pack.ExternalId),
                        ExpiryDate      = TypeConverter.ConvertDate(pack.ExpiryDate),
                        SubItemQuantity = TypeConverter.ConvertInt(pack.SubItemQuantity),
                        Depth           = TypeConverter.ConvertInt(pack.Depth),
                        Width           = TypeConverter.ConvertInt(pack.Width),
                        Height          = TypeConverter.ConvertInt(pack.Height),
                        Shape           = TypeConverter.ConvertEnum <PackShape>(pack.Shape, PackShape.Cuboid),
                        StockLocationID = string.IsNullOrEmpty(pack.StockLocationId) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(pack.StockLocationId)
                    });
                }
            }

            return(response);
        }
        /// <summary>
        /// Translates this object instance into a Mosaic message.
        /// </summary>
        /// <param name="converterStream">The converter stream instance which request the message conversion.</param>
        /// <returns>
        /// The Mosaic message representation of this object.
        /// </returns>
        public override MosaicMessage ToMosaicMessage(IConverterStream converterStream)
        {
            StockOutputMessage msg = (StockOutputMessage)base.ToMosaicMessage(converterStream);

            msg.Order.OutputPoint = TypeConverter.ConvertInt(this.Details.OutputPoint);

            if (msg == null)
            {
                return(null);
            }

            if (msg.Order.Items.Count > 0)
            {
                for (int i = 0; i < msg.Order.Items.Count; ++i)
                {
                    var item = msg.Order.Items[i];

                    if (item.Packs.Count > 0)
                    {
                        for (int k = 0; k < item.Packs.Count; ++k)
                        {
                            item.Packs[k].StockInDate     = TypeConverter.ConvertDate(this.Article[i].Pack[k].StockInDate);
                            item.Packs[k].ScanCode        = TextConverter.UnescapeInvalidXmlChars(this.Article[i].Pack[k].ScanCode);
                            item.Packs[k].DeliveryNumber  = TextConverter.UnescapeInvalidXmlChars(this.Article[i].Pack[k].DeliveryNumber);
                            item.Packs[k].Depth           = TypeConverter.ConvertInt(this.Article[i].Pack[k].Depth);
                            item.Packs[k].Width           = TypeConverter.ConvertInt(this.Article[i].Pack[k].Depth);
                            item.Packs[k].Height          = TypeConverter.ConvertInt(this.Article[i].Pack[k].Depth);
                            item.Packs[k].Shape           = TypeConverter.ConvertEnum <PackShape>(this.Article[i].Pack[k].Shape, PackShape.Cuboid);
                            item.Packs[k].IsInFridge      = TypeConverter.ConvertBool(this.Article[i].Pack[k].IsInFridge);
                            item.Packs[k].BoxNumber       = this.Article[i].Pack[k].BoxNumber;
                            item.Packs[k].SubItemQuantity = TypeConverter.ConvertInt(this.Article[i].Pack[k].SubItemQuantity);
                            item.Packs[k].OutputNumber    = TypeConverter.ConvertInt(this.Article[i].Pack[k].OutputDestination);
                            item.Packs[k].OutputPoint     = TypeConverter.ConvertInt(this.Article[i].Pack[k].OutputPoint);
                            item.Packs[k].LabelState      = TypeConverter.ConvertEnum <StockOutputOrderItemPackLabelState>(this.Article[i].Pack[k].LabelStatus, StockOutputOrderItemPackLabelState.NotLabelled);
                            item.Packs[k].StockLocationID = string.IsNullOrEmpty(this.Article[i].Pack[k].StockLocationId) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(this.Article[i].Pack[k].StockLocationId);
                            item.Packs[k].MachineLocation = string.IsNullOrEmpty(this.Article[i].Pack[k].MachineLocation) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(this.Article[i].Pack[k].MachineLocation);
                        }
                    }
                }
            }


            return(msg);
        }
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            #line 2 "D:\Working\Mobioos\Generators new changes\28Nov2018\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Common\Templates\IosTemplates\InfoTemplate.tt"

            var model = (SmartAppInfo)Model;


            #line default
            #line hidden
            this.Write(@"<?xml version=""1.0"" encoding=""UTF-8""?>
<!DOCTYPE plist PUBLIC ""-//Apple//DTD PLIST 1.0//EN"" ""http://www.apple.com/DTDs/PropertyList-1.0.dtd"">
<plist version=""1.0"">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleDisplayName</key>
	<string>"    );

            #line 12 "D:\Working\Mobioos\Generators new changes\28Nov2018\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Common\Templates\IosTemplates\InfoTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(model.Id)));

            #line default
            #line hidden
            this.Write(@"</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIdentifier</key>
	<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1</string>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>UILaunchStoryboardName</key>
	<string>LaunchScreen</string>
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
	</array>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UIViewControllerBasedStatusBarAppearance</key>
	<false/>
	<key>NSLocationWhenInUseUsageDescription</key>
	<string></string>
	<key>NSAppTransportSecurity</key>
	<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
	<dict>
		<key>NSExceptionDomains</key>
		<dict>
			<key>localhost</key>
			<dict>
				<key>NSExceptionAllowsInsecureHTTPLoads</key>
				<true/>
			</dict>
		</dict>
	</dict>
</dict>
</plist>");
            return(this.GenerationEnvironment.ToString());
        }
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write("\r\n");

            #line 2 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"

            var model = (EntityInfo)Model;


            #line default
            #line hidden

            #line 5 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"

            if (_dataModel != null && _dataModel.Id != null)
            {
                List <string> alreadyImported = new List <string>();
                if (_constructorParametersObj.AsEnumerable() != null)
                {
                    foreach (var property in _constructorParametersObj.AsEnumerable())
                    {
                        if (property.Target != null && property.Type != null && !alreadyImported.AsEnumerable().Contains(property.Type))
                        {
                            alreadyImported.Add(property.Type);


            #line default
            #line hidden
                            this.Write("import ");

            #line 17 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(property.Type)));

            #line default
            #line hidden

            #line 17 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(_modelSuffix));

            #line default
            #line hidden
                            this.Write(" from \'../Models/");

            #line 17 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Type)));

            #line default
            #line hidden
                            this.Write(".");

            #line 17 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(_modelSuffix.ToLower()));

            #line default
            #line hidden
                            this.Write("\';\r\n");

            #line 18 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                        }
                    }
                }
                if (_dataModel.References.AsEnumerable() != null)
                {
                    foreach (ReferenceInfo reference in _dataModel.References.AsEnumerable())
                    {
                        if (reference.Target != null && reference.Type != null && !alreadyImported.AsEnumerable().Contains(reference.Type))
                        {
                            alreadyImported.Add(reference.Type);


            #line default
            #line hidden
                            this.Write("import ");

            #line 30 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(reference.Type)));

            #line default
            #line hidden

            #line 30 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(_modelSuffix));

            #line default
            #line hidden
                            this.Write(" from \'../Models/");

            #line 30 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Type)));

            #line default
            #line hidden
                            this.Write(".");

            #line 30 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(_modelSuffix.ToLower()));

            #line default
            #line hidden
                            this.Write("\';\r\n");

            #line 31 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                        }
                    }
                }


            #line default
            #line hidden
                this.Write("\r\nexport class  ");

            #line 37 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(_dataModel.Id)));

            #line default
            #line hidden

            #line 37 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(_viewModelSuffix));

            #line default
            #line hidden
                this.Write(" {\r\n\r\n    constructor(\r\n");

            #line 40 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"

                if (_constructorParametersObj.AsEnumerable() != null && _constructorParametersObj.AsEnumerable().Count() > 0)
                {
                    int count   = _constructorParametersObj.AsEnumerable().Count() - 1;
                    int counter = 0;
                    Dictionary <string, int> countConstructor = new Dictionary <string, int>();
                    foreach (PropertyInfo property in _constructorParametersObj.AsEnumerable())
                    {
                        if (property.Id != null && property.TypeScriptType() != null)
                        {
                            string propertyIsModel = IsModel(property);
                            if (!countConstructor.ContainsKey(property.Id))
                            {
                                countConstructor.Add(property.Id, 1);
                            }
                            else
                            {
                                countConstructor[property.Id] = countConstructor[property.Id] + 1;
                            }
                            string type = property.TypeScriptType();
                            if (!propertyIsModel.Equals(""))
                            {
                                type = TextConverter.PascalCase(type);
                            }
                            if (counter == count)
                            {
            #line default
            #line hidden
                                this.Write("        ");

            #line 63 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id) + countConstructor[property.Id]));

            #line default
            #line hidden
                                this.Write("\r\n");

            #line 64 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            }
                            else
                            {
            #line default
            #line hidden
                                this.Write("        ");

            #line 69 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id) + countConstructor[property.Id]));

            #line default
            #line hidden
                                this.Write(",\r\n");

            #line 70 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            }
                        }
                        counter++;
                    }
                }


            #line default
            #line hidden
                this.Write("    ) {\r\n\r\n    ");

            #line 79 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"

                Dictionary <string, int> countObj = new Dictionary <string, int>();
                if (_dataModel.Properties.AsEnumerable() != null)
                {
                    foreach (PropertyInfo property in _dataModel.Properties.AsEnumerable())
                    {
                        if (property.Id != null)
                        {
                            if (!countObj.ContainsKey(property.Id))
                            {
                                countObj.Add(property.Id, 1);
                            }
                            else
                            {
                                countObj[property.Id] = countObj[property.Id] + 1;
                            }


            #line default
            #line hidden
                            this.Write("    this.");

            #line 92 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id)));

            #line default
            #line hidden
                            this.Write(" = ");

            #line 92 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id) + countObj[property.Id]));

            #line default
            #line hidden
                            this.Write(";\r\n");

            #line 93 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                        }
                    }
                }

                if (_dataModel.References.AsEnumerable() != null)
                {
                    foreach (ReferenceInfo reference in _dataModel.References.AsEnumerable())
                    {
                        if (reference.Id != null)
                        {
                            if (!countObj.ContainsKey(reference.Id))
                            {
                                countObj.Add(reference.Id, 1);
                            }
                            else
                            {
                                countObj[reference.Id] = countObj[reference.Id] + 1;
                            }


            #line default
            #line hidden
                            this.Write("    this.");

            #line 109 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Id)));

            #line default
            #line hidden
                            this.Write(" = ");

            #line 109 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(reference.Id) + countObj[reference.Id]));

            #line default
            #line hidden
                            this.Write(";\r\n");

            #line 110 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
                        }
                    }
                }


            #line default
            #line hidden
                this.Write("  }\r\n}\r\n");

            #line 117 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\ViewModels\Templates\ViewModelTemplate.tt"
            }


            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
        /// <summary>
        /// Translates this object instance into a Mosaic message.
        /// </summary>
        /// <param name="converterStream">The converter stream instance which request the message conversion.</param>
        /// <returns>
        /// The Mosaic message representation of this object.
        /// </returns>
        public override MosaicMessage ToMosaicMessage(IConverterStream converterStream)
        {
            var request = (Interfaces.Messages.Stock.StockDeliverySetRequest)base.ToMosaicMessage(converterStream);

            if (this.StockDelivery == null)
            {
                return(request);
            }

            for (int i = 0; i < this.StockDelivery.Length; ++i)
            {
                for (int k = 0, max = this.StockDelivery[i].Article.Count; k < max; ++k)
                {
                    request.StockDeliveries[i].Items[k].RequiresFridge     = TypeConverter.ConvertBool(this.StockDelivery[i].Article[k].RequiresFridge);
                    request.StockDeliveries[i].Items[k].MaxSubItemQuantity = TypeConverter.ConvertInt(this.StockDelivery[i].Article[k].MaxSubItemQuantity);
                    request.StockDeliveries[i].Items[k].StockLocationID    = string.IsNullOrEmpty(this.StockDelivery[i].Article[k].StockLocationId) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(this.StockDelivery[i].Article[k].StockLocationId);
                    request.StockDeliveries[i].Items[k].MachineLocation    = string.IsNullOrEmpty(this.StockDelivery[i].Article[k].MachineLocation) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(this.StockDelivery[i].Article[k].MachineLocation);
                }
            }

            return(request);
        }
        /// <summary>
        /// Translates this object instance into a Mosaic message.
        /// </summary>
        /// <param name="converterStream">The converter stream instance which request the message conversion.</param>
        /// <returns>
        /// The Mosaic message representation of this object.
        /// </returns>
        public virtual MosaicMessage ToMosaicMessage(IConverterStream converterStream)
        {
            var request = new Interfaces.Messages.Stock.StockDeliverySetRequest(converterStream);

            request.ID          = this.Id;
            request.Source      = this.Source;
            request.Destination = this.Destination;

            if (this.StockDelivery == null)
            {
                return(request);
            }

            for (int i = 0; i < this.StockDelivery.Length; ++i)
            {
                var stockDelivery = this.StockDelivery[i];

                request.StockDeliveries.Add(new Interfaces.Types.Input.StockDelivery()
                {
                    DeliveryNumber = stockDelivery.DeliveryNumber
                });

                if (stockDelivery.Article == null)
                {
                    continue;
                }

                foreach (var article in stockDelivery.Article)
                {
                    request.StockDeliveries[i].Items.Add(new Interfaces.Types.Input.StockDeliveryItem()
                    {
                        ArticleCode       = TextConverter.UnescapeInvalidXmlChars(article.Id),
                        Name              = TextConverter.UnescapeInvalidXmlChars(article.Name),
                        DosageForm        = TextConverter.UnescapeInvalidXmlChars(article.DosageForm),
                        PackagingUnit     = TextConverter.UnescapeInvalidXmlChars(article.PackagingUnit),
                        BatchNumber       = string.IsNullOrEmpty(article.BatchNumber) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(article.BatchNumber),
                        ExternalID        = string.IsNullOrEmpty(article.ExternalId) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(article.ExternalId),
                        ExpiryDate        = TypeConverter.ConvertDate(article.ExpiryDate),
                        RequestedQuantity = TypeConverter.ConvertInt(article.Quantity)
                    });
                }
            }

            return(request);
        }
예제 #11
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            #line 2 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"

            var _entityInfo = (EntityInfo)Model;


            #line default
            #line hidden
            this.Write("@extends(\'layouts.master\')\r\n\r\n@section(\'content\')\r\n\r\n<div class=\"container-fluid " +
                       "form-horizontal\">\r\n  <div class=\"col-lg-12\">\r\n    <div class=\"card\">\r\n      <div" +
                       " class=\"card-title\">\r\n            <h4>");

            #line 13 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Helper.WordSeperator(TextConverter.PascalCase(_entityInfo.Id))));

            #line default
            #line hidden
            this.Write(" - Details Form</h4>\r\n      </div>\r\n      <div class=\"card-body\">\r\n");

            #line 16 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"

            foreach (var property in _entityInfo.AllProperties())
            {
                if (!property.IsKey)
                {
            #line default
            #line hidden
                    this.Write("        <div class=\"row\">\r\n            <label for=\"");

            #line 23 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id)));

            #line default
            #line hidden
                    this.Write("\" class = \"col-sm-2 col-form-label\">");

            #line 23 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(Helper.WordSeperator(TextConverter.PascalCase(property.Id))));

            #line default
            #line hidden
                    this.Write("</label>\r\n            <div class=\"col-sm-10 label-detail\">\r\n                {{$it" +
                               "em->");

            #line 25 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id)));

            #line default
            #line hidden
                    this.Write("}}\r\n            </div>\r\n        </div>\r\n");

            #line 28 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"
                }
            }


            #line default
            #line hidden
            this.Write("        <div class=\"row form-action\">\r\n           <div class=\"col-sm-10\">\r\n      " +
                       "          <a class=\"btn btn-warning\" href=\"/");

            #line 34 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_entityInfo.Id.ToLower()));

            #line default
            #line hidden
            this.Write("/{{$item->");

            #line 34 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\ShowTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(GetPrimaryKey()));

            #line default
            #line hidden
            this.Write("}}/edit\">Edit</a>\r\n           </div>\r\n      </div>\r\n      </div>\r\n    </div>\r\n  <" +
                       "/div>\r\n</div>\r\n\r\n@endsection ");
            return(this.GenerationEnvironment.ToString());
        }
예제 #12
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write(@"/*
 * You should add your licence here, here is an example :
 *
 * SonarQube, open source software quality management tool.
 * Copyright (C) 2008-2013 SonarSource
 * mailto:contact AT sonarsource DOT com
 *
 * SonarQube is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * SonarQube is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
");

            #line 29 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"

            SmartAppInfo smartApp = (SmartAppInfo)Model;
            if (smartApp != null && smartApp.Id != null)
            {
            #line default
            #line hidden
                this.Write(@"import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { CommonModule } from '@angular/common';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { ");

            #line 41 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(smartApp.Id));

            #line default
            #line hidden
                this.Write(" } from \'./app.component\';\r\n");

            #line 42 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"

                if (smartApp.Api.AsEnumerable() != null)
                {
            #line default
            #line hidden
                    this.Write("import { DataService } from \'../services/data.service\';\r\n");

            #line 47 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                }

                if (smartApp.Concerns.AsEnumerable() != null && _rootLayout != null && _rootLayout.Id != null && _rootConcern != null && _rootConcern.Id != null)
                {
                    string concern             = TextConverter.PascalCase(_rootConcern.Id);
                    string layout              = TextConverter.PascalCase(_rootLayout.Id);
                    string layoutModule        = concern + layout;
                    string layoutModuleToLower = TextConverter.CamelCase(concern) + "-" + TextConverter.CamelCase(layout);


            #line default
            #line hidden
                    this.Write("import { ");

            #line 57 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(layoutModule));

            #line default
            #line hidden
                    this.Write("PageModule } from \'../pages/");

            #line 57 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(concern)));

            #line default
            #line hidden
                    this.Write("/");

            #line 57 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(layout)));

            #line default
            #line hidden
                    this.Write("/");

            #line 57 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(layoutModuleToLower));

            #line default
            #line hidden
                    this.Write(".module\';\r\n");

            #line 58 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n");

            #line 62 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"

                if (_languages.AsEnumerable() != null && _languages.AsEnumerable().Count() > 0)
                {
            #line default
            #line hidden
                    this.Write(@"import { LanguagePageModule } from '../pages/language/language.module';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';

export function createTranslateLoader(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
");

            #line 73 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n/**\r\n * class: AppModule.\r\n");

            #line 79 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"

                if (smartApp.Description != null)
                {
            #line default
            #line hidden
                    this.Write(" * ");

            #line 83 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(smartApp.Description));

            #line default
            #line hidden
                    this.Write(".\r\n * This is the main module of the application.\r\n * This module is generated fr" +
                               "om multiple domains.\r\n");

            #line 86 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                }
                else
                {
            #line default
            #line hidden
                    this.Write(" * This is the main module of the application.\r\n * This module is generated from " +
                               "multiple domains.\r\n");

            #line 93 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                }


            #line default
            #line hidden
                this.Write(" */\r\n@NgModule({\r\n  declarations: [\r\n    ");

            #line 99 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(smartApp.Id)));

            #line default
            #line hidden
                this.Write("\r\n  ],\r\n  imports: [\r\n    BrowserModule,\r\n    CommonModule,\r\n    HttpClientModule" +
                           ",\r\n");

            #line 105 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"

                if (smartApp.Concerns.AsEnumerable() != null && _rootLayout != null && _rootLayout.Id != null && _rootConcern != null && _rootConcern.Id != null)
                {
                    string concern      = TextConverter.PascalCase(_rootConcern.Id);
                    string layout       = TextConverter.PascalCase(_rootLayout.Id);
                    string layoutModule = concern + layout;


            #line default
            #line hidden
                    this.Write("    ");

            #line 112 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(layoutModule));

            #line default
            #line hidden
                    this.Write("PageModule,\r\n");

            #line 113 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                }

                if (_languages.AsEnumerable() != null && _languages.AsEnumerable().Count() > 0)
                {
            #line default
            #line hidden
                    this.Write("    LanguagePageModule,\r\n    TranslateModule.forRoot({\r\n      loader: {\r\n        " +
                               "provide: TranslateLoader,\r\n        useFactory: (createTranslateLoader),\r\n       " +
                               " deps: [HttpClient]\r\n      }\r\n    }),\r\n");

            #line 127 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                }


            #line default
            #line hidden
                this.Write("    IonicModule.forRoot(");

            #line 130 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(smartApp.Id)));

            #line default
            #line hidden
                this.Write(")\r\n  ],\r\n  bootstrap: [IonicApp],\r\n  entryComponents: [\r\n    ");

            #line 134 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(smartApp.Id)));

            #line default
            #line hidden
                this.Write("\r\n  ],\r\n  providers: [\r\n");

            #line 137 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"

                if (smartApp.Api.AsEnumerable() != null)
                {
            #line default
            #line hidden
                    this.Write("    DataService,\r\n");

            #line 142 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
                }


            #line default
            #line hidden
                this.Write("    StatusBar,\r\n    SplashScreen,\r\n    { provide: ErrorHandler, useClass: IonicEr" +
                           "rorHandler }\r\n  ]\r\n})\r\nexport class AppModule {}\r\n");

            #line 151 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppModule.tt"
            }


            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="InitiateInputMessage"/> class.
        /// </summary>
        /// <param name="message">The message to use for initialization.</param>
        public InitiateInputMessage(MosaicMessage message)
        {
            var msg = (InitiateStockInputMessage)message;

            this.Id          = msg.ID;
            this.Destination = msg.Destination;
            this.Source      = msg.Source;
            this.Details     = new Types.Details()
            {
                InputSource = msg.InputSource.ToString(),
                InputPoint  = msg.InputPoint.ToString(),
                Status      = (msg.Status == InitiateStockInputState.InProgress) ?
                              InitiateStockInputState.Accepted.ToString() : msg.Status.ToString()
            };

            if (msg.Articles.Count == 0)
            {
                return;
            }

            int packIndex = 0;

            this.Article = new Article[msg.Articles.Count];

            for (int i = 0; i < this.Article.Length; ++i)
            {
                this.Article[i] = new Article()
                {
                    Id                 = TextConverter.EscapeInvalidXmlChars(msg.Articles[i].Code),
                    Name               = TextConverter.EscapeInvalidXmlChars(msg.Articles[i].Name),
                    PackagingUnit      = TextConverter.EscapeInvalidXmlChars(msg.Articles[i].PackagingUnit),
                    DosageForm         = TextConverter.EscapeInvalidXmlChars(msg.Articles[i].DosageForm),
                    MaxSubItemQuantity = msg.Articles[i].MaxSubItemQuantity.ToString()
                };

                if ((string.IsNullOrEmpty(this.Article[i].Id)) &&
                    (string.IsNullOrEmpty(this.Article[i].Name)) &&
                    (string.IsNullOrEmpty(this.Article[i].PackagingUnit)) &&
                    (string.IsNullOrEmpty(this.Article[i].DosageForm)) &&
                    (msg.Articles[i].MaxSubItemQuantity == 0))
                {
                    this.Article[i].Id                 = null;
                    this.Article[i].Name               = null;
                    this.Article[i].PackagingUnit      = null;
                    this.Article[i].DosageForm         = null;
                    this.Article[i].MaxSubItemQuantity = null;
                }

                foreach (var pack in msg.Packs)
                {
                    if (pack.RobotArticleID == msg.Articles[i].ID)
                    {
                        if (this.Article[i].Pack == null)
                        {
                            this.Article[i].Pack = new List <Types.Pack>();
                        }

                        var packError = msg.PackErrors.ContainsKey(pack) ? msg.PackErrors[pack] : null;
                        this.Article[i].Pack.Add(new Types.Pack()
                        {
                            Index           = packIndex.ToString(),
                            Id              = ((ulong)pack.ID).ToString(),
                            DeliveryNumber  = TextConverter.EscapeInvalidXmlChars(pack.DeliveryNumber),
                            BatchNumber     = TextConverter.EscapeInvalidXmlChars(pack.BatchNumber),
                            ExternalId      = TextConverter.EscapeInvalidXmlChars(pack.ExternalID),
                            ExpiryDate      = TypeConverter.ConvertDateNull(pack.ExpiryDate),
                            StockInDate     = TypeConverter.ConvertDateNull(msg.Packs[i].StockInDate),
                            ScanCode        = TextConverter.EscapeInvalidXmlChars(msg.Packs[i].ScanCode),
                            SubItemQuantity = pack.SubItemQuantity.ToString(),
                            Depth           = pack.Depth.ToString(),
                            Width           = pack.Width.ToString(),
                            Height          = pack.Height.ToString(),
                            Shape           = pack.Shape.ToString(),
                            StockLocationId = TextConverter.EscapeInvalidXmlChars(pack.StockLocationID),
                            MachineLocation = TextConverter.EscapeInvalidXmlChars(pack.MachineLocation),
                            State           = ((pack.IsAvailable == false) || (pack.IsBlocked == true)) ? "NotAvailable" : "Available",
                            IsInFridge      = pack.IsInFridge.ToString(),
                            Error           = (packError == null) ?
                                              null :
                                              new Error()
                            {
                                Type = packError.Type.ToString(),
                                Text = TextConverter.EscapeInvalidXmlChars(packError.Description)
                            }
                        });

                        packIndex++;
                    }
                }
            }
        }
        /// <summary>
        /// Translates this object instance into a Mosaic message.
        /// </summary>
        /// <param name="converterStream">The converter stream instance which request the message conversion.</param>
        /// <returns>
        /// The Mosaic message representation of this object.
        /// </returns>
        public MosaicMessage ToMosaicMessage(IConverterStream converterStream)
        {
            var message = new InitiateStockInputMessage(converterStream);

            message.ID          = this.Id;
            message.Destination = this.Destination;
            message.Source      = this.Source;
            message.InputSource = (this.Details != null) ? TypeConverter.ConvertInt(this.Details.InputSource) : 0;
            message.InputPoint  = (this.Details != null) ? TypeConverter.ConvertInt(this.Details.InputPoint) : 0;
            message.Status      = (this.Details != null) ?
                                  TypeConverter.ConvertEnum <InitiateStockInputState>(this.Details.Status, InitiateStockInputState.Rejected) :
                                  InitiateStockInputState.Rejected;
            if (this.Article != null)
            {
                foreach (var article in this.Article)
                {
                    message.Articles.Add(new Interfaces.Types.Articles.RobotArticle()
                    {
                        Code               = TextConverter.UnescapeInvalidXmlChars(article.Id),
                        Name               = TextConverter.UnescapeInvalidXmlChars(article.Name),
                        PackagingUnit      = TextConverter.UnescapeInvalidXmlChars(article.PackagingUnit),
                        DosageForm         = TextConverter.UnescapeInvalidXmlChars(article.DosageForm),
                        MaxSubItemQuantity = TypeConverter.ConvertInt(article.MaxSubItemQuantity)
                    });

                    if (article.Pack != null)
                    {
                        foreach (var pack in article.Pack)
                        {
                            var msgPack = new Interfaces.Types.Packs.RobotPack()
                            {
                                ID              = (long)TypeConverter.ConvertULong(pack.Id),
                                DeliveryNumber  = TextConverter.UnescapeInvalidXmlChars(pack.DeliveryNumber),
                                BatchNumber     = TextConverter.UnescapeInvalidXmlChars(pack.BatchNumber),
                                ExternalID      = TextConverter.EscapeInvalidXmlChars(pack.ExternalId),
                                ExpiryDate      = TypeConverter.ConvertDate(pack.ExpiryDate),
                                StockInDate     = TypeConverter.ConvertDate(pack.StockInDate),
                                ScanCode        = TextConverter.UnescapeInvalidXmlChars(pack.ScanCode),
                                SubItemQuantity = TypeConverter.ConvertInt(pack.SubItemQuantity),
                                Depth           = TypeConverter.ConvertInt(pack.Depth),
                                Width           = TypeConverter.ConvertInt(pack.Width),
                                Height          = TypeConverter.ConvertInt(pack.Height),
                                Shape           = TypeConverter.ConvertEnum <PackShape>(pack.Shape, PackShape.Cuboid),
                                StockLocationID = string.IsNullOrEmpty(pack.StockLocationId) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(pack.StockLocationId),
                                MachineLocation = string.IsNullOrEmpty(pack.MachineLocation) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(pack.MachineLocation),
                                IsAvailable     = (string.Compare(pack.State, "Available") == 0),
                                IsInFridge      = TypeConverter.ConvertBool(pack.IsInFridge)
                            };

                            message.Packs.Add(msgPack);

                            if (pack.Error != null)
                            {
                                var msgError = new StockInputError()
                                {
                                    Type        = TypeConverter.ConvertEnum <StockInputErrorType>(pack.Error.Type, StockInputErrorType.Rejected),
                                    Description = TextConverter.UnescapeInvalidXmlChars(pack.Error.Text)
                                };

                                message.PackErrors.Add(msgPack, msgError);
                            }
                        }
                    }
                }
            }

            return(message);
        }
        /// <summary>
        /// Translates this object instance into a Mosaic message.
        /// </summary>
        /// <param name="converterStream">The converter stream instance which request the message conversion.</param>
        /// <returns>
        /// The Mosaic message representation of this object.
        /// </returns>
        public override MosaicMessage ToMosaicMessage(IConverterStream converterStream)
        {
            var message  = (Interfaces.Messages.Stock.StockInfoMessage)base.ToMosaicMessage(converterStream);
            int packIter = 0;

            if (this.Article != null)
            {
                for (int i = 0; i < this.Article.Length; ++i)
                {
                    var article = this.Article[i];

                    message.Articles[i].MaxSubItemQuantity = TypeConverter.ConvertInt(article.MaxSubItemQuantity);

                    foreach (var pack in article.Pack)
                    {
                        message.Packs[packIter].StockInDate     = TypeConverter.ConvertDate(pack.StockInDate);
                        message.Packs[packIter].ScanCode        = TextConverter.UnescapeInvalidXmlChars(pack.ScanCode);
                        message.Packs[packIter].DeliveryNumber  = TextConverter.UnescapeInvalidXmlChars(pack.DeliveryNumber);
                        message.Packs[packIter].Width           = TypeConverter.ConvertInt(pack.Width);
                        message.Packs[packIter].Height          = TypeConverter.ConvertInt(pack.Height);
                        message.Packs[packIter].Depth           = TypeConverter.ConvertInt(pack.Depth);
                        message.Packs[packIter].Shape           = TypeConverter.ConvertEnum <PackShape>(pack.Shape, PackShape.Cuboid);
                        message.Packs[packIter].IsInFridge      = TypeConverter.ConvertBool(pack.IsInFridge);
                        message.Packs[packIter].SubItemQuantity = TypeConverter.ConvertInt(pack.SubItemQuantity);
                        message.Packs[packIter].StockLocationID = string.IsNullOrEmpty(pack.StockLocationId) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(pack.StockLocationId);
                        message.Packs[packIter].MachineLocation = string.IsNullOrEmpty(pack.MachineLocation) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(pack.MachineLocation);
                        message.Packs[packIter].IsBlocked       = (TypeConverter.ConvertEnum <PackState>(pack.State, PackState.Available) != PackState.Available);
                        packIter++;
                    }
                }
            }

            return(message);
        }
 public CounterAndWordConcatenating(TextConverter textConverter)
 {
     _textConverter = textConverter;
 }
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write("<?php\r\n\r\nnamespace App\\Http\\ApiControllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse " +
                       "App\\Http\\Requests;\r\nuse App\\Http\\Controllers\\Controller;\r\nuse App\\ViewModels\\;\r\n" +
                       "\r\n/**\r\n* ");

            #line 12 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_apiInfo.Description));

            #line default
            #line hidden
            this.Write("\r\n*/\r\nclass ");

            #line 14 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(_apiInfo.Id));

            #line default
            #line hidden
            this.Write(" extends Controller\r\n{\r\n");

            #line 16 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"

            foreach (var action in _apiInfo.Actions)
            {
            #line default
            #line hidden
                this.Write("     /**\r\n     * Description of api action\r\n");

            #line 22 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"

                foreach (var parameter in action.Parameters)
                {
            #line default
            #line hidden
                    this.Write("     * @param  ");

            #line 26 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(PHPType(parameter.Type)));

            #line default
            #line hidden
                    this.Write("  $");

            #line 26 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(parameter.Id)));

            #line default
            #line hidden
                    this.Write("\r\n");

            #line 27 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                }


            #line default
            #line hidden
                this.Write("     * @return Response\r\n     */\r\n");

            #line 32 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"

                if (action.Parameters != null && action.Parameters.Count > 0)
                {
            #line default
            #line hidden
                    this.Write("     public function ");

            #line 36 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id)));

            #line default
            #line hidden
                    this.Write("\r\n     (\r\n");

            #line 38 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"

                    int count   = action.Parameters.Count - 1;
                    int counter = 0;
                    foreach (var parameter in action.Parameters)
                    {
                        if (counter == count)
                        {
            #line default
            #line hidden
                            this.Write("        $");

            #line 46 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(parameter.Id)));

            #line default
            #line hidden
                            this.Write("\r\n");

            #line 47 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                        }
                        else
                        {
            #line default
            #line hidden
                            this.Write("\t\t$");

            #line 50 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(parameter.Id)));

            #line default
            #line hidden
                            this.Write(",\r\n");

            #line 51 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                        }
                        counter++;
                    }


            #line default
            #line hidden
                    this.Write("     )\r\n");

            #line 57 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                }
                else
                {
            #line default
            #line hidden
                    this.Write("     public function ");

            #line 60 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(action.Id)));

            #line default
            #line hidden
                    this.Write("()\r\n");

            #line 61 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                }


            #line default
            #line hidden

            #line 64 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"

                if (action.ReturnType != null)
                {
            #line default
            #line hidden
                    this.Write("    : ");

            #line 68 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(action.ReturnType.Id));

            #line default
            #line hidden
                    this.Write("\r\n");

            #line 69 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                }
                else
                {
            #line default
            #line hidden

            #line 74 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
                }


            #line default
            #line hidden
                this.Write("    {\r\n\r\n    }\r\n\r\n");

            #line 81 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Controllers\ApiControllers\Templates\ApiControllersTemplate.tt"
            }


            #line default
            #line hidden
            this.Write("}");
            return(this.GenerationEnvironment.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="StockDeliverySetRequestSmallSet"/> class.
        /// </summary>
        /// <param name="message">The message to use for initialization.</param>
        public StockDeliverySetRequestSmallSet(MosaicMessage message)
        {
            var request = (Interfaces.Messages.Stock.StockDeliverySetRequest)message;

            this.Id          = request.ID;
            this.Source      = request.Source;
            this.Destination = request.Destination;

            if (request.StockDeliveries.Count == 0)
            {
                return;
            }

            this.StockDelivery = new StockDelivery[request.StockDeliveries.Count];

            for (int i = 0; i < this.StockDelivery.Length; ++i)
            {
                var stockDelivery = request.StockDeliveries[i];

                this.StockDelivery[i] = new StockDelivery()
                {
                    DeliveryNumber = stockDelivery.DeliveryNumber,
                    Article        = new List <Article>()
                };

                foreach (var article in stockDelivery.Items)
                {
                    this.StockDelivery[i].Article.Add(new Article()
                    {
                        Id            = TextConverter.EscapeInvalidXmlChars(article.ArticleCode),
                        Name          = TextConverter.EscapeInvalidXmlChars(article.Name),
                        DosageForm    = TextConverter.EscapeInvalidXmlChars(article.DosageForm),
                        PackagingUnit = TextConverter.EscapeInvalidXmlChars(article.PackagingUnit),
                        BatchNumber   = string.IsNullOrEmpty(article.BatchNumber) ? null : TextConverter.EscapeInvalidXmlChars(article.BatchNumber),
                        ExternalId    = string.IsNullOrEmpty(article.ExternalID) ? null : TextConverter.EscapeInvalidXmlChars(article.ExternalID),
                        ExpiryDate    = TypeConverter.ConvertDateNull(article.ExpiryDate),
                        Quantity      = (article.RequestedQuantity != 0) ? null : article.RequestedQuantity.ToString()
                    });
                }
            }
        }
예제 #19
0
        /// <summary>
        /// Translates this object instance into a Mosaic message.
        /// </summary>
        /// <param name="converterStream">The converter stream instance which request the message conversion.</param>
        /// <returns>
        /// The Mosaic message representation of this object.
        /// </returns>
        public MosaicMessage ToMosaicMessage(IConverterStream converterStream)
        {
            StockInputRequest request = new StockInputRequest(converterStream);

            request.ID                  = this.Id;
            request.Source              = this.Source;
            request.Destination         = this.Destination;
            request.IsDeliveryInput     = TypeConverter.ConvertBool(this.IsNewDelivery);
            request.SetPickingIndicator = TypeConverter.ConvertBool(this.SetPickingIndicator);

            if ((this.Article == null) || (this.Article.Pack == null))
            {
                return(request);
            }

            foreach (var pack in this.Article.Pack)
            {
                request.Packs.Add(new Interfaces.Types.Packs.RobotPack()
                {
                    ScanCode        = TextConverter.UnescapeInvalidXmlChars(pack.ScanCode),
                    BatchNumber     = TextConverter.UnescapeInvalidXmlChars(pack.BatchNumber),
                    ExternalID      = TextConverter.UnescapeInvalidXmlChars(pack.ExternalId),
                    DeliveryNumber  = TextConverter.UnescapeInvalidXmlChars(pack.DeliveryNumber),
                    ExpiryDate      = TypeConverter.ConvertDate(pack.ExpiryDate),
                    SubItemQuantity = TypeConverter.ConvertInt(pack.SubItemQuantity),
                    StockLocationID = string.IsNullOrEmpty(pack.StockLocationId) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(pack.StockLocationId),
                    MachineLocation = string.IsNullOrEmpty(pack.MachineLocation) ? string.Empty : TextConverter.UnescapeInvalidXmlChars(pack.MachineLocation)
                });
            }

            return(request);
        }
예제 #20
0
 public void ParseRTF(TextConverter txtConverter)
 {
     txtConverter.ConvertCharacter();
     txtConverter.ConvertFontChange();
     txtConverter.ConvertParagraph();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="OutputMessage"/> class.
        /// </summary>
        /// <param name="message">The message to use for initialization.</param>
        public OutputMessage(MosaicMessage message)
            : base(message)
        {
            StockOutputMessage msg = (StockOutputMessage)message;

            this.Details.OutputPoint = msg.Order.OutputPoint != 0 ? msg.Order.OutputPoint.ToString() : null;

            var boxNumberList = new List <string>();

            if (this.Article != null)
            {
                Dictionary <string, Types.Pack> _packMap = new Dictionary <string, Types.Pack>();

                foreach (var article in this.Article)
                {
                    if (article.Pack == null)
                    {
                        continue;
                    }

                    foreach (var pack in article.Pack)
                    {
                        _packMap.Add(pack.Id, pack);
                    }
                }

                foreach (var orderItem in msg.Order.Items)
                {
                    foreach (var pack in orderItem.Packs)
                    {
                        if (_packMap.ContainsKey(((ulong)pack.ID).ToString()) == false)
                        {
                            continue;
                        }

                        var msgPack = _packMap[((ulong)pack.ID).ToString()];

                        msgPack.StockInDate       = TypeConverter.ConvertDateNull(pack.StockInDate);
                        msgPack.ScanCode          = TextConverter.EscapeInvalidXmlChars(pack.ScanCode);
                        msgPack.DeliveryNumber    = TextConverter.EscapeInvalidXmlChars(pack.DeliveryNumber);
                        msgPack.Depth             = pack.Depth.ToString();
                        msgPack.Width             = pack.Width.ToString();
                        msgPack.Height            = pack.Height.ToString();
                        msgPack.Shape             = pack.Shape.ToString();
                        msgPack.IsInFridge        = pack.IsInFridge.ToString();
                        msgPack.BoxNumber         = pack.BoxNumber;
                        msgPack.SubItemQuantity   = pack.SubItemQuantity.ToString();
                        msgPack.LabelStatus       = pack.LabelState.ToString();
                        msgPack.OutputDestination = pack.OutputNumber.ToString();
                        msgPack.OutputPoint       = pack.OutputPoint.ToString();
                        msgPack.StockLocationId   = TextConverter.EscapeInvalidXmlChars(pack.StockLocationID);
                        msgPack.MachineLocation   = TextConverter.EscapeInvalidXmlChars(pack.MachineLocation);

                        if ((string.IsNullOrEmpty(pack.BoxNumber) == false) &&
                            (boxNumberList.Contains(pack.BoxNumber) == false))
                        {
                            boxNumberList.Add(pack.BoxNumber);
                        }
                    }
                }
            }
            else if (string.IsNullOrEmpty(msg.Order.BoxNumber) == false)
            {
                if (msg.Order.BoxNumber.EndsWith(".."))
                {
                    boxNumberList.Add(msg.Order.BoxNumber.Substring(0, msg.Order.BoxNumber.Length - 2));
                }
                else
                {
                    boxNumberList.Add(msg.Order.BoxNumber);
                }
            }

            if (boxNumberList.Count > 0)
            {
                this.Box = new Box[boxNumberList.Count];

                for (int i = 0; i < this.Box.Length; ++i)
                {
                    this.Box[i] = new Box()
                    {
                        Number = boxNumberList[i]
                    };
                }
            }
        }
        public override Stream OpenReadStream(long start, long end)
        {
            base.ThrowIfDisposed();
            BodyFormatConversionStorage.BodyFormatConversion conversion = BodyFormatConversionStorage.GetConversion(this.originalFormat, this.targetFormat);
            TextConverter converter     = null;
            Encoding      inputEncoding = null;

            if (this.originalCharset != null)
            {
                inputEncoding = this.originalCharset.GetEncoding();
            }
            Encoding outputEncoding = null;

            if (this.targetCharset != null)
            {
                outputEncoding = this.targetCharset.GetEncoding();
            }
            Stream stream = this.originalStorage.OpenReadStream(this.originalStart, this.originalEnd);

            switch (conversion)
            {
            case BodyFormatConversionStorage.BodyFormatConversion.HtmlToText:
                converter = new HtmlToText
                {
                    InputEncoding  = inputEncoding,
                    OutputEncoding = outputEncoding
                };
                break;

            case BodyFormatConversionStorage.BodyFormatConversion.HtmlToEnriched:
                converter = new HtmlToEnriched
                {
                    InputEncoding  = inputEncoding,
                    OutputEncoding = outputEncoding
                };
                break;

            case BodyFormatConversionStorage.BodyFormatConversion.RtfCompressedToText:
                stream    = new ConverterStream(stream, new RtfCompressedToRtf(), ConverterStreamAccess.Read);
                converter = new RtfToText
                {
                    OutputEncoding = outputEncoding
                };
                break;

            case BodyFormatConversionStorage.BodyFormatConversion.TextToText:
                converter = new TextToText
                {
                    InputEncoding  = inputEncoding,
                    OutputEncoding = outputEncoding
                };
                break;

            case BodyFormatConversionStorage.BodyFormatConversion.HtmlToHtml:
                converter = new HtmlToHtml
                {
                    InputEncoding  = inputEncoding,
                    OutputEncoding = outputEncoding
                };
                break;

            case BodyFormatConversionStorage.BodyFormatConversion.EnrichedToText:
                converter = new EnrichedToText
                {
                    InputEncoding  = inputEncoding,
                    OutputEncoding = outputEncoding
                };
                break;
            }
            return(new ConverterStream(stream, converter, ConverterStreamAccess.Read));
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="OutputMessageSmallSet"/> class.
        /// </summary>
        /// <param name="message">The message to use for initialization.</param>
        public OutputMessageSmallSet(MosaicMessage message)
        {
            StockOutputMessage msg = (StockOutputMessage)message;

            this.Id          = msg.ID;
            this.Source      = msg.Source;
            this.Destination = msg.Destination;

            this.Details                   = new Details();
            this.Details.Priority          = TypeConverter.ConvertOutputPriority(msg.Order.Priority);
            this.Details.OutputDestination = msg.Order.OutputNumber.ToString();

            switch (msg.Order.State)
            {
            case StockOutputOrderState.Completed:
            case StockOutputOrderState.Incomplete:
            case StockOutputOrderState.Aborted:
                this.Details.Status = msg.Order.State.ToString();
                break;

            default:
                this.Details.Status = StockOutputOrderState.Incomplete.ToString();
                break;
            }

            if (msg.Order.Items.Count > 0)
            {
                Dictionary <string, Article> _articleMap = new Dictionary <string, Article>();

                foreach (var orderItem in msg.Order.Items)
                {
                    foreach (var pack in orderItem.Packs)
                    {
                        if (_articleMap.ContainsKey(pack.RobotArticleCode) == false)
                        {
                            _articleMap.Add(pack.RobotArticleCode,
                                            new Article()
                            {
                                Id   = TextConverter.EscapeInvalidXmlChars(pack.RobotArticleCode),
                                Pack = new List <Types.Pack>()
                            });
                        }

                        _articleMap[pack.RobotArticleCode].Pack.Add(new Types.Pack()
                        {
                            Id          = ((ulong)pack.ID).ToString(),
                            BatchNumber = TextConverter.EscapeInvalidXmlChars(pack.BatchNumber),
                            ExternalId  = TextConverter.EscapeInvalidXmlChars(pack.ExternalID),
                            ExpiryDate  = TypeConverter.ConvertDateNull(pack.ExpiryDate)
                        });
                    }
                }

                if (_articleMap.Count > 0)
                {
                    int counter = 0;
                    this.Article = new Article[_articleMap.Count];

                    foreach (var articleKey in _articleMap.Keys)
                    {
                        this.Article[counter++] = _articleMap[articleKey];
                    }
                }
            }
        }
예제 #24
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write("\r\n");

            #line 2 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"

            var model = (SmartAppInfo)Model;


            #line default
            #line hidden

            #line 5 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"

            if (model != null && model.Concerns != null && model.Concerns.Count > 0)
            {
            #line default
            #line hidden
                this.Write("export default {\r\n");

            #line 10 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"

                List <string> addModels = new List <string>();
                foreach (ConcernInfo concern in model.Concerns)
                {
                    foreach (LayoutInfo layout in concern.Layouts)
                    {
                        if (layout != null && layout.DataModel != null && !addModels.Contains(layout.DataModel.Id))
                        {
                            addModels.Add(layout.DataModel.Id);


            #line default
            #line hidden
                            this.Write("    ");

            #line 20 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(layout.DataModel.Id)));

            #line default
            #line hidden

            #line 20 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"
                            if (layout.DataModel.References != null && layout.DataModel.References.Count > 0 && layout.DataModel.References[0].IsCollection)
                            {
            #line default
            #line hidden
                                this.Write(": []");

            #line 20 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"
                            }
                            else
                            {
            #line default
            #line hidden
                                this.Write(": {}");

            #line 20 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"
                            }

            #line default
            #line hidden
                            this.Write(",\r\n");

            #line 21 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"
                        }
                    }
                }


            #line default
            #line hidden
                this.Write("\r\n    //If layout does not define any datamodel then return empty object as initi" +
                           "al state\r\n    emptyModel: {}\r\n}\r\n");

            #line 30 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\InitialStateTemplate_old.tt"
            }


            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="InitiateInputResponse"/> class.
        /// </summary>
        /// <param name="message">The message to use for initialization.</param>
        public InitiateInputResponse(MosaicMessage message)
        {
            var response = (InitiateStockInputResponse)message;

            this.Id                  = response.ID;
            this.Destination         = response.Destination;
            this.Source              = response.Source;
            this.IsNewDelivery       = response.IsDeliveryInput.ToString();
            this.SetPickingIndicator = response.SetPickingIndicator.ToString();

            this.Details = new Types.Details()
            {
                InputSource = response.InputSource.ToString(),
                InputPoint  = response.InputPoint.ToString(),
                Status      = (response.Status == InitiateStockInputState.InProgress) ?
                              InitiateStockInputState.Accepted.ToString() : response.Status.ToString()
            };

            if (response.Articles.Count == 0)
            {
                return;
            }

            int packIndex = 0;

            this.Article = new Article[response.Articles.Count];

            for (int i = 0; i < this.Article.Length; ++i)
            {
                if (string.IsNullOrEmpty(response.Articles[i].Code))
                {
                    this.Article[i] = new Article();
                }
                else
                {
                    this.Article[i] = new Article()
                    {
                        Id                 = TextConverter.EscapeInvalidXmlChars(response.Articles[i].Code),
                        Name               = TextConverter.EscapeInvalidXmlChars(response.Articles[i].Name),
                        PackagingUnit      = TextConverter.EscapeInvalidXmlChars(response.Articles[i].PackagingUnit),
                        DosageForm         = TextConverter.EscapeInvalidXmlChars(response.Articles[i].DosageForm),
                        MaxSubItemQuantity = response.Articles[i].MaxSubItemQuantity.ToString()
                    };

                    if ((string.IsNullOrEmpty(this.Article[i].Id)) &&
                        (string.IsNullOrEmpty(this.Article[i].Name)) &&
                        (string.IsNullOrEmpty(this.Article[i].PackagingUnit)) &&
                        (string.IsNullOrEmpty(this.Article[i].DosageForm)) &&
                        (response.Articles[i].MaxSubItemQuantity == 0))
                    {
                        this.Article[i].Id                 = null;
                        this.Article[i].Name               = null;
                        this.Article[i].PackagingUnit      = null;
                        this.Article[i].DosageForm         = null;
                        this.Article[i].MaxSubItemQuantity = null;
                    }
                }

                foreach (var pack in response.Packs)
                {
                    if (pack.RobotArticleID == response.Articles[i].ID)
                    {
                        if (this.Article[i].Pack == null)
                        {
                            this.Article[i].Pack = new List <Types.Pack>();
                        }

                        this.Article[i].Pack.Add(new Types.Pack()
                        {
                            Index           = packIndex.ToString(),
                            ScanCode        = TextConverter.EscapeInvalidXmlChars(pack.ScanCode),
                            DeliveryNumber  = TextConverter.EscapeInvalidXmlChars(pack.DeliveryNumber),
                            BatchNumber     = TextConverter.EscapeInvalidXmlChars(pack.BatchNumber),
                            ExternalId      = TextConverter.EscapeInvalidXmlChars(pack.ExternalID),
                            ExpiryDate      = TypeConverter.ConvertDateNull(pack.ExpiryDate),
                            SubItemQuantity = pack.SubItemQuantity.ToString(),
                            Depth           = pack.Depth.ToString(),
                            Width           = pack.Width.ToString(),
                            Height          = pack.Height.ToString(),
                            Shape           = pack.Shape.ToString(),
                            StockLocationId = TextConverter.EscapeInvalidXmlChars(pack.StockLocationID)
                        });

                        packIndex++;
                    }
                }
            }
        }
예제 #26
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write(@"/*
 * You should add your licence here, here is an example :
 *
 * SonarQube, open source software quality management tool.
 * Copyright (C) 2008-2013 SonarSource
 * mailto:contact AT sonarsource DOT com
 *
 * SonarQube is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * SonarQube is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
");

            #line 29 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

            SmartAppInfo smartApp = (SmartAppInfo)Model;
            if (smartApp != null && smartApp.Id != null)
            {
            #line default
            #line hidden
                this.Write("import { Component, ViewChild } from \'@angular/core\';\r\nimport { Platform, NavCont" +
                           "roller");

            #line 35 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                if (_isMenu)
                {
            #line default
            #line hidden
                    this.Write(", Events ");

            #line 35 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }

            #line default
            #line hidden
                this.Write(" } from \'ionic-angular\';\r\nimport { StatusBar } from \'@ionic-native/status-bar\';\r\n" +
                           "import { SplashScreen } from \'@ionic-native/splash-screen\';\r\nimport { Title } fr" +
                           "om \'@angular/platform-browser\';\r\n\r\n");

            #line 40 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                if (smartApp.Concerns.AsEnumerable() != null && _rootLayout != null && _rootLayout.Id != null && _rootConcern != null && _rootConcern.Id != null)
                {
                    string concern                = TextConverter.PascalCase(_rootConcern.Id);
                    string layout                 = TextConverter.PascalCase(_rootLayout.Id);
                    string layoutComponent        = concern + layout;
                    string layoutComponentToLower = TextConverter.CamelCase(concern) + "-" + TextConverter.CamelCase(layout);


            #line default
            #line hidden
                    this.Write("import { ");

            #line 48 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(layoutComponent));

            #line default
            #line hidden
                    this.Write(" } from \'../pages/");

            #line 48 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(concern)));

            #line default
            #line hidden
                    this.Write("/");

            #line 48 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(layout)));

            #line default
            #line hidden
                    this.Write("/");

            #line 48 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(layoutComponentToLower));

            #line default
            #line hidden
                    this.Write("\';\r\n");

            #line 49 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }


            #line default
            #line hidden
                this.Write("\r\n");

            #line 53 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                if (smartApp.Languages.AsEnumerable() != null && smartApp.Languages.AsEnumerable().Count() > 0)
                {
            #line default
            #line hidden
                    this.Write("import { TranslateService } from \'@ngx-translate/core\';\r\n");

            #line 58 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }


            #line default
            #line hidden
                this.Write("/**\r\n * class: ");

            #line 62 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(smartApp.Id)));

            #line default
            #line hidden
                this.Write(".\r\n");

            #line 63 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                if (smartApp.Description != null)
                {
            #line default
            #line hidden
                    this.Write(" * ");

            #line 67 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(smartApp.Description));

            #line default
            #line hidden
                    this.Write(".\r\n * This is the main component of the application.\r\n * This component is genera" +
                               "ted from multiple domains.\r\n");

            #line 70 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }
                else
                {
            #line default
            #line hidden
                    this.Write(" * This is the main component of the application.\r\n * This component is generated" +
                               " from multiple domains.\r\n");

            #line 77 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }


            #line default
            #line hidden
                this.Write(" */\r\n@Component({\r\n  templateUrl: \'app.html\'\r\n})\r\nexport class ");

            #line 84 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(smartApp.Id)));

            #line default
            #line hidden
                this.Write(" {\r\n");

            #line 85 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                if (smartApp.Concerns.AsEnumerable() != null)
                {
            #line default
            #line hidden
                    this.Write("  @ViewChild(\'nav\') public _nav: NavController;\r\n");

            #line 90 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                    if (_isMenu)
                    {
            #line default
            #line hidden
                        this.Write("  public _menu;\r\n");

            #line 95 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    }
                }


            #line default
            #line hidden
                this.Write("  constructor(\r\n");

            #line 100 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                if (smartApp.Languages.AsEnumerable() != null && smartApp.Languages.AsEnumerable().Count() > 0)
                {
            #line default
            #line hidden
                    this.Write("    public _translateService: TranslateService,\r\n");

            #line 105 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }


            #line default
            #line hidden

            #line 108 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                if (_isMenu)
                {
            #line default
            #line hidden
                    this.Write("    public _events: Events,\r\n");

            #line 113 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }


            #line default
            #line hidden
                this.Write(@"    public _platform: Platform,
    public _statusBar: StatusBar,
    public _splashScreen: SplashScreen,
    public _title: Title
   ) {
    this._platform.ready().then(() => {
      this._statusBar.styleDefault();
      this._splashScreen.hide();
");

            #line 124 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                if (smartApp.Concerns.AsEnumerable() != null && _rootLayout != null && _rootLayout.Id != null && _rootConcern != null && _rootConcern.Id != null)
                {
                    string concern         = TextConverter.PascalCase(_rootConcern.Id);
                    string layout          = TextConverter.PascalCase(_rootLayout.Id);
                    string layoutComponent = concern + layout;


            #line default
            #line hidden
                    this.Write("      this._nav.setRoot(");

            #line 131 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(layoutComponent));

            #line default
            #line hidden
                    this.Write(");\r\n");

            #line 132 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                    if (_isMenu)
                    {
            #line default
            #line hidden
                        this.Write("      this._events.subscribe(\'menu\', (menu => this._menu = menu));\r\n");

            #line 137 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    }
                }

                if (smartApp.Languages.AsEnumerable() != null && smartApp.Languages.AsEnumerable().Count() > 0)
                {
            #line default
            #line hidden
                    this.Write("      this._translateService.setDefaultLang(\'");

            #line 144 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(smartApp.Languages[0].Id)));

            #line default
            #line hidden
                    this.Write("\');\r\n      this._translateService.use(\'");

            #line 145 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(smartApp.Languages[0].Id)));

            #line default
            #line hidden
                    this.Write("\');\r\n      this._translateService.get(\'applicationTitle\').subscribe(name => {\r\n  " +
                               "      this._title.setTitle(name);\r\n      });\r\n");

            #line 149 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }


            #line default
            #line hidden
                this.Write("    });\r\n  }\r\n\r\n");

            #line 155 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"

                if (smartApp.Concerns.AsEnumerable() != null)
                {
            #line default
            #line hidden
                    this.Write("  /**\r\n   * method: selected.\r\n   * That method enables to change page\r\n   * thro" +
                               "ugh the global menu.\r\n   * @param route `string`.\r\n   */\r\n  selected(route: stri" +
                               "ng) {\r\n    this._nav.setRoot(route);\r\n  }\r\n");

            #line 168 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
                }


            #line default
            #line hidden
                this.Write("}\r\n");

            #line 172 "C:\Users\PC\Documents\Gits\Ionic-framework\GeneratorProject.IonicFrameworkCodeSamples\GeneratorProject\Platforms\Frontend\Ionic\Common\Templates\src\app\AppComponent.tt"
            }


            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write("\r\nimport { createStackNavigator } from \'react-navigation\';\r\n\r\n");

            #line 4 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"

            if (_concernInfo != null)
            {
                string concernId = TextConverter.PascalCase(_concernInfo.Id);
                if (_concernInfo.Layouts != null && _concernInfo.Layouts.Count > 0)
                {
                    foreach (var layout in _concernInfo.Layouts)
                    {
                        string containerName = string.Format("{0}Container", TextConverter.PascalCase(layout.Id));
                        //string navName = string.Format("{0}{1}", concernId, TextConverter.PascalCase(layout.Id));


            #line default
            #line hidden
                        this.Write("import ");

            #line 15 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(containerName));

            #line default
            #line hidden
                        this.Write(" from \'../Containers/");

            #line 15 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(_concernInfo.Id));

            #line default
            #line hidden
                        this.Write("/");

            #line 15 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(containerName));

            #line default
            #line hidden
                        this.Write("\';\r\n");

            #line 16 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
                    }
                }


            #line default
            #line hidden
                this.Write("\r\nexport default ");

            #line 21 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(_concernInfo.Id));

            #line default
            #line hidden
                this.Write("StackNavigator = createStackNavigator({\r\n");

            #line 22 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"

                if (_concernInfo.Layouts != null && _concernInfo.Layouts.Count > 0)
                {
                    foreach (var layout in _concernInfo.Layouts)
                    {
                        string containerName = string.Format("{0}Container", TextConverter.PascalCase(layout.Id));
                        string navName       = string.Format("{0}{1}", concernId, TextConverter.PascalCase(layout.Id));


            #line default
            #line hidden
                        this.Write("        ");

            #line 30 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(navName));

            #line default
            #line hidden
                        this.Write(": ");

            #line 30 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(containerName));

            #line default
            #line hidden
                        this.Write(",\r\n");

            #line 31 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
                    }
                }


            #line default
            #line hidden
                this.Write("},\r\n{\r\n    navigationOptions: {\r\n        headerStyle: {\r\n            backgroundCo" +
                           "lor: \'#f4511e\',\r\n        },\r\n        headerTintColor: \'#fff\',\r\n        headerTit" +
                           "leStyle: {\r\n            fontWeight: \'bold\',\r\n        }\r\n    }\r\n});\r\n");

            #line 47 "D:\01 Working\01 RedFabriq\01 working\new_generators\React-Native\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Navigation\Templates\NavigationTemplate.tt"
            }


            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
        private void TransformWebControllers(SmartAppInfo smartApp)
        {
            if (smartApp != null && smartApp.Api != null)
            {
                string controllerSuffix = GetControllerSuffix();
                string modelSuffix      = GetModelSuffix();

                foreach (var entity in smartApp.DataModel.Entities)
                {
                    if (!entity.IsAbstract)
                    {
                        WebControllersTemplate template = new WebControllersTemplate(entity, controllerSuffix, modelSuffix);
                        _writingService.WriteFile(Path.Combine(_context.BasePath, template.OutputPath, (TextConverter.PascalCase(entity.Id) + controllerSuffix + ".php")), template.TransformText());
                    }
                }
            }
        }
예제 #29
0
        /// <summary>
        /// Retrieve the specific menu for each concern.
        /// </summary>
        /// <param name="concern">A concern.</param>
        public Dictionary <string, string> getMenu(ConcernInfo concern)
        {
            Dictionary <string, string> menu = new Dictionary <string, string>();

            if (concern != null && concern.Id != null && concern.Layouts.AsEnumerable() != null)
            {
                foreach (LayoutInfo layout in concern.Layouts.AsEnumerable())
                {
                    if (layout.IsVisibleInMenu && layout.Id != null && layout.Title != null && !menu.ContainsKey(TextConverter.CamelCase(concern.Id) + "-" + TextConverter.CamelCase(layout.Id)))
                    {
                        menu.Add(TextConverter.CamelCase(concern.Id) + "-" + TextConverter.CamelCase(layout.Id), layout.Title);
                    }
                }
            }
            return(menu);
        }
예제 #30
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            #line 2 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"

            var _entityInfo = (EntityInfo)Model;


            #line default
            #line hidden
            this.Write("@extends(\'layouts.master\')\r\n\r\n@section(\'content\')\r\n\r\n<div class=\"container-fluid " +
                       "form-horizontal\">\r\n    <div class=\"col-lg-12\">\r\n        <div class=\"card\">\r\n    " +
                       "        <div class=\"card-title\">\r\n\r\n        <h4>");

            #line 14 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(Helper.WordSeperator(TextConverter.PascalCase(_entityInfo.Id))));

            #line default
            #line hidden
            this.Write(" - Delete Form</h4>\r\n         </div>\r\n            <div class=\"card-body\">\r\n      " +
                       "        <h3>Are you sure you want to delete this?</h3>\r\n");

            #line 18 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"

            foreach (var property in _entityInfo.AllProperties())
            {
            #line default
            #line hidden
                this.Write("                <div class=\"row\">\r\n                    <label for=\"");

            #line 23 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id)));

            #line default
            #line hidden
                this.Write("\" class = \"col-sm-2 col-form-label\">");

            #line 23 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(Helper.WordSeperator(TextConverter.PascalCase(property.Id))));

            #line default
            #line hidden
                this.Write("</label>\r\n                    <div class=\"col-sm-10 label-detail\">\r\n             " +
                           "           {{$item->");

            #line 25 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(property.Id)));

            #line default
            #line hidden
                this.Write("}}\r\n                    </div>\r\n                 </div>\r\n");

            #line 28 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"
            }


            #line default
            #line hidden
            this.Write("               <div class=\"row form-action\">\r\n                  <div class=\"col-s" +
                       "m-10\">\r\n                   {!! Form::open([\'route\' => [\'");

            #line 33 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.CamelCase(_entityInfo.Id)));

            #line default
            #line hidden
            this.Write(".destroy\', $item->");

            #line 33 "D:\Working\Mobioos\Generators new changes\PHP-LARAVEL\PHPGeneratorLaravel\GeneratorProject\Platforms\Backend\PHP\Views\Templates\DeleteTemplate.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(GetPrimaryKey()));

            #line default
            #line hidden
            this.Write(@"], 'class' => 'form','method' => 'DELETE']) !!}
                  
                   {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}

                   {!! Form::close() !!}
                </div>
                </div>
            </div>
        </div>
    </div>
</div>

@endsection
");
            return(this.GenerationEnvironment.ToString());
        }
예제 #31
0
파일: New_Act.cs 프로젝트: KnutHjelvik/demo
 protected override void Act()
 {
     Sut = new TextConverter();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="StockInfoRequest"/> class.
        /// </summary>
        /// <param name="message">The message to use for initialization.</param>
        public StockInfoRequest(MosaicMessage message)
        {
            var request = (Interfaces.Messages.Stock.StockInfoRequest)message;

            this.Id                    = request.ID;
            this.Source                = request.Source;
            this.Destination           = request.Destination;
            this.IncludePacks          = request.IncludePacks.ToString();
            this.IncludeArticleDetails = request.IncludeArticleDetails.ToString();

            if (request.Criteria.Count > 0)
            {
                this.Criteria = new Criteria[request.Criteria.Count];

                for (int i = 0; i < this.Criteria.Length; ++i)
                {
                    this.Criteria[i] = new Criteria()
                    {
                        ArticleId       = TextConverter.EscapeInvalidXmlChars(request.Criteria[i].RobotArticleCode),
                        ExternalId      = string.IsNullOrEmpty(request.Criteria[i].ExternalID) ? null : TextConverter.EscapeInvalidXmlChars(request.Criteria[i].ExternalID),
                        BatchNumber     = string.IsNullOrEmpty(request.Criteria[i].BatchNumber) ? null : TextConverter.EscapeInvalidXmlChars(request.Criteria[i].BatchNumber),
                        StockLocationId = string.IsNullOrEmpty(request.Criteria[i].StockLocationID) ? null : TextConverter.EscapeInvalidXmlChars(request.Criteria[i].StockLocationID),
                        MachineLocation = string.IsNullOrEmpty(request.Criteria[i].MachineLocation) ? null : TextConverter.EscapeInvalidXmlChars(request.Criteria[i].MachineLocation)
                    };
                }
            }
        }
예제 #33
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public override string TransformText()
        {
            this.Write("\r\n");

            #line 2 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"

            var model = (SmartAppInfo)Model;


            #line default
            #line hidden
            this.Write("import { combineReducers } from \'redux\';\r\n\r\n");

            #line 7 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"

            if (model != null && model.Concerns != null && model.Concerns.Count > 0)
            {
                foreach (ConcernInfo concern in model.Concerns)
                {
                    foreach (LayoutInfo layout in concern.Layouts)
                    {
            #line default
            #line hidden
                        this.Write("import ");

            #line 15 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(concern.Id)));

            #line default
            #line hidden

            #line 15 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(layout.Id)));

            #line default
            #line hidden
                        this.Write(" from \'./");

            #line 15 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(concern.Id)));

            #line default
            #line hidden
                        this.Write("/");

            #line 15 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(layout.Id)));

            #line default
            #line hidden
                        this.Write("Reducer\';\r\n");

            #line 16 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
                    }
                }


            #line default
            #line hidden
                this.Write("\r\nconst RootReducer = combineReducers({\r\n");

            #line 22 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"

                foreach (ConcernInfo concern in model.Concerns)
                {
                    foreach (LayoutInfo layout in concern.Layouts)
                    {
            #line default
            #line hidden
                        this.Write("    ");

            #line 28 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(concern.Id)));

            #line default
            #line hidden

            #line 28 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(TextConverter.PascalCase(layout.Id)));

            #line default
            #line hidden
                        this.Write(",\r\n");

            #line 29 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
                    }
                }


            #line default
            #line hidden
                this.Write("});\r\n\r\nexport default RootReducer;\r\n");

            #line 36 "D:\Working\Mobioos\Generators new changes\React-Native\GeneratorProject.ReactNative\GeneratorProject\Platforms\Frontend\ReactNative\Reducers\Templates\CombineReducerTemplate.tt"
            }


            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
예제 #34
0
    public bool DisplayInventory(CombatController combatController, int page)
    {
        int totalPages = (int)Math.Round((nounsInInventory.Count / 3d), 0, MidpointRounding.AwayFromZero);

        if (totalPages == 0)
        {
            totalPages = 1;
        }

        if (page > totalPages || page < 1)
        {
            return(false);
        }

        List <string> optionsText = new List <string>();

        string textToDisplay = "Inventario Página " + page.ToString() + "/" + totalPages.ToString() + ": ";



        string newNounToDisplay;

        for (int i = totalPages * (page - 1); i < 3 * page; i++)
        {
            if (i >= nounsInInventory.Count)
            {
                break;
            }

            int display = i - (totalPages * (page - 1));

            newNounToDisplay = "\n[" + display + "] " + TextConverter.MakeFirstLetterUpper(nounsInInventory[i].objectName);


            textToDisplay += newNounToDisplay;
        }

        if (page == 1)
        {
            optionsText.Add("<color=#A9A9A9>[<] Anterior Página </color>");
        }
        else
        {
            optionsText.Add("[<] Anterior Página");
        }

        if (page == totalPages)
        {
            optionsText.Add("<color=#A9A9A9>[>] Siguiente Página </color>");
        }
        else
        {
            optionsText.Add("[>] Siguiente Página ");
        }

        optionsText.Add("[S] Salir del Inventario ");

        combatController.SetPlayerHabilities(textToDisplay);
        combatController.SetPlayerInventoryOptions(string.Join("\n", optionsText.ToArray()));
        return(true);
    }