pridanie moznosti zadavania velkosti polotovaru z vyroby na karte vykresy + tlacenie do poznamky na kontrolnom liste

This commit is contained in:
roman6791
2021-05-06 23:14:55 +02:00
parent b4dc25ce46
commit f9b0009cd2
7 changed files with 986 additions and 335 deletions

Binary file not shown.

View File

@@ -303,6 +303,12 @@
<Compile Include="frmTlacitStatistiku.Designer.cs">
<DependentUpon>frmTlacitStatistiku.cs</DependentUpon>
</Compile>
<Compile Include="frmUlozPolotovarZVyroby.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmUlozPolotovarZVyroby.Designer.cs">
<DependentUpon>frmUlozPolotovarZVyroby.cs</DependentUpon>
</Compile>
<Compile Include="frmVybratTypVyhodnotenia.cs">
<SubType>Form</SubType>
</Compile>
@@ -417,6 +423,9 @@
<EmbeddedResource Include="frmTlacitStatistiku.resx">
<DependentUpon>frmTlacitStatistiku.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmUlozPolotovarZVyroby.resx">
<DependentUpon>frmUlozPolotovarZVyroby.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmVybratTypVyhodnotenia.resx">
<DependentUpon>frmVybratTypVyhodnotenia.cs</DependentUpon>
</EmbeddedResource>

435
Mip/frmMain.Designer.cs generated

File diff suppressed because it is too large Load Diff

View File

@@ -1070,6 +1070,14 @@ namespace Mip
if (dtrw.Cells["TypDopytu"].Value.ToString() == "Objednávka" || dtrw.Cells["TypDopytu"].Value.ToString() == "Objednávka do kontraktu")
if (dtrw.Cells["StatusDopytu"].Value.ToString() != "Odoslaná" && dtrw.Cells["StatusDopytu"].Value.ToString() != "Pozastavená" && dtrw.Cells["StatusDopytu"].Value.ToString() != "Zrušená")
{
string IDVyrobok = dtrw.Cells["IDVyrobok"].Value.ToString();
var cmd = $@"SELECT
CONCAT(p.RozmerTvar, p.Rozmer1, if(p.RozmerTvar = 'Ø', '/', 'x'), p.Rozmer2, 'x', p.Rozmer3, ' (', p.PocetKusovVPolotovare, '-Ks na polotovar)')
FROM tabpolotovar p
WHERE p.IDVyrobok = {IDVyrobok};";
var VelkostPolotovaru = string.Empty;
classSQL.SQL(cmd, out VelkostPolotovaru);
classGlobal.DeleteRamDisk(); classGlobal.CreateRamDisk();
classSQL.ExportFormToHDD("Kontrolný list - predná strana.xls", @"W:\tlps.xls");
@@ -1099,8 +1107,14 @@ namespace Mip
if (dtrw.Cells["NazovKontraktu"].Value.ToString() == "") xlWorkSheet.Range["F5", "G5"].Value = "K.č.: --";
else xlWorkSheet.Range["F5", "G5"].Value = "K.č.: " + dtrw.Cells["NazovKontraktu"].Value.ToString();
xlWorkSheet.Range["F6", "G6"].Value = "Kon.op.: " + dtrw.Cells["RozlisZnakKonecnaOp"].Value.ToString();
if (dtrw.Cells["PoznamkaOBJ"].Value.ToString() == "") xlWorkSheet.Range["B49", "O54"].Value = "Poznámky:";
else if (MessageBox.Show("Tlačiť aj poznámku?", "Poznámka??", MessageBoxButtons.YesNo) == DialogResult.Yes) xlWorkSheet.Range["B49", "O54"].Value = "Poznámky: " + dtrw.Cells["PoznamkaOBJ"].Value.ToString();
if (dtrw.Cells["PoznamkaOBJ"].Value.ToString() == "")
{
xlWorkSheet.Range["B49", "O54"].Value = $"Poznámky: {Environment.NewLine} Veľkosť polotovaru z výroby: {VelkostPolotovaru}";
}
else if (MessageBox.Show("Tlačiť aj poznámku?", "Poznámka??", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
xlWorkSheet.Range["B49", "O54"].Value = $"Poznámky: {dtrw.Cells["PoznamkaOBJ"].Value.ToString()} {Environment.NewLine} {VelkostPolotovaru}";
}
xlApp.Visible = true;
xlApp.ActiveWindow.Activate();
@@ -5967,7 +5981,16 @@ namespace Mip
string strTextBoxConditionZakaznik = " AND INSTR(`Zakaznik`, '" + textBox14.Text + "')>0 ";
string strTextBoxConditionRozmery = " AND INSTR(`SpojeneRozmery`, '" + textBox16.Text + "')>0 ";
string sqlCommandVydajMat = "SELECT * FROM `tabvyrobok` WHERE" + strTextBoxConditionNazov + strTextBoxConditionZakaznik + strTextBoxConditionRozmery + ";";
string sqlCommandVydajMat =
$@"SELECT
v.*,
CONCAT(p.RozmerTvar, p.Rozmer1, if (p.RozmerTvar = 'Ø', '/', 'x'), p.Rozmer2, 'x', p.Rozmer3, ' (', p.PocetKusovVPolotovare, '-Ks)') AS 'RozmerPolotovaru'
FROM `tabvyrobok` v
LEFT JOIN tabpolotovar p ON p.IDVyrobok = v.IDVyrobok
WHERE {strTextBoxConditionNazov} {strTextBoxConditionZakaznik} {strTextBoxConditionRozmery};";
//WHERE INSTR(v.NazovVyrobku, '')> 0 AND INSTR(v.Zakaznik, '')> 0 AND INSTR(v.SpojeneRozmery, '')> 0;
DataTable dtbVykres = new DataTable();
Int32 StartRecord = (Convert.ToInt32(numericUpDown2.Value) * classSQL.intPocetNaStranu) - classSQL.intPocetNaStranu;
@@ -6041,6 +6064,7 @@ namespace Mip
dataGridView12.Columns["PocetSegmentov"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCellsExceptHeader;
dataGridView12.Columns["IDVyrobok"].HeaderText = "ID výrobok";
dataGridView12.Columns["IDVyrobok"].Visible = false;
dataGridView12.Columns["RozmerPolotovaru"].HeaderText = "Rozmer polotovaru";
dataGridView12.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridView12.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
@@ -10589,5 +10613,36 @@ namespace Mip
if (e.KeyChar == '.') e.KeyChar = ',';
if (!(float.TryParse(textBox21.Text + e.KeyChar, out floatResult)) && (int)e.KeyChar != 8) e.KeyChar = '\0';
}
private void button204_Click(object sender, EventArgs e)
{
if (dataGridView12.SelectedRows.Count == 1)
{
var IDVyrobok = Convert.ToInt32(dataGridView12.SelectedRows[0].Cells["IDVyrobok"].Value);
// ulozi polotovar do tabpolotovar
var frmUlozPolotovarZVyroby = new frmUlozPolotovarZVyroby(IDVyrobok);
frmUlozPolotovarZVyroby.ShowDialog();
dataGridView12.SelectedRows[0].Cells["RozmerPolotovaru"].Value = frmUlozPolotovarZVyroby.VelkostPolotovaru;
button204.Text = "Upraviť polotovar";
frmUlozPolotovarZVyroby.Dispose();
}
}
private void dataGridView12_SelectionChanged(object sender, EventArgs e)
{
if (dataGridView12.SelectedRows.Count == 1)
{
if (dataGridView12.SelectedRows[0].Cells["RozmerPolotovaru"].Value.ToString() == string.Empty)
{
button204.Text = "Pridať polotovar";
}
else
{
button204.Text = "Upraviť polotovar";
}
}
}
}
}

