Pigeon Agents Development Demo Dummy Data - DatasmithSA/Pigeon-Voice-Training GitHub Wiki

Now that you have created the database for this demo, we will need to insert some dummy data into the database which the Pigeon Voice agents and Voice Application can make use of. You could manually insert the data into the database using Microsoft SQL Server Management Studio, or writing a SQL script for inserting the data. For this demo however, we will use LINQPadLINQPad and use a LINQ to SQL script to reset the dummy data.

  1. Download and install LINQPad from here: https://www.linqpad.net

  2. Start up LINQPad and click on "Add connection" and create a connection that points to SQL Server Instance.

  3. The LINQ to SQL script to add dummy data is available in this repository in the "linq scripts" folder and it is called ResetDemoData.linq. Open the script in LINQPad. The contents of the script should be as follows. We create:

    • 3 Users (Operators).
    • 1 Pick List header
    • 3 Pick Items linked to the Pick List header

PickItems.DeleteAllOnSubmit(PickItems);
PickLists.DeleteAllOnSubmit(PickLists);
Users.DeleteAllOnSubmit(Users);
SubmitChanges();

//Users
User operatorId = new User() { UserId = Guid.NewGuid(), Username = "Operator.Id",Password = "1234",LoggedIn = false, DateCreated = DateTime.Now };
Users.InsertOnSubmit(operatorId);

User paul = new User() { UserId = Guid.NewGuid(), Username = "paul",Password = "5678",LoggedIn = false, DateCreated = DateTime.Now };
Users.InsertOnSubmit(paul);

User nic = new User() { UserId = Guid.NewGuid(), Username = "nic",Password = "9012",LoggedIn = false, DateCreated = DateTime.Now };
Users.InsertOnSubmit(nic);

//Pick List 1
PickList list1 = new PickList() { PickListId = Guid.NewGuid(), PickListNumber = 1, Picked = false, DateCreated = DateTime.Now };
PickLists.InsertOnSubmit(list1);

PickItem item1 = new PickItem()
{ 
	PickItemId = Guid.NewGuid(), 
	PickListId = list1.PickListId,
	Sku = "SK01",
	Location = "L01",
	CheckDigits = "012",
	QuantityToPick = 10,
	Description = "Chicken Wings",
	QuantityPicked = null,
	PickedByUserId = null,
	PickedByUserName = null,
	DateCreated = DateTime.Now
};
PickItems.InsertOnSubmit(item1);

PickItem item2 = new PickItem() 
{ 
	PickItemId = Guid.NewGuid(), 
	PickListId = list1.PickListId, 
	Sku = "SK02",
	Location = "L02",
	CheckDigits = "013",
	QuantityToPick = 11,
	Description = "Beef Patties",
	QuantityPicked = null,
	PickedByUserId = null,
	PickedByUserName = null,
	DateCreated = DateTime.Now
};
PickItems.InsertOnSubmit(item2);

//Pick List 2
PickList list2 = new PickList() { PickListId = Guid.NewGuid(), PickListNumber = 2, Picked = false, DateCreated = DateTime.Now };
PickItem item3 = new PickItem() 
{ 
	PickItemId = Guid.NewGuid(), 
	PickListId = list1.PickListId, 
	Sku = "SK03",
	Location = "L03",
	CheckDigits = "014",
	QuantityToPick = 12,
	Description = "Lettuce",
	QuantityPicked = null,
	PickedByUserId = null,
	PickedByUserName = null,
	DateCreated = DateTime.Now
};
PickItems.InsertOnSubmit(item3);

PickItem item4 = new PickItem() 
{ 
	PickItemId = Guid.NewGuid(), 
	PickListId = list1.PickListId, 
	Sku = "SK04",
	Location = "L04",
	CheckDigits = "015",
	QuantityToPick = 13,
	Description = "Potato",
	QuantityPicked = null,
	PickedByUserId = null,
	PickedByUserName = null,
	DateCreated = DateTime.Now
};
PickItems.InsertOnSubmit(item4);
SubmitChanges();

Users.Dump();
PickLists.Dump();
PickItems.OrderBy (pi => pi.Location).Dump();

  1. In the "Language" drop down menu in LINQPad, select the "C# Statements" option.
  2. In the "Connection" drop down menu in LINQPad, select your PigeonVoiceDemo database.
  3. Run the script. After executing the script the bottom lines of the script dump (query) the contents of the tables and display the records. /images/demo/Pigeon-Voice-Demo-LINQPad-Dummy-Data.png

N.B. you can edit the script as you please to change the data or to add new records. After running through the demo Voice Application, you will also need to rerun the script to reset the dummy data in the database.