示例#1
0
文件: TRow.cs 项目: uzbekdev1/nfx
        public static CheckoutRow MakeFake(GDID gdid)
        {
            var ch = new CheckoutRow()
            {
                ID          = gdid,
                Customer    = PersonRow.MakeFake(gdid),
                FileName    = "myface_" + gdid.ID.ToString(),
                Date        = DateTime.Now,
                StartOffset = gdid.ID * 20,
                G_Block     = gdid,

                Address1 = NFX.Parsing.NaturalTextGenerator.GenerateAddressLine(),
                Address2 = (gdid.ID % 7) == 0 ? NFX.Parsing.NaturalTextGenerator.GenerateAddressLine() : null
            };

            var chCnt = (int)(gdid.ID % 10);

            ch.Charges = new ChargeRow[chCnt];

            for (int i = 0; i < chCnt; i++)
            {
                ch.Charges[i] = ChargeRow.MakeFake(gdid);
            }

            return(ch);
        }
示例#2
0
        public static PurchaseRow MakeFake(GDID gdid)
        {
            var purch = new PurchaseRow()
            {
                ID          = gdid,
                Customer    = PersonRow.MakeFake(gdid),
                Date        = DateTime.Now,
                Amount      = new Amount("usd", gdid.ID % 1897),
                SalesPerson = (gdid.ID % 2) == 0 ? null : PersonRow.MakeFake(gdid),
                G_Product   = new GDID(0, gdid.ID + 157)
            };

            return(purch);
        }
示例#3
0
文件: TRow.cs 项目: uzbekdev1/nfx
        public static PersonRow MakeFake(GDID parentGdid)
        {
            var age = (int)(parentGdid.ID % 99);

            var tags = NFX.ExternalRandomGenerator.Instance.NextRandomInteger > 0 ? new string[NFX.ExternalRandomGenerator.Instance.NextScaledRandomInteger(1, 20)] : null;

            if (tags != null)
            {
                for (int i = 0; i < tags.Length; i++)
                {
                    tags[i] = ((char)('a' + i)) + "tag";
                }
            }

            var pers = new PersonRow()
            {
                ID          = parentGdid,
                Name        = NFX.Parsing.NaturalTextGenerator.GenerateFullName(true),
                Age         = age,
                DOB         = DateTime.Now.AddYears(-age),
                Sex         = (parentGdid.ID % 2) == 0 ? Sex.Male : Sex.Female,
                Income      = (parentGdid.ID % 79) * 1000,
                Debt        = (parentGdid.ID % 11) * 1000,
                Rating      = (parentGdid.ID % 2) == 0 ? (double?)null : 3.25,
                Notes       = parentGdid.ToString(),
                Voter       = (parentGdid.ID % 2) == 0 ? (bool?)null : true,
                MilitarySvc = (parentGdid.ID % 2) == 0 ? (bool?)null : false,
                Address1    = NFX.Parsing.NaturalTextGenerator.GenerateAddressLine(),
                Address2    = (parentGdid.ID % 7) == 0 ? NFX.Parsing.NaturalTextGenerator.GenerateAddressLine() : null,
                City        = NFX.Parsing.NaturalTextGenerator.GenerateCityName(),
                State       = "OH",
                Zip         = "44000" + (parentGdid.ID % 999),
                Phone1      = "(555) 222-3222",
                Phone2      = (parentGdid.ID % 3) == 0 ? "(555) 737-9789" : null,
                Email1      = NFX.Parsing.NaturalTextGenerator.GenerateEMail(),
                Email2      = (parentGdid.ID % 5) == 0 ? NFX.Parsing.NaturalTextGenerator.GenerateEMail() : null,
                URL         = (parentGdid.ID % 2) == 0 ? "https://ibm.com/products/" + parentGdid.ID : null,
                Tags        = tags
            };

            return(pers);
        }
示例#4
0
文件: TRow.cs 项目: itadapter/nfx
        public static PersonRow MakeFake(GDID parentGdid)
        {
            var age = (int)(parentGdid.ID % 99);

              var tags = NFX.ExternalRandomGenerator.Instance.NextRandomInteger > 0 ? new string[NFX.ExternalRandomGenerator.Instance.NextScaledRandomInteger(1, 20)] : null;

              if (tags != null)
            for (int i = 0; i < tags.Length; i++)
            {
              tags[i] = ((char)('a' + i)) + "tag";
            }

              var pers = new PersonRow()
              {
            ID = parentGdid,
            Name = NFX.Parsing.NaturalTextGenerator.GenerateFullName(true),
            Age = age,
            DOB = DateTime.Now.AddYears(-age),
            Sex = (parentGdid.ID % 2) == 0 ? Sex.Male : Sex.Female,
            Income = (parentGdid.ID % 79) * 1000,
            Debt = (parentGdid.ID % 11) * 1000,
            Rating = (parentGdid.ID % 2) == 0 ? (double?)null : 3.25,
            Notes = parentGdid.ToString(),
            Voter = (parentGdid.ID % 2) == 0 ? (bool?)null : true,
            MilitarySvc = (parentGdid.ID % 2) == 0 ? (bool?)null : false,
            Address1 = NFX.Parsing.NaturalTextGenerator.GenerateAddressLine(),
            Address2 = (parentGdid.ID % 7) == 0 ? NFX.Parsing.NaturalTextGenerator.GenerateAddressLine() : null,
            City = NFX.Parsing.NaturalTextGenerator.GenerateCityName(),
            State = "OH",
            Zip = "44000" + (parentGdid.ID % 999),
            Phone1 = "(555) 222-3222",
            Phone2 = (parentGdid.ID % 3) == 0 ? "(555) 737-9789" : null,
            Email1 = NFX.Parsing.NaturalTextGenerator.GenerateEMail(),
            Email2 = (parentGdid.ID % 5) == 0 ? NFX.Parsing.NaturalTextGenerator.GenerateEMail() : null,
            URL = (parentGdid.ID % 2) == 0 ? "https://ibm.com/products/" + parentGdid.ID : null,
            Tags = tags
              };

              return pers;
        }