280
Mip/frmUlozPolotovarZVyroby.Designer.cs generated Normal file
View File

@@ -0,0 +1,280 @@
namespace Mip
{
partial class frmUlozPolotovarZVyroby
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.numericUpDown2 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown3 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown4 = new System.Windows.Forms.NumericUpDown();
this.numericUpDown5 = new System.Windows.Forms.NumericUpDown();
this.label6 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label1.Location = new System.Drawing.Point(5, 43);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(95, 20);
this.label1.TabIndex = 0;
this.label1.Text = "Rozmer tvar";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label2.Location = new System.Drawing.Point(5, 67);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(78, 20);
this.label2.TabIndex = 1;
this.label2.Text = "Rozmer 1";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label3.Location = new System.Drawing.Point(5, 91);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(78, 20);
this.label3.TabIndex = 2;
this.label3.Text = "Rozmer 2";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label4.Location = new System.Drawing.Point(5, 115);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(78, 20);
this.label4.TabIndex = 3;
this.label4.Text = "Rozmer 3";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label5.Location = new System.Drawing.Point(5, 139);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(161, 20);
this.label5.TabIndex = 4;
this.label5.Text = "Počet Ks v polotovare";
//
// label7
//
this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label7.Location = new System.Drawing.Point(257, 42);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(147, 22);
this.label7.TabIndex = 6;
this.label7.Text = "Ø";
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label7.Click += new System.EventHandler(this.label7_Click);
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(330, 208);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 12;
this.button1.Text = "Zavrieť";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button2.Location = new System.Drawing.Point(4, 208);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(114, 23);
this.button2.TabIndex = 13;
this.button2.Text = "Uložiť polotovar";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// numericUpDown2
//
this.numericUpDown2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.numericUpDown2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.numericUpDown2.Location = new System.Drawing.Point(257, 67);
this.numericUpDown2.Maximum = new decimal(new int[] {
1000000,
0,
0,
0});
this.numericUpDown2.Name = "numericUpDown2";
this.numericUpDown2.Size = new System.Drawing.Size(147, 22);
this.numericUpDown2.TabIndex = 15;
this.numericUpDown2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.numericUpDown2.ValueChanged += new System.EventHandler(this.numericUpDown2_ValueChanged);
//
// numericUpDown3
//
this.numericUpDown3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.numericUpDown3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.numericUpDown3.Location = new System.Drawing.Point(257, 91);
this.numericUpDown3.Maximum = new decimal(new int[] {
1000000,
0,
0,
0});
this.numericUpDown3.Name = "numericUpDown3";
this.numericUpDown3.Size = new System.Drawing.Size(147, 22);
this.numericUpDown3.TabIndex = 16;
this.numericUpDown3.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.numericUpDown3.ValueChanged += new System.EventHandler(this.numericUpDown3_ValueChanged);
//
// numericUpDown4
//
this.numericUpDown4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.numericUpDown4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.numericUpDown4.Location = new System.Drawing.Point(257, 115);
this.numericUpDown4.Maximum = new decimal(new int[] {
1000000,
0,
0,
0});
this.numericUpDown4.Name = "numericUpDown4";
this.numericUpDown4.Size = new System.Drawing.Size(147, 22);
this.numericUpDown4.TabIndex = 17;
this.numericUpDown4.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.numericUpDown4.ValueChanged += new System.EventHandler(this.numericUpDown4_ValueChanged);
//
// numericUpDown5
//
this.numericUpDown5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.numericUpDown5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.numericUpDown5.Location = new System.Drawing.Point(257, 139);
this.numericUpDown5.Maximum = new decimal(new int[] {
1000000,
0,
0,
0});
this.numericUpDown5.Name = "numericUpDown5";
this.numericUpDown5.Size = new System.Drawing.Size(147, 22);
this.numericUpDown5.TabIndex = 18;
this.numericUpDown5.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.numericUpDown5.Value = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown5.ValueChanged += new System.EventHandler(this.numericUpDown5_ValueChanged);
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label6.Location = new System.Drawing.Point(4, 168);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(401, 33);
this.label6.TabIndex = 19;
this.label6.Text = "label6";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label12
//
this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label12.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
this.label12.Location = new System.Drawing.Point(5, 6);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(399, 33);
this.label12.TabIndex = 20;
this.label12.Text = "Rozmery výrobku:";
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label12.DoubleClick += new System.EventHandler(this.label12_DoubleClick);
//
// frmUlozPolotovarZVyroby
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(409, 235);
this.Controls.Add(this.label12);
this.Controls.Add(this.label6);
this.Controls.Add(this.numericUpDown5);
this.Controls.Add(this.numericUpDown4);
this.Controls.Add(this.numericUpDown3);
this.Controls.Add(this.numericUpDown2);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label7);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "frmUlozPolotovarZVyroby";
this.Text = "Uložiť polotovar...";
this.Shown += new System.EventHandler(this.frmUlozPolotovar_Shown);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown3)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown4)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.NumericUpDown numericUpDown2;
private System.Windows.Forms.NumericUpDown numericUpDown3;
private System.Windows.Forms.NumericUpDown numericUpDown4;
private System.Windows.Forms.NumericUpDown numericUpDown5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label12;
}
}

View File

@@ -0,0 +1,172 @@
using System;
using System.Data;
using System.Windows.Forms;
namespace Mip
{
public partial class frmUlozPolotovarZVyroby : Form
{
Int32 idVyrobok;
Int32 idPolotovar;
bool enableUpdate = false;
DataTable tblPolotovar;
DataTable tblVyrobok;
Int32 IDpolotovar;
string rozmertvarVyrobku;
decimal rozmer1Vyrobku;
decimal rozmer2Vyrobku;
decimal rozmer3Vyrobku;
string rozmerTvarPotovaru = "Ø";
decimal rozmer1Potovaru;
decimal rozmer2Potovaru;
decimal rozmer3Potovaru;
Int32 pocetKusovVpolotovare;
public string VelkostPolotovaru { get; set; }
public frmUlozPolotovarZVyroby(int _idVyrobok = 0, int _idPolotovar = 0)
{
idVyrobok = _idVyrobok;
idPolotovar = _idPolotovar;
string cmdPolotovar;
cmdPolotovar = $"SELECT * FROM `tabpolotovar` WHERE IDVyrobok = {idVyrobok.ToString()};";
classSQL.SQL(cmdPolotovar, out tblPolotovar);
if (tblPolotovar.Rows.Count > 0)
{
rozmerTvarPotovaru = tblPolotovar.Rows[0]["RozmerTvar"].ToString();
rozmer1Potovaru = Convert.ToInt32(tblPolotovar.Rows[0]["Rozmer1"]);
rozmer2Potovaru = Convert.ToInt32(tblPolotovar.Rows[0]["Rozmer2"]);
rozmer3Potovaru = Convert.ToInt32(tblPolotovar.Rows[0]["Rozmer3"]);
pocetKusovVpolotovare = Convert.ToInt32(tblPolotovar.Rows[0]["PocetKusovVPolotovare"]);
IDpolotovar = Convert.ToInt32(tblPolotovar.Rows[0]["IDPolotovar"].ToString());
enableUpdate = true;
}
//else
//{
// rozmerTvarPotovaru = "Ø";
//}
string cmdVyrobok;
cmdVyrobok = $"SELECT * FROM `tabvyrobok` WHERE IDVyrobok = {idVyrobok.ToString()};";
classSQL.SQL(cmdVyrobok, out tblVyrobok);
if (tblVyrobok.Rows.Count > 0)
{
rozmertvarVyrobku = tblVyrobok.Rows[0]["RozmerTvar"].ToString();
rozmer1Vyrobku = Convert.ToInt32(tblVyrobok.Rows[0]["Rozmer1"]);
rozmer2Vyrobku = Convert.ToInt32(tblVyrobok.Rows[0]["Rozmer2"]);
rozmer3Vyrobku = Convert.ToInt32(tblVyrobok.Rows[0]["Rozmer3"]);
}
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
}
private void button2_Click(object sender, EventArgs e)
{
string cmd;
if (enableUpdate == true)
{
cmd = $@"UPDATE `tabpolotovar` SET
`RozmerTvar` = '{label7.Text}',
`Rozmer1` = {numericUpDown2.Value},
`Rozmer2` = {numericUpDown3.Value},
`Rozmer3` = {numericUpDown4.Value},
`PocetKusovVPolotovare` = {numericUpDown5.Value}
WHERE IDpolotovar = {IDpolotovar.ToString()};";
classSQL.SQL(cmd);
}
else
{
cmd = $@"INSERT INTO `tabpolotovar` (`IDVyrobok`, `RozmerTvar`, `Rozmer1`, `Rozmer2`, `Rozmer3`, `PocetKusovVPolotovare`) VALUES (
{idVyrobok.ToString()},
'{label7.Text}',
{numericUpDown2.Value},
{numericUpDown3.Value},
{numericUpDown4.Value},
{numericUpDown5.Value});";
classSQL.SQL(cmd);
enableUpdate = true;
}
this.Close();
}
private void frmUlozPolotovar_Shown(object sender, EventArgs e)
{
RefreshPolotovar();
}
private void RefreshPolotovar()
{
var oddelovac = rozmertvarVyrobku == "Ø" ? "/" : "x";
label12.Text = $"Rozmery výrobku: {rozmertvarVyrobku}{rozmer1Vyrobku}{oddelovac}{rozmer2Vyrobku}{"x"}{rozmer3Vyrobku}";
label7.Text = rozmerTvarPotovaru;
numericUpDown2.Value = rozmer1Potovaru;
numericUpDown3.Value = rozmer2Potovaru;
numericUpDown4.Value = rozmer3Potovaru;
numericUpDown5.Value = pocetKusovVpolotovare;
var oddelovacPolotor = rozmerTvarPotovaru == "Ø" ? "/" : "x";
label6.Text = $"Rozmery polotovaru: {rozmerTvarPotovaru}{rozmer1Potovaru}{oddelovacPolotor}{rozmer2Potovaru}{"x"}{rozmer3Potovaru}";
VelkostPolotovaru = $"{rozmerTvarPotovaru}{rozmer1Potovaru}{oddelovacPolotor}{rozmer2Potovaru}{"x"}{rozmer3Potovaru} ({pocetKusovVpolotovare}-Ks)";
}
private void numericUpDown2_ValueChanged(object sender, EventArgs e)
{
var nud = sender as NumericUpDown;
rozmer1Potovaru = nud.Value;
RefreshPolotovar();
}
private void numericUpDown3_ValueChanged(object sender, EventArgs e)
{
var nud = sender as NumericUpDown;
rozmer2Potovaru = nud.Value;
RefreshPolotovar();
}
private void numericUpDown4_ValueChanged(object sender, EventArgs e)
{
var nud = sender as NumericUpDown;
rozmer3Potovaru = nud.Value;
RefreshPolotovar();
}
private void numericUpDown5_ValueChanged(object sender, EventArgs e)
{
var nud = sender as NumericUpDown;
pocetKusovVpolotovare = Convert.ToInt32(nud.Value);
RefreshPolotovar();
}
private void label7_Click(object sender, EventArgs e)
{
if (label7.Text == "Ø")
{
rozmerTvarPotovaru = "□";
}
else
{
rozmerTvarPotovaru = "Ø";
}
RefreshPolotovar();
}
private void label12_DoubleClick(object sender, EventArgs e)
{
label7.Text = rozmertvarVyrobku;
numericUpDown2.Value = rozmer1Vyrobku;
numericUpDown3.Value = rozmer2Vyrobku;
numericUpDown4.Value = rozmer3Vyrobku;
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>