Skip to content

Instantly share code, notes, and snippets.

@drewchapin
Last active July 12, 2017 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewchapin/9e7858f11e603f2cd94111bd2d67c722 to your computer and use it in GitHub Desktop.
Save drewchapin/9e7858f11e603f2cd94111bd2d67c722 to your computer and use it in GitHub Desktop.
Shift TextBox Values
private void ShiftTextBoxHistory( DataRow next )
{
TextBox[][] c = new TextBox[][]
{
new TextBox[]{lastLotNumber1TextBox, lastPartNumber1TextBox, lastBatchNumber1TextBox},
new TextBox[]{lastLotNumber2TextBox, lastPartNumber2TextBox, lastBatchNumber2TextBox},
new TextBox[]{lastLotNumber3TextBox, lastPartNumber3TextBox, lastBatchNumber3TextBox},
new TextBox[]{lastLotNumber4TextBox, lastPartNumber4TextBox, lastBatchNumber4TextBox},
new TextBox[]{lastLotNumber5TextBox, lastPartNumber5TextBox, lastBatchNumber5TextBox},
};
lastPartNumber1TextBox.Text = (string)next["hondaPartNumber"];
lastLotNumber1TextBox.Text = (string)next["lotNumber"];
lastBatchNumber1TextBox.Text = (string)next["deliveryBatch"];
for( int y = c.Count()-1; y > 0; y-- )
{
for( int x = c[y].Count()-1; x >= 0; x-- )
{
c[y][x].Text = c[y-1][x].Text;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment