ещё больше автогенерации штрих кодов + их отображение в реальном времени
This commit is contained in:
parent
7776de448b
commit
5cf65ccdb2
3
WinFormsApp/FormProducts.Designer.cs
generated
3
WinFormsApp/FormProducts.Designer.cs
generated
@ -60,8 +60,11 @@
|
|||||||
dataGridView.Dock = DockStyle.Left;
|
dataGridView.Dock = DockStyle.Left;
|
||||||
dataGridView.Location = new Point(0, 24);
|
dataGridView.Location = new Point(0, 24);
|
||||||
dataGridView.Name = "dataGridView";
|
dataGridView.Name = "dataGridView";
|
||||||
|
dataGridView.ReadOnly = true;
|
||||||
|
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||||
dataGridView.Size = new Size(602, 622);
|
dataGridView.Size = new Size(602, 622);
|
||||||
dataGridView.TabIndex = 0;
|
dataGridView.TabIndex = 0;
|
||||||
|
dataGridView.SelectionChanged += dataGridView_SelectionChanged;
|
||||||
//
|
//
|
||||||
// buttonCreateProduct
|
// buttonCreateProduct
|
||||||
//
|
//
|
||||||
|
@ -123,9 +123,9 @@ namespace WinFormsApp
|
|||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
LoadData();
|
LoadData();
|
||||||
groupBoxControls.Enabled = true;
|
//groupBoxControls.Enabled = true;
|
||||||
groupBoxControls.Show();
|
groupBoxControls.Show();
|
||||||
groupBoxCreateProduct.Enabled = false;
|
//groupBoxCreateProduct.Enabled = false;
|
||||||
groupBoxCreateProduct.Hide();
|
groupBoxCreateProduct.Hide();
|
||||||
textBoxName.Text = string.Empty;
|
textBoxName.Text = string.Empty;
|
||||||
numericUpDownAmount.Value = 0;
|
numericUpDownAmount.Value = 0;
|
||||||
@ -246,5 +246,25 @@ namespace WinFormsApp
|
|||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void dataGridView_SelectionChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (dataGridView.SelectedRows.Count == 1)
|
||||||
|
{
|
||||||
|
if (!File.Exists($"product{dataGridView.SelectedRows[0].Cells["Id"].Value}.png"))
|
||||||
|
{
|
||||||
|
var barcode = _barcodeLogic.CreateBarcode(new ProductBindingModel()
|
||||||
|
{
|
||||||
|
Id = (Guid)dataGridView.SelectedRows[0].Cells["Id"].Value,
|
||||||
|
Name = Convert.ToString(dataGridView.SelectedRows[0].Cells["Name"].Value),
|
||||||
|
}, true);
|
||||||
|
pictureBox1.Image = barcode.Image;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pictureBox1.Image = new Bitmap($"product{dataGridView.SelectedRows[0].Cells["Id"].Value}.png");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user