/// <summary>
        /// This function will receive a Universe and a StarDefaultSettings object and create Stars from the data
        /// provided
        /// </summary>
        /// <param name="universe"></param>
        /// <param name="starDefaultSettings"></param>
        /// <param name="starData"></param>
        /// <param name="nameGeneration"></param>
        /// <returns>
        /// A newly modified Universe
        /// </returns>
        public Universe AddStars(Universe universe, StarDefaultSettings starDefaultSettings, StarData starData,
                                 NameGeneration nameGeneration)
        {
            // Check if the Stars have been initialized prior
            universe.Stars ??= new List <Star>();

            // Set the number of stars to create. The default is 1d10+20
            var starLen   = starData.Stars.Count;
            var starCount = starDefaultSettings.StarCount < 0
                ? Rand.Next(0, 10) + 20
                : starDefaultSettings.StarCount;

            var sCount = 0;

            while (sCount < starCount)
            {
                var star = new Star();

                // Generate the unique ID for the Star
                IdGen.GenerateId(star);

                // Set Grid Location of the Star
                var zone = universe.Zones[Rand.Next(0, universe.Zones.Count)];
                if (zone.StarId == null)
                {
                    zone.StarId = star.Id;
                }
                else
                {
                    continue;
                }

                // If that ID exists roll a new one
                if (universe.Stars.Exists(a => a.Id == star.Id))
                {
                    continue;
                }

                // Pick a random Name for the Star
                star.Name = Rand.Next(0, 4) == 2
                    ? nameGeneration.GenerateName()
                    : starData.Stars[Rand.Next(0, starLen - 1)];

                // If that Name exists roll a new one
                if (universe.Stars.Exists(a => a.Name == star.Name))
                {
                    continue;
                }

                // Set the type of Star
                star.StarType = starData.StarTypes[Rand.Next(0, 8) + Rand.Next(0, 8) + Rand.Next(0, 8)];

                // Add the Star to the Universe
                universe.Stars.Add(star);

                sCount++;
            }

            return(universe);
        }
Exemple #2
0
        public bool AddStationed(ITroopStub stub)
        {
            if (BaseStation == null)
            {
                throw new Exception("Cannot station in this troop manager");
            }

            int nextId = IdGen.GetNext();

            if (nextId == -1)
            {
                return(false);
            }

            var stationTroopId = (ushort)nextId;

            stub.BeginUpdate();
            stub.StationTroopId = stationTroopId;
            stub.State          = TroopState.Stationed;
            stub.Station        = BaseStation;
            stub.EndUpdate();

            RegisterStub(stationTroopId, stub);
            return(true);
        }
Exemple #3
0
        static void Main()
        {
            RNG   = new Random();
            IdGen = new IdGen();

            LogHandler      = new LogHandler();
            ShaderHandler   = new ShaderHandler();
            KeyboardHandler = new KeyboardHandler(false); // we don't want repeat enabled for a video game (except in menus or when writing something)
            ResourceHandler = new ResourceHandler();
            switch (Config.TextureDisplayMode)
            {
            case TextureDisplayMode.Smooth:
                RenderHandler = new RenderHandlerSmooth();
                break;

            default:
                RenderHandler = new RenderHandlerPixelPerfect();
                break;
            }
            SceneHandler = new SceneHandler();

            Camera = new Camera(50, 100);

            SpriteSets = new Dictionary <string, SpriteSet>
            {
                { "cube", new SpriteSet("cube.png", 79, 71) },
                { "tileset1", new SpriteSet("tileset.png", 3, 2, 16, 16) },
            }; // TODO do an enum and a GetSpriteSet like for Scenes?

            Window = new MainWindow();
            Window.Run(Config.UPS); // option sets the amount of times OnUpdateFrame(e) is called every second
        }
Exemple #4
0
        public void LoadProgram(string FileName, Stream DataStream)
        {
            int ProcessId = IdGen.GenerateId();

            Process MainProcess = new Process(Ns, Allocator, ProcessId);

            using (MemoryStream Input = new MemoryStream())
            {
                DataStream.CopyTo(Input);

                if (Path.GetExtension(FileName).ToLower() == ".nro")
                {
                    MainProcess.LoadProgram(new Nro(Input));
                }
                else
                {
                    MainProcess.LoadProgram(new Nso(Input));
                }

                DataStream.Dispose();
            }

            MainProcess.SetEmptyArgs();
            MainProcess.InitializeHeap();
            MainProcess.Run();

            Processes.TryAdd(ProcessId, MainProcess);
        }
Exemple #5
0
 /// <summary>
 /// Use <see cref="IdGen"/> for generating sequence IDs.
 /// </summary>
 /// <param name="machineId">当前机器码(唯一机会编号)</param>
 /// <param name="machineIdBits">机器码位数(0-10之间)</param>
 /// <param name="sequenceBits">
 /// 序列号位数(0-20之间)
 /// 注意:
 /// 1. 并发量越大,此值也要越大,例如:10 可以 1 秒内生成 2^10=1024 个 ID。
 /// 2. 每台机器此参数务必相同。
 /// </param>
 public void UseIdGen(
     ushort machineId,
     byte machineIdBits = IdGen.DefaultMachineIdBits,
     byte sequenceBits  = IdGen.DefaultSequenceBits)
 {
     IdGen.Init(machineId, machineIdBits, sequenceBits);
 }
Exemple #6
0
        public ReviewComment()
        {
            DateTime now = DateTime.UtcNow;

            Id       = IdGen.NewId(20);
            Created  = now;
            Modified = now;
        }
Exemple #7
0
        public void Initialize()
        {
            mIdGen = new IdGen(IdRange.players);
            var dispatcher = Server.Instance.netlayer.dispatcher;

            dispatcher.Subscribe(MessageID.Msg_CS_InputDataArray, InputDataArrayHandler);
            dispatcher.Subscribe(MessageID.Msg_CS_Login, LoginHandler);
            dispatcher.Subscribe(MessageID.Msg_CS_FullUpdate, FullUpdateHandler);
        }
Exemple #8
0
        public void BuildSql(AbstractRequestContext context)
        {
            var nextId = IdGen.NextId();

            if (!context.Parameters.TryAdd(Id, nextId))
            {
                context.Parameters.TryGetValue(Id, out Data.SqlParameter sqlParameter);
                sqlParameter.Value = nextId;
            }
        }
Exemple #9
0
 /// <summary>
 /// Use <see cref="IdGen"/> for generating sequence IDs.
 /// </summary>
 /// <param name="machineId">当前机器码(唯一机会编号)</param>
 /// <param name="machineIdBits">机器码位数(0-10之间)</param>
 /// <param name="sequenceBits">
 /// 序列号位数(值在0-20之间)
 /// 注意:
 /// 1. 并发量越大,此值也要越大,例如:10 可以 1 秒内生成 2^10=1024 个 ID。
 /// 2. 每台机器此参数务必相同。
 /// </param>
 public static void Init(
     ushort machineId,
     byte machineIdBits = DefaultMachineIdBits,
     byte sequenceBits  = DefaultSequenceBits)
 {
     if (_instance != null)
     {
         throw new InvalidOperationException("Can't set machine id twice.");
     }
     _instance = new IdGen(machineId, machineIdBits, sequenceBits);
 }
Exemple #10
0
        public async Task <ActionResult <Material> > Post([FromBody] Material material)
        {
            if (_db.Materials.Any(m => m.Name.ToLower() == material.Name.ToLower() && m.Suplier.ToLower() == material.Suplier.ToLower() && m.IsDeleted == false))
            {
                return(BadRequest("Material with current Name & Suplier already exists!"));
            }
            material.Id = IdGen.CreateId(IdGen.MATERIAL_PREFIX, _db.Materials.Count());
            _db.Materials.Add(material);
            await _materialRepo.Save();

            return(CreatedAtAction(nameof(Get), new { id = material.Id }, material));
        }
        public async Task <ActionResult <MaterialOut> > PostMaterialOut(MaterialOut materialOut)
        {
            materialOut.Id = IdGen.CreateId(IdGen.OUT_PREFIX, _context.MaterialOuts.Count());
            foreach (var item in materialOut.StokMaterialOut)
            {
                item.Id = materialOut.Id;
                _context.Stoks.Find(item.StokID).IsOut = true;
            }
            _context.MaterialOuts.Add(materialOut);
            _context.StokMaterialOut.AddRange(materialOut.StokMaterialOut);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMaterialOut", new { id = materialOut.Id }, materialOut));
        }
Exemple #12
0
        public void GeneratedIds_Not_Duplication()
        {
            IdGen.SetDefault(new IdGen(sequenceBits: 15));

            var idList = new List <long>();

            for (int i = 0; i < 10000; i++)
            {
                var id = IdGen.NewId();
                idList.Add(id);
            }

            var originalCount = idList.Count;
            var distinctCount = idList.Distinct().Count();

            Assert.Equal(originalCount, distinctCount);
        }
Exemple #13
0
        // Creates a new order with the first artpiece's price updated
        public static Order CreateNewOrder(Artpiece artpiece)
        {
            // Obtain customer from session
            Customer customer = (Customer)Net.GetSession("customer");

            Order order = new Order();

            //OrderID Generator
            IdGen IdGen = new IdGen();

            order.OrderId = IdGen.GenerateId("Order");

            order.CustomerId = customer.Id;             // Get customer ID
            order.TotalPrice = artpiece.Price;          // Set total price;

            return(order);
        }
Exemple #14
0
    public async Task SaveAsync(BookEditDto dto)
    {
        using var tran = Db.BeginTransaction();

        // Handle Books
        Book book;

        if (dto.Id == 0)
        {
            book = dto.Adapt <Book>();
            await Db.InsertAsync(book);
        }
        else
        {
            book = await Db.FindAsync <Book>(new { dto.Id });

            dto.Adapt(book);
            await Db.UpdateAsync(book);
        }

        // Handle Tags
        var existTags = Db.Query <Tag>(
            "SELECT * FROM Tag WHERE Name IN @Tags", new { dto.Tags });
        var newTags = dto.Tags
                      .Where(x => !existTags.Any(y => y.Name == x))
                      .Select(x => new Tag {
            Id = IdGen.NewId(), Name = x
        }).ToList();
        //foreach (var tag in newTags)
        //{
        //    tag.Id = IdGen.NewId();
        //}
        await Db.InsertBatchAsync(newTags);

        // Handle BookTags
        var bookTags = existTags.Concat(newTags)
                       .Select(x => new BookTag {
            BookId = book.Id, TagId = x.Id
        });
        await Db.DeleteAsync <BookTag>(new { BookId = dto.Id });

        await Db.InsertBatchAsync(bookTags);

        tran.Commit();
    }
Exemple #15
0
 public static void Config()
 {
     TypeAdapterConfig <BookEditDto, Book>
     .ForType()
     .Ignore(x => x.Tags)
     .Map(des => des.Formats, src => string.Join('/', src.Formats))
     .AfterMapping(des =>
     {
         if (des.Id == 0)
         {
             des.Id = IdGen.NewId();
         }
         else
         {
             des.UpdatedAt = DateTime.Now;
         }
     });
 }
Exemple #16
0
        public void BuildSql(AbstractRequestContext context)
        {
            var nextId = IdGen.NextId();

            if (context.Parameters.TryAdd(Id, nextId))
            {
                return;
            }
            context.Parameters.TryGetValue(Id, out Data.SqlParameter sqlParameter);
            sqlParameter.Value = nextId;
            if (!Assign)
            {
                return;
            }
            var sourceRequest = context.GetRequest();

            EmitSetAccessorFactory.Instance.Create(sourceRequest.GetType(), Id)(sourceRequest, nextId);
        }
Exemple #17
0
        public void LoadCart(string ExeFsDir, string RomFsFile = null)
        {
            if (RomFsFile != null)
            {
                Ns.VFs.LoadRomFs(RomFsFile);
            }

            int ProcessId = IdGen.GenerateId();

            Process MainProcess = new Process(Ns, Allocator, ProcessId);

            void LoadNso(string FileName)
            {
                foreach (string File in Directory.GetFiles(ExeFsDir, FileName))
                {
                    if (Path.GetExtension(File) != string.Empty)
                    {
                        continue;
                    }

                    Logging.Info($"Loading {Path.GetFileNameWithoutExtension(File)}...");

                    using (FileStream Input = new FileStream(File, FileMode.Open))
                    {
                        Nso Program = new Nso(Input);

                        MainProcess.LoadProgram(Program);
                    }
                }
            }

            LoadNso("rtld");

            MainProcess.SetEmptyArgs();

            LoadNso("main");
            LoadNso("subsdk*");
            LoadNso("sdk");

            MainProcess.InitializeHeap();
            MainProcess.Run();

            Processes.TryAdd(ProcessId, MainProcess);
        }
Exemple #18
0
    public async Task SaveAsync(TagEditDto dto)
    {
        using var tran = Db.BeginTransaction();

        if (dto.Id == 0) // Insert
        {
            var tag = dto.Adapt <Tag>();
            tag.Id = IdGen.NewId();
            await Db.InsertAsync(tag);
        }
        else // Update
        {
            var tag = await Db.FindAsync <Tag>(new { dto.Id });

            dto.Adapt(tag);
            await Db.UpdateAsync(tag);
        }
        tran.Commit();
    }
Exemple #19
0
        public void LoadProgram(string FileName)
        {
            bool IsNro = Path.GetExtension(FileName).ToLower() == ".nro";

            int ProcessId = IdGen.GenerateId();

            Process MainProcess = new Process(Ns, Allocator, ProcessId);

            using (FileStream Input = new FileStream(FileName, FileMode.Open))
            {
                MainProcess.LoadProgram(IsNro
                    ? (IExecutable) new Nro(Input)
                    : (IExecutable) new Nso(Input));
            }

            MainProcess.SetEmptyArgs();
            MainProcess.InitializeHeap();
            MainProcess.Run(IsNro);

            Processes.TryAdd(ProcessId, MainProcess);
        }
Exemple #20
0
        public void DbLoaderAddStation(ITroopStub stub)
        {
            if (BaseStation == null)
            {
                throw new Exception("Cannot station in this troop manager");
            }

            int nextId = IdGen.GetNext();

            if (nextId == -1)
            {
                return;
            }

            var stationTroopId = (ushort)nextId;

            stub.StationTroopId = stationTroopId;
            stub.Station        = BaseStation;

            RegisterStub(stationTroopId, stub);
        }
Exemple #21
0
        public static string BuildSingleId(string prefix)
        {
            lock ("SingleIdLocker")
            {
                string singleId;
                if (_dicIdGen == null)
                {
                    _dicIdGen = new Dictionary <string, IdGen>();
                }

                if (_dicIdGen.ContainsKey(prefix))
                {
                    var thisTime = DateTime.Now;
                    var gen      = _dicIdGen[prefix];
                    if (thisTime.ToString(DATE_TIME_FORMAT).Equals(gen.DateTime.ToString(DATE_TIME_FORMAT)))
                    {
                        gen.Index++;
                    }
                    else
                    {
                        gen.Index    = 1;
                        gen.DateTime = thisTime;
                    }

                    singleId =
                        $"{prefix}-{gen.DateTime.ToString(DATE_TIME_FORMAT)}-{gen.Index.ToString(CultureInfo.InvariantCulture).PadLeft(3, '0')}";
                    return(singleId);
                }

                var idGen = new IdGen
                {
                    DateTime = DateTime.Now,
                    Index    = 1
                };
                _dicIdGen.Add(prefix, idGen);
                singleId =
                    $"{prefix}-{idGen.DateTime.ToString(DATE_TIME_FORMAT)}-{idGen.Index.ToString(CultureInfo.InvariantCulture).PadLeft(3, '0')}";
                return(singleId);
            }
        }
Exemple #22
0
        public async Task <ActionResult <NewStok> > PostStok(NewStok newStok)
        {
            List <Stok> stok = new List <Stok>();

            if (newStok.Qty <= newStok.Pallet)
            {
                stok.Add(new Stok {
                    Id = IdGen.CreateId("TRC", _context.Stoks.Count() + 1), Lot = newStok.Lot, ExpiredDate = newStok.ExpiredDate, MaterialID = newStok.MaterialID, QTY = newStok.Qty
                });
                _context.Stoks.Add(stok[0]);
            }
            else if (newStok.Qty > newStok.Pallet)
            {
                int stokCount = newStok.Qty / newStok.Pallet;
                int sisa      = newStok.Qty % newStok.Pallet;
                for (int i = 0; i < stokCount; i++)
                {
                    stok.Add(new Stok {
                        Id = IdGen.CreateId("TRC", _context.Stoks.Count() + i), Lot = newStok.Lot, ExpiredDate = newStok.ExpiredDate, MaterialID = newStok.MaterialID, QTY = newStok.Pallet
                    });
                }
                if (sisa != 0)
                {
                    stok.Add(new Stok {
                        Id = IdGen.CreateId("TRC", _context.Stoks.Count() + stokCount), Lot = newStok.Lot, ExpiredDate = newStok.ExpiredDate, MaterialID = newStok.MaterialID, QTY = sisa
                    });
                }
            }
            else
            {
                return(BadRequest());
            }
            _context.Stoks.AddRange(stok);
            await _context.SaveChangesAsync();

            return(StatusCode(201, stok));
        }
Exemple #23
0
            /// <summary>
            /// Parses the descriptor recursively.
            /// </summary>
            /// <param name="instance">The instance.</param>
            /// <param name="sourceName">Name of the source.</param>
            /// <param name="objType">Type of the object.</param>
            /// <param name="memberFilter"></param>
            /// <returns></returns>
            /// <exception cref="System.Runtime.Serialization.SerializationException">Cannot serialize non public type</exception>
            public BaseDescriptor ParseDescriptor(object instance, string sourceName, Type objType)
            {
                if (instance == null)
                {
                    return(new NullDescriptor(sourceName));
                }

                bool dummyRequiredOutputValue;
                long objId = IdGen.GetId(instance, out dummyRequiredOutputValue);

                int    hashCode  = instance.GetHashCode();
                string typeRefId = objId
                                   + ID_CODE_TOKEN
                                   + objType.Name
                                   + ID_CODE_TOKEN
                                   + hashCode;

                if (IdTracker.Contains(typeRefId))
                {
                    return(new CopyReferenceDescriptor(sourceName, objType.AssemblyQualifiedName, typeRefId));
                }

                if (objType.IsPrimitive || Type.GetTypeCode(objType) == TypeCode.String)
                {
                    return(new PrimitiveDescriptor(sourceName, objType.AssemblyQualifiedName, instance.ToString()));
                }

                if (!objType.IsVisible)
                {
                    throw new SerializationException("Cannot serialize non public type");
                }

                IdTracker.Add(typeRefId);

                //Todo - add a collection support
                //if (objType.IsGenericType || objType.IsGenericTypeDefinition)
                //{
                //    Type collectionType = typeof(ICollection<>).MakeGenericType(objType.GetGenericArguments());
                //    if (collectionType.IsAssignableFrom(objType))
                //    {
                //        var collectionDescriptor = new CollectionDescriptor(sourceName, objType.AssemblyQualifiedName, typeRefId);

                //        IEnumerable collection = (IEnumerable)instance;
                //        foreach (var item in collection)
                //        {
                //            Type itemType = item.GetType();
                //            BaseDescriptor descriptor = ParseDescriptor(item, itemType.Name, itemType);

                //            collectionDescriptor.Values.Add(descriptor);
                //        }

                //        return collectionDescriptor;
                //    }
                //}

                var objectDescriptor = new ObjectDescriptor(sourceName, objType.AssemblyQualifiedName, typeRefId);

                var bindingFlags = BindingFlags.Public
                                   | BindingFlags.NonPublic
                                   | BindingFlags.Instance;

                ReadFields(objectDescriptor, instance, objType, bindingFlags);
                ReadProperties(objectDescriptor, instance, objType, bindingFlags);

                return(objectDescriptor);
            }
Exemple #24
0
        public static void Initialize(DatabaseContext db)
        {
            if (!db.Materials.Any())
            {
                var count = db.Materials.Count();
                db.AddRange(
                    new Material {
                    Id = IdGen.CreateId(IdGen.MATERIAL_PREFIX, count), Name = "DUS JDO 1", Suplier = "SUPRACOR", Unit = "PCS", Type = "DUS"
                },
                    new Material {
                    Id = IdGen.CreateId(IdGen.MATERIAL_PREFIX, ++count), Name = "DUS JDO 3", Suplier = "SUPRACOR", Unit = "PCS", Type = "DUS"
                },
                    new Material {
                    Id = IdGen.CreateId(IdGen.MATERIAL_PREFIX, ++count), Name = "DUS JDO 5", Suplier = "SURINDO", Unit = "PCS", Type = "DUS"
                },
                    new Material {
                    Id = IdGen.CreateId(IdGen.MATERIAL_PREFIX, ++count), Name = "CUP JDO 9", Suplier = "SURINDO", Unit = "PCS", Type = "CUP"
                },
                    new Material {
                    Id = IdGen.CreateId(IdGen.MATERIAL_PREFIX, ++count), Name = "DUS JDO 7", Suplier = "SURINDO", Unit = "PCS", Type = "DUS"
                },
                    new Material {
                    Id = IdGen.CreateId(IdGen.MATERIAL_PREFIX, ++count), Name = "SEAL JDO 3", Suplier = "SURINDO", Unit = "ROLL", Type = "SEAL"
                }
                    );
            }

            if (!db.Locations.Any())
            {
                int c = -1;
                for (int i = 1; i < 26; i++)
                {
                    for (int j = 1; j < 15; j++)
                    {
                        db.Locations.Add(new Location {
                            Id = IdGen.CreateId(++c), Name = $"A{String.Format("{0:00}", i)}A{String.Format("{0:00}", j)}"
                        });
                        db.Locations.Add(new Location {
                            Id = IdGen.CreateId(++c), Name = $"A{String.Format("{0:00}", i)}B{String.Format("{0:00}", j)}"
                        });
                    }
                }
            }

            if (!db.StatusQCs.Any())
            {
                db.StatusQCs.Add(new StatusQC {
                    Id = "1", Name = "UNAPPROVE"
                });
                db.StatusQCs.Add(new StatusQC {
                    Id = "2", Name = "PASS"
                });
                db.StatusQCs.Add(new StatusQC {
                    Id = "3", Name = "QUARANTINE"
                });
                db.StatusQCs.Add(new StatusQC {
                    Id = "4", Name = "BLOCK"
                });
            }

            if (!db.MaterialOuts.Any())
            {
                int i = 0;
                db.MaterialOuts.AddRange(
                    new MaterialOut {
                    Id = IdGen.CreateId(IdGen.OUT_PREFIX, i), ReceiverDepartement = "Produksi", ReceiverName = "Afta"
                }
                    );
            }

            if (!db.StokMaterialOut.Any())
            {
                db.StokMaterialOut.AddRange(
                    new StokMaterialOut {
                    Id = "OUT0000001", StokID = "ST0000002"
                },
                    new StokMaterialOut {
                    Id = "OUT0000001", StokID = "ST0000003"
                },
                    new StokMaterialOut {
                    Id = "OUT0000001", StokID = "ST0000004"
                },
                    new StokMaterialOut {
                    Id = "OUT0000001", StokID = "ST0000005"
                }
                    );
            }

            if (!db.Stoks.Any())
            {
                int i = 0;
                db.AddRangeAsync(
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", LocationID = "1", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400, IsOut = true
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000003", LocationID = "2", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400, IsOut = true
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", LocationID = "3", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400, IsOut = true
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", LocationID = "4", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400, IsOut = true
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", LocationID = "5", ComingDate = DateTime.Now.AddMonths(-1), ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", LocationID = "6", ComingDate = DateTime.Now.AddMonths(-1), ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", LocationID = "7", ComingDate = DateTime.Now.AddMonths(-1), ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", LocationID = "8", ComingDate = DateTime.Now.AddMonths(-1), ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", LocationID = "9", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000003", LocationID = "10", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000003", LocationID = "11", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "2", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000002", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000006", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000006", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000006", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000004", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000006", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000006", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000006", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000006", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000006", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000005", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000004", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000004", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000003", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000001", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                },
                    new Stok {
                    Id = IdGen.CreateId(IdGen.STOK_PREFIX, ++i), MaterialID = "MT0000005", ComingDate = DateTime.Now, ExpiredDate = DateTime.Now.AddYears(2), Lot = "1235545", StatusQCID = "1", QTY = 1400
                }
                    );


                db.SaveChanges();
            }
        }
        public Universe AddProblems(Universe universe, ProblemDefaultSettings problemDefaultSettings, ProblemData problemData)
        {
            if (universe.Problems == null)
            {
                universe.Problems = new List <Problem>();
            }

            var count = problemDefaultSettings.Count < 0
                ? 5
                : problemDefaultSettings.Count;

            var add = problemDefaultSettings.Additive;

            var id = string.IsNullOrEmpty(problemDefaultSettings.Id)
                ? null
                : problemDefaultSettings.Id;

            if (id != null)
            {
                var locId = (from planets in universe.Planets select new { ID = planets.Id })
                            .Union(from stars in universe.Stars select new { ID = stars.Id })
                            .Single(a => a.ID == id).ID;

                if (string.IsNullOrEmpty(locId))
                {
                    throw new FileNotFoundException("No locations with ID " + id + " found");
                }

                var probCount = 0;
                while (probCount < count)
                {
                    if (count <= universe.Problems.Count(a => a.LocationId == locId) &&
                        !add)
                    {
                        break;
                    }

                    var problem = new Problem();

                    IdGen.GenerateId(problem);
                    problem.LocationId = locId;
                    var conflict = problemData.Conflicts[Rand.Next(0, problemData.Conflicts.Count)];
                    problem.ConflictType = conflict.Type;
                    problem.Situation    = conflict.Situations[Rand.Next(0, 5)];
                    problem.Focus        = conflict.Focuses[Rand.Next(0, 5)];
                    problem.Restraint    = problemData.Restraints[Rand.Next(0, 20)];
                    problem.Twist        = problemData.Twists[Rand.Next(0, 20)];

                    universe.Problems.Add(problem);

                    probCount++;
                }
            }
            else
            {
                foreach (Planet planet in universe.Planets)
                {
                    var probCount = 0;
                    while (probCount < count)
                    {
                        if (probCount + count <= universe.Problems.Count(a => a.LocationId == planet.Id) &&
                            !add)
                        {
                            break;
                        }

                        var problem = new Problem();

                        IdGen.GenerateId(problem);
                        problem.LocationId = planet.Id;
                        var conflict = problemData.Conflicts[Rand.Next(0, problemData.Conflicts.Count)];
                        problem.ConflictType = conflict.Type;
                        problem.Situation    = conflict.Situations[Rand.Next(0, 5)];
                        problem.Focus        = conflict.Focuses[Rand.Next(0, 5)];
                        problem.Restraint    = problemData.Restraints[Rand.Next(0, 20)];
                        problem.Twist        = problemData.Twists[Rand.Next(0, 20)];

                        universe.Problems.Add(problem);

                        probCount++;
                    }
                }

                //TODO: Add more locations for problems
            }

            return(universe);
        }
Exemple #26
0
 /// <summary>
 /// Use a default instance of <see cref="IdGen"/>.
 /// </summary>
 /// <param name="idGen">The instace of <see cref="IdGen"/>.</param>
 public void UseIdGen(IdGen idGen = null)
 {
     IdGen.SetDefault(idGen);
 }
Exemple #27
0
 /// <summary>
 /// Use <see cref="IdGen"/> for generating sequence IDs.
 /// </summary>
 /// <param name="machineId">An unique id of current machine.</param>
 public void UseIdGen(ushort machineId)
 {
     IdGen.SetMachineId(machineId);
 }
Exemple #28
0
 public ItemGUI()
 {
     _objectId = IdGen.GetNewId();
 }
        /// <summary>
        /// This function handles all Character creation. Should receive a Universe to edit and a set of
        /// CharacterDefaultSettings that will be used to set defaults.
        /// </summary>
        /// <param name="universe"></param>
        /// <param name="characterDefaultSettings"></param>
        /// <param name="charData"></param>
        /// <param name="nameGenerations"></param>
        /// <returns>The newly modified universe</returns>
        public Universe AddCharacters(Universe universe, CharacterDefaultSettings characterDefaultSettings,
                                      CharData charData, List <NameGeneration> nameGenerations)
        {
            // If no Characters have been created on the Universe then give it an empty list of them.
            universe.Characters ??= new List <Character>();

            // Set the number of characters you want to create. Default is 1.
            var count = characterDefaultSettings.Count < 0
                ? 1
                : characterDefaultSettings.Count;

            var cCount = 0;

            while (cCount < count)
            {
                // Create the character with the specified first and last name
                var character = new Character();

                // Generate a randomized ID for the new Character
                IdGen.GenerateId(character);

                // If the created ID happens to exist (unlikely) then just continue and create a new one
                if (universe.Characters.Exists(a => a.Id == character.Id))
                {
                    continue;
                }

                // Set sheet bounds including sheet# and row count.
                // Must be done here to randomly select the sheet
                var gender = characterDefaultSettings.Gender != Character.GenderEnum.Undefined
                    ? characterDefaultSettings.Gender == Character.GenderEnum.Male ? 0 : 1
                    : Rand.Next(0, 2);

                // Get the list of names for the specified gender
                var firstNameList  = gender == 0 ? charData.MaleName : charData.FemaleName;
                var nameGeneration = gender == 0 ? nameGenerations[0] : nameGenerations[1];

                // Set the number of items in each list to be used for the max value in rand.Next()
                var firstCount     = firstNameList.Count;
                var lastCount      = charData.LastName.Count;
                var hairColorCount = charData.HairColor.Count;
                var hairStyleCount = charData.HairStyle.Count;
                var eyeColorCount  = charData.EyeColor.Count;

                // Grab random values from their respective lists or use provided values
                character.First = string.IsNullOrEmpty(characterDefaultSettings.First)
                    ? Rand.Next(0, 4) == 1
                        ? nameGeneration.GenerateName()
                        : firstNameList[Rand.Next(0, firstCount - 1)]
                    : characterDefaultSettings.First;
                character.Last = string.IsNullOrEmpty(characterDefaultSettings.Last)
                    ? charData.LastName[Rand.Next(0, lastCount - 1)]
                    : characterDefaultSettings.Last;
                character.Age = characterDefaultSettings.Age == null || characterDefaultSettings.Age.Length == 0 ||
                                characterDefaultSettings.Age[0] == -1 || characterDefaultSettings.Age[1] == -1
                                // This creates Ages on a bell-curve where it's more likely to land somewhere around 30-45
                                // with a minimum of 15
                    ? Rand.Next(5, 22) + Rand.Next(5, 23) + Rand.Next(5, 23)
                    : Rand.Next(characterDefaultSettings.Age[0], characterDefaultSettings.Age[1]);
                character.Gender  = (Character.GenderEnum)gender;
                character.HairCol = string.IsNullOrEmpty(characterDefaultSettings.HairCol)
                    ? charData.HairColor[Rand.Next(0, hairColorCount)]
                    : characterDefaultSettings.HairCol;
                character.HairStyle = string.IsNullOrEmpty(characterDefaultSettings.HairStyle)
                    ? charData.HairStyle[Rand.Next(0, hairStyleCount)]
                    : characterDefaultSettings.HairStyle;
                character.EyeCol = string.IsNullOrEmpty(characterDefaultSettings.EyeCol)
                    ? charData.EyeColor[Rand.Next(0, eyeColorCount)]
                    : characterDefaultSettings.EyeCol;
                character.Title = string.IsNullOrEmpty(characterDefaultSettings.Title)
                    ? null
                    : characterDefaultSettings.Title;
                character.BirthPlanet     = universe.Planets?[Rand.Next(0, universe.Planets.Count)].Id;
                character.CurrentLocation = Rand.Next(0, 100) < 5
                    ? universe.Planets?[Rand.Next(0, universe.Planets.Count)].Id
                    : character.BirthPlanet;
                character.CrimeChance = characterDefaultSettings.CrimeChance == null ||
                                        characterDefaultSettings.CrimeChance.Length == 0 ||
                                        characterDefaultSettings.CrimeChance[0] == -1 ||
                                        characterDefaultSettings.CrimeChance[1] == -1
                    ? Rand.Next(1, 26) + Rand.Next(0, 25) + // Default chance up to 50%
                                        (Rand.Next(0, 4) != 1
                          ? 0
                          : Rand.Next(1, 26) + Rand.Next(0, 25)) // 25% Additional crime roll chance
                    : Rand.Next(characterDefaultSettings.CrimeChance[0], characterDefaultSettings.CrimeChance[1] + 1);
                character.ShipId = string.IsNullOrEmpty(characterDefaultSettings.ShipId)
                    ? null
                    : characterDefaultSettings.ShipId;

                character.InitialReaction = (Rand.Next(0, 6) + Rand.Next(0, 6)) switch
                {
                    0 => charData.InitialReactions[0],
                    {} n when(n >= 1 && n <= 3) => charData.InitialReactions[1],
                    {
                    }

                    n when(n >= 4 && n <= 6) => charData.InitialReactions[2],
                    {
                    }

                    n when(n >= 7 && n <= 9) => charData.InitialReactions[3],
                    10 => charData.InitialReactions[4],
                    _ => charData.InitialReactions[2]
                };

                // Add the Character to the list of Characters in the universe
                universe.Characters.Add(character);

                cCount++;
            }

            // Re-order the list of Characters by their first name.
            universe.Characters = universe.Characters.OrderBy(c => c.First).ToList();

            return(universe);
        }
    }
Exemple #30
0
        private void pay()
        {
            // Get customer details
            Customer customer = (Customer)Net.GetSession("customer");

            // Get count
            List <Order_Artwork> oaList = (List <Order_Artwork>)Net.GetSession("oaList");
            int    itemCount            = oaList.Count;
            double total = 0;

            // Create order
            Order order = (Order)Net.GetSession("order");
            IdGen IdGen = new IdGen();

            order.OrderId         = IdGen.GenerateId("custorder");
            order.OrderDate       = DateTime.Now;
            order.IsCanceled      = false;
            order.CustomerId      = customer.Id;
            order.DeliveryAddress = txtAddress.Text;


            foreach (Order_Artwork oa in oaList)
            {
                // Cumulate price
                ArtpieceDao      dao      = new ArtpieceDao();
                Classes.Artpiece artpiece = dao.Get("ARTPIECEID", oa.ArtpieceId);

                total += oa.Quantity * artpiece.Price;


                // Set Foreign Keys
                oa.ArtpieceId = artpiece.ArtpieceId;
                oa.OrderId    = order.OrderId;

                // Update stocks
                artpiece.Stocks = artpiece.Stocks - oa.Quantity;

                // Update artpiece
                ArtpieceDao artpieceDao = new ArtpieceDao();
                artpieceDao.Update(artpiece);
            }

            // Set cumulated price as total price
            order.TotalPrice = total;

            // Insert order
            CustorderDao custorderDao = new CustorderDao();

            custorderDao.Add(order);

            // Insert OrderArtwork
            foreach (Order_Artwork oa in oaList)
            {
                OrderArtworkDao orderArtworkDao = new OrderArtworkDao();
                orderArtworkDao.Add(oa);
            }

            // Send receipt
            sendReceipt(order, oaList, customer.Email);

            // Clear cart
            Net.SetSession("order", new Order());
            Net.SetSession("oaList", new List <Order_Artwork>());
            Net.SetSession("cartSaved", false);
        }