editacia vyrobku
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,3 +11,4 @@ Mip/obj/Debug/Mip.pdb
|
||||
Mip/bin/
|
||||
Mip/obj/
|
||||
MipInstaller/Debug/
|
||||
/.vs/Mip_v1/v16/Server/sqlite3
|
||||
|
||||
Binary file not shown.
14
Mip/frmEditVyrobok.Designer.cs
generated
14
Mip/frmEditVyrobok.Designer.cs
generated
@@ -346,7 +346,7 @@
|
||||
this.panel1.Controls.Add(this.pictureBox1);
|
||||
this.panel1.Location = new System.Drawing.Point(3, 17);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(770, 390);
|
||||
this.panel1.Size = new System.Drawing.Size(815, 390);
|
||||
this.panel1.TabIndex = 9;
|
||||
//
|
||||
// pictureBox1
|
||||
@@ -378,7 +378,7 @@
|
||||
this.dataGridView1.ShowCellToolTips = false;
|
||||
this.dataGridView1.ShowEditingIcon = false;
|
||||
this.dataGridView1.ShowRowErrors = false;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(229, 100);
|
||||
this.dataGridView1.Size = new System.Drawing.Size(274, 100);
|
||||
this.dataGridView1.TabIndex = 4;
|
||||
this.dataGridView1.RowEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_RowEnter);
|
||||
this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
|
||||
@@ -410,7 +410,7 @@
|
||||
// button3
|
||||
//
|
||||
this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button3.Location = new System.Drawing.Point(707, 117);
|
||||
this.button3.Location = new System.Drawing.Point(752, 117);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(75, 23);
|
||||
this.button3.TabIndex = 23;
|
||||
@@ -422,7 +422,7 @@
|
||||
//
|
||||
this.button5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.button5.Enabled = false;
|
||||
this.button5.Location = new System.Drawing.Point(707, 95);
|
||||
this.button5.Location = new System.Drawing.Point(752, 95);
|
||||
this.button5.Name = "button5";
|
||||
this.button5.Size = new System.Drawing.Size(75, 23);
|
||||
this.button5.TabIndex = 24;
|
||||
@@ -438,7 +438,7 @@
|
||||
this.groupBox1.Controls.Add(this.panel1);
|
||||
this.groupBox1.Location = new System.Drawing.Point(2, 145);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(780, 413);
|
||||
this.groupBox1.Size = new System.Drawing.Size(825, 413);
|
||||
this.groupBox1.TabIndex = 19;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Zobraziť výkres";
|
||||
@@ -471,7 +471,7 @@
|
||||
this.groupBox4.Controls.Add(this.btnVymazVykres);
|
||||
this.groupBox4.Location = new System.Drawing.Point(474, 2);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(233, 140);
|
||||
this.groupBox4.Size = new System.Drawing.Size(278, 140);
|
||||
this.groupBox4.TabIndex = 21;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Načítané výkresy";
|
||||
@@ -536,7 +536,7 @@
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(784, 562);
|
||||
this.ClientSize = new System.Drawing.Size(829, 562);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.button7);
|
||||
|
||||
@@ -3424,7 +3424,8 @@ namespace Mip
|
||||
private void btnEditVyrobok_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
Form Add = new frmEditVyrobok(dGVZoznamVyrobkov.CurrentRow.Cells["IDVyrobok"].Value.ToString());
|
||||
//Form Add = new frmEditVyrobok(dGVZoznamVyrobkov.CurrentRow.Cells["IDVyrobok"].Value.ToString());
|
||||
Form Add = new frmPridatVyrobok(dGVZoznamVyrobkov.CurrentRow.Cells["Zakaznik"].Value.ToString(), dGVZoznamVyrobkov.CurrentRow.Cells["IDVyrobok"].Value.ToString());
|
||||
Add.ShowDialog();
|
||||
refreshZoznamVyrobkov();
|
||||
}
|
||||
|
||||
@@ -22,13 +22,14 @@ namespace Mip
|
||||
Single z=1;
|
||||
int sizeH;
|
||||
int sizeW;
|
||||
string IDVyrobok;
|
||||
DataTable DTVykresy = new DataTable();
|
||||
|
||||
|
||||
public frmPridatVyrobok(string strZakaznik)
|
||||
public frmPridatVyrobok(string strZakaznik, string idVyrobok = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
label2.Text = strZakaznik;
|
||||
|
||||
IDVyrobok = idVyrobok;
|
||||
this.MouseWheel += new MouseEventHandler(pictureBox1_MouseWheel);
|
||||
|
||||
}
|
||||
@@ -60,7 +61,43 @@ namespace Mip
|
||||
pomocnaDT.Columns.Add("Valid", typeof(int));
|
||||
VypisSpojenyRozmer();
|
||||
classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať iný názov");
|
||||
if (IDVyrobok != null)
|
||||
{
|
||||
LoadEditData();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadEditData()
|
||||
{
|
||||
DataTable DTEditVyrobok = new DataTable();
|
||||
//dGVZoznamVyrobkov.CurrentRow.Cells["IDVyrobok"].Value.ToString()
|
||||
|
||||
classSQL.SQL("SELECT * FROM tabvyrobok WHERE `IDVyrobok` = " + IDVyrobok + ";", out DTEditVyrobok);
|
||||
label2.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["Zakaznik"].Ordinal].ToString();
|
||||
textBox6.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["NazovVyrobku"].Ordinal].ToString();
|
||||
comboBox2.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["InyNazov"].Ordinal].ToString();
|
||||
|
||||
if (DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["RozmerTvar"].Ordinal].ToString() == "Ø") numericUpDown1.Value = 0;
|
||||
else numericUpDown1.Value = 1;
|
||||
textBox2.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["Rozmer1"].Ordinal].ToString();
|
||||
textBox3.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["Rozmer2"].Ordinal].ToString();
|
||||
textBox4.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["Rozmer3"].Ordinal].ToString();
|
||||
|
||||
textBox1.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["RozlisZnakKonecnaOp"].Ordinal].ToString();
|
||||
textBox5.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["Alias"].Ordinal].ToString();
|
||||
textBox7.Text = DTEditVyrobok.Rows[0].ItemArray[DTEditVyrobok.Columns["PocetSegmentov"].Ordinal].ToString();
|
||||
VypisSpojenyRozmer();
|
||||
|
||||
string cmd = @"SELECT `IDVyrobok`,
|
||||
`IndexVykresu`,
|
||||
`IndexVykresu` AS `OldIndexVykresu`,
|
||||
'Z databázy SQL' AS `Názov`,
|
||||
'-' AS `Cesta`,
|
||||
`IDVykres`,
|
||||
IF (`IndexVykresu` < 100, 'Aktuálny','Neaktuálny') AS `StatusVykresu`
|
||||
FROM `mip`.`tabvykres` WHERE `IDVyrobok` = " + IDVyrobok + " ORDER BY `IndexVykresu` ;";
|
||||
classSQL.SQL(cmd, out DTVykresy);
|
||||
dataGridView1.DataSource = DTVykresy;
|
||||
}
|
||||
|
||||
private void btnAddVykres_Click(object sender, EventArgs e)
|
||||
@@ -207,6 +244,8 @@ namespace Mip
|
||||
int fileSize;
|
||||
byte[] fileData;
|
||||
DataRow dRow;
|
||||
if (pomocnaDT.Rows.Count != 0)
|
||||
{
|
||||
dRow = pomocnaDT.Rows[index];
|
||||
|
||||
var isPdf = dRow["Typ_suboru"].ToString() == "pdf";
|
||||
@@ -251,6 +290,7 @@ namespace Mip
|
||||
|
||||
z = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user