Editácia výrovku s pdf
This commit is contained in:
Binary file not shown.
@@ -1,15 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Security.AccessControl;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Excel = Microsoft.Office.Interop.Excel;
|
||||
|
||||
@@ -137,7 +130,7 @@ namespace Mip
|
||||
cb.Items.Add(row[strCollumn].ToString());
|
||||
}
|
||||
}
|
||||
/*
|
||||
/*
|
||||
/// <summary>
|
||||
/// Naplna comboBox cb udajmi z SQL servera (viac stlpcov a vrati datasource)
|
||||
/// </summary>
|
||||
@@ -457,7 +450,7 @@ namespace Mip
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_cI>-1) _dgv.Columns[_cI].DefaultCellStyle.BackColor = Color.GreenYellow;
|
||||
if (_cI > -1) _dgv.Columns[_cI].DefaultCellStyle.BackColor = Color.GreenYellow;
|
||||
|
||||
break;
|
||||
|
||||
@@ -486,7 +479,7 @@ namespace Mip
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetServerIP ()
|
||||
public static void SetServerIP()
|
||||
{
|
||||
System.Net.NetworkInformation.Ping pingIP = new System.Net.NetworkInformation.Ping();
|
||||
string IPaddress = "";
|
||||
@@ -504,7 +497,7 @@ namespace Mip
|
||||
}
|
||||
else
|
||||
{
|
||||
IPaddress = Debugger.IsAttached? "192.168.2.13" : "192.168.1.13"; //IP Adresa MariaDB pre VLAN2
|
||||
IPaddress = Debugger.IsAttached ? "192.168.2.13" : "192.168.1.13"; //IP Adresa MariaDB pre VLAN2
|
||||
|
||||
pingReply = pingIP.Send(IPaddress);
|
||||
if (pingReply.Status.ToString() == "Success")
|
||||
@@ -514,7 +507,8 @@ namespace Mip
|
||||
else
|
||||
{
|
||||
|
||||
IPaddress = "127.0.0.1";
|
||||
//IPaddress = "127.0.0.1";
|
||||
IPaddress = "192.168.1.11";
|
||||
pingReply = pingIP.Send(IPaddress);
|
||||
if (pingReply.Status.ToString() == "Success")
|
||||
{
|
||||
@@ -666,7 +660,7 @@ namespace Mip
|
||||
break;
|
||||
|
||||
case "Ziadanka-zobrazit vsetky":
|
||||
switch(_IDUSER)
|
||||
switch (_IDUSER)
|
||||
{
|
||||
case 1:
|
||||
case 4:
|
||||
@@ -724,7 +718,7 @@ namespace Mip
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
default:
|
||||
bReturnValue = false;
|
||||
break;
|
||||
|
||||
|
||||
66
Mip/frmEditVyrobok.Designer.cs
generated
66
Mip/frmEditVyrobok.Designer.cs
generated
@@ -98,9 +98,9 @@
|
||||
this.groupBox3.Controls.Add(this.label4);
|
||||
this.groupBox3.Controls.Add(this.numericUpDown1);
|
||||
this.groupBox3.Controls.Add(this.label3);
|
||||
this.groupBox3.Location = new System.Drawing.Point(234, 2);
|
||||
this.groupBox3.Location = new System.Drawing.Point(236, 7);
|
||||
this.groupBox3.Name = "groupBox3";
|
||||
this.groupBox3.Size = new System.Drawing.Size(239, 140);
|
||||
this.groupBox3.Size = new System.Drawing.Size(251, 146);
|
||||
this.groupBox3.TabIndex = 18;
|
||||
this.groupBox3.TabStop = false;
|
||||
this.groupBox3.Text = "Tvar a rozmery výrobku";
|
||||
@@ -109,7 +109,7 @@
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(116, 121);
|
||||
this.label1.Location = new System.Drawing.Point(124, 121);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(93, 13);
|
||||
this.label1.TabIndex = 15;
|
||||
@@ -117,7 +117,7 @@
|
||||
//
|
||||
// textBox7
|
||||
//
|
||||
this.textBox7.Location = new System.Drawing.Point(212, 118);
|
||||
this.textBox7.Location = new System.Drawing.Point(219, 118);
|
||||
this.textBox7.Name = "textBox7";
|
||||
this.textBox7.Size = new System.Drawing.Size(25, 20);
|
||||
this.textBox7.TabIndex = 16;
|
||||
@@ -144,7 +144,7 @@
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
this.textBox4.Location = new System.Drawing.Point(177, 54);
|
||||
this.textBox4.Location = new System.Drawing.Point(181, 54);
|
||||
this.textBox4.Name = "textBox4";
|
||||
this.textBox4.Size = new System.Drawing.Size(60, 20);
|
||||
this.textBox4.TabIndex = 13;
|
||||
@@ -153,14 +153,14 @@
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
this.textBox5.Location = new System.Drawing.Point(34, 118);
|
||||
this.textBox5.Location = new System.Drawing.Point(37, 118);
|
||||
this.textBox5.Name = "textBox5";
|
||||
this.textBox5.Size = new System.Drawing.Size(83, 20);
|
||||
this.textBox5.TabIndex = 3;
|
||||
//
|
||||
// textBox3
|
||||
//
|
||||
this.textBox3.Location = new System.Drawing.Point(112, 54);
|
||||
this.textBox3.Location = new System.Drawing.Point(116, 54);
|
||||
this.textBox3.Name = "textBox3";
|
||||
this.textBox3.Size = new System.Drawing.Size(60, 20);
|
||||
this.textBox3.TabIndex = 12;
|
||||
@@ -169,7 +169,7 @@
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
this.textBox2.Location = new System.Drawing.Point(47, 54);
|
||||
this.textBox2.Location = new System.Drawing.Point(51, 54);
|
||||
this.textBox2.Name = "textBox2";
|
||||
this.textBox2.Size = new System.Drawing.Size(60, 20);
|
||||
this.textBox2.TabIndex = 11;
|
||||
@@ -180,7 +180,7 @@
|
||||
//
|
||||
this.textBox1.Location = new System.Drawing.Point(3, 94);
|
||||
this.textBox1.Name = "textBox1";
|
||||
this.textBox1.Size = new System.Drawing.Size(234, 20);
|
||||
this.textBox1.Size = new System.Drawing.Size(241, 20);
|
||||
this.textBox1.TabIndex = 10;
|
||||
this.textBox1.TextAlignChanged += new System.EventHandler(this.textBox1_TextAlignChanged);
|
||||
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
|
||||
@@ -207,7 +207,7 @@
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(189, 38);
|
||||
this.label6.Location = new System.Drawing.Point(193, 38);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(35, 13);
|
||||
this.label6.TabIndex = 4;
|
||||
@@ -217,7 +217,7 @@
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(126, 38);
|
||||
this.label5.Location = new System.Drawing.Point(130, 38);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(31, 13);
|
||||
this.label5.TabIndex = 3;
|
||||
@@ -227,7 +227,7 @@
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(60, 38);
|
||||
this.label4.Location = new System.Drawing.Point(64, 38);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(34, 13);
|
||||
this.label4.TabIndex = 2;
|
||||
@@ -325,7 +325,7 @@
|
||||
//
|
||||
this.btnVymazVykres.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnVymazVykres.Enabled = false;
|
||||
this.btnVymazVykres.Location = new System.Drawing.Point(103, 115);
|
||||
this.btnVymazVykres.Location = new System.Drawing.Point(103, 123);
|
||||
this.btnVymazVykres.Name = "btnVymazVykres";
|
||||
this.btnVymazVykres.Size = new System.Drawing.Size(58, 23);
|
||||
this.btnVymazVykres.TabIndex = 8;
|
||||
@@ -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(815, 390);
|
||||
this.panel1.Size = new System.Drawing.Size(1170, 402);
|
||||
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(274, 100);
|
||||
this.dataGridView1.Size = new System.Drawing.Size(599, 108);
|
||||
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);
|
||||
@@ -388,7 +388,7 @@
|
||||
// btnAddVykres
|
||||
//
|
||||
this.btnAddVykres.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAddVykres.Location = new System.Drawing.Point(46, 115);
|
||||
this.btnAddVykres.Location = new System.Drawing.Point(46, 123);
|
||||
this.btnAddVykres.Name = "btnAddVykres";
|
||||
this.btnAddVykres.Size = new System.Drawing.Size(58, 23);
|
||||
this.btnAddVykres.TabIndex = 5;
|
||||
@@ -399,9 +399,9 @@
|
||||
// button7
|
||||
//
|
||||
this.button7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.button7.Location = new System.Drawing.Point(180, 108);
|
||||
this.button7.Location = new System.Drawing.Point(180, 119);
|
||||
this.button7.Name = "button7";
|
||||
this.button7.Size = new System.Drawing.Size(51, 34);
|
||||
this.button7.Size = new System.Drawing.Size(51, 28);
|
||||
this.button7.TabIndex = 26;
|
||||
this.button7.Text = "Zoom -";
|
||||
this.button7.UseVisualStyleBackColor = true;
|
||||
@@ -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(752, 117);
|
||||
this.button3.Location = new System.Drawing.Point(1100, 128);
|
||||
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(752, 95);
|
||||
this.button5.Location = new System.Drawing.Point(1100, 102);
|
||||
this.button5.Name = "button5";
|
||||
this.button5.Size = new System.Drawing.Size(75, 23);
|
||||
this.button5.TabIndex = 24;
|
||||
@@ -436,13 +436,12 @@
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.groupBox1.Controls.Add(this.panel1);
|
||||
this.groupBox1.Location = new System.Drawing.Point(2, 145);
|
||||
this.groupBox1.Location = new System.Drawing.Point(2, 151);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(825, 413);
|
||||
this.groupBox1.Size = new System.Drawing.Size(1180, 425);
|
||||
this.groupBox1.TabIndex = 19;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Zobraziť výkres";
|
||||
this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter);
|
||||
//
|
||||
// groupBox5
|
||||
//
|
||||
@@ -454,7 +453,7 @@
|
||||
this.groupBox5.Controls.Add(this.label7);
|
||||
this.groupBox5.Location = new System.Drawing.Point(1, 44);
|
||||
this.groupBox5.Name = "groupBox5";
|
||||
this.groupBox5.Size = new System.Drawing.Size(232, 62);
|
||||
this.groupBox5.Size = new System.Drawing.Size(232, 74);
|
||||
this.groupBox5.TabIndex = 22;
|
||||
this.groupBox5.TabStop = false;
|
||||
this.groupBox5.Text = "Názov výrobku";
|
||||
@@ -469,9 +468,9 @@
|
||||
this.groupBox4.Controls.Add(this.dataGridView1);
|
||||
this.groupBox4.Controls.Add(this.btnAddVykres);
|
||||
this.groupBox4.Controls.Add(this.btnVymazVykres);
|
||||
this.groupBox4.Location = new System.Drawing.Point(474, 2);
|
||||
this.groupBox4.Location = new System.Drawing.Point(489, 7);
|
||||
this.groupBox4.Name = "groupBox4";
|
||||
this.groupBox4.Size = new System.Drawing.Size(278, 140);
|
||||
this.groupBox4.Size = new System.Drawing.Size(603, 148);
|
||||
this.groupBox4.TabIndex = 21;
|
||||
this.groupBox4.TabStop = false;
|
||||
this.groupBox4.Text = "Načítané výkresy";
|
||||
@@ -479,7 +478,7 @@
|
||||
// btnAktualVykres
|
||||
//
|
||||
this.btnAktualVykres.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnAktualVykres.Location = new System.Drawing.Point(160, 115);
|
||||
this.btnAktualVykres.Location = new System.Drawing.Point(160, 123);
|
||||
this.btnAktualVykres.Name = "btnAktualVykres";
|
||||
this.btnAktualVykres.Size = new System.Drawing.Size(72, 23);
|
||||
this.btnAktualVykres.TabIndex = 28;
|
||||
@@ -491,7 +490,7 @@
|
||||
//
|
||||
this.btnIndexDwn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnIndexDwn.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.btnIndexDwn.Location = new System.Drawing.Point(24, 115);
|
||||
this.btnIndexDwn.Location = new System.Drawing.Point(24, 123);
|
||||
this.btnIndexDwn.Name = "btnIndexDwn";
|
||||
this.btnIndexDwn.Size = new System.Drawing.Size(23, 23);
|
||||
this.btnIndexDwn.TabIndex = 29;
|
||||
@@ -503,7 +502,7 @@
|
||||
//
|
||||
this.btnIndexUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.btnIndexUp.Font = new System.Drawing.Font("Calibri", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.btnIndexUp.Location = new System.Drawing.Point(2, 115);
|
||||
this.btnIndexUp.Location = new System.Drawing.Point(2, 123);
|
||||
this.btnIndexUp.Name = "btnIndexUp";
|
||||
this.btnIndexUp.Size = new System.Drawing.Size(23, 23);
|
||||
this.btnIndexUp.TabIndex = 28;
|
||||
@@ -514,7 +513,7 @@
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.label2);
|
||||
this.groupBox2.Location = new System.Drawing.Point(1, 2);
|
||||
this.groupBox2.Location = new System.Drawing.Point(2, 7);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(232, 41);
|
||||
this.groupBox2.TabIndex = 20;
|
||||
@@ -524,9 +523,9 @@
|
||||
// button6
|
||||
//
|
||||
this.button6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
||||
this.button6.Location = new System.Drawing.Point(130, 108);
|
||||
this.button6.Location = new System.Drawing.Point(130, 119);
|
||||
this.button6.Name = "button6";
|
||||
this.button6.Size = new System.Drawing.Size(51, 34);
|
||||
this.button6.Size = new System.Drawing.Size(51, 28);
|
||||
this.button6.TabIndex = 25;
|
||||
this.button6.Text = "Zoom +";
|
||||
this.button6.UseVisualStyleBackColor = true;
|
||||
@@ -536,7 +535,8 @@
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(829, 562);
|
||||
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.ClientSize = new System.Drawing.Size(1184, 574);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.button7);
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
//using Syncfusion.Pdf.Parsing;
|
||||
using Syncfusion.Pdf.Parsing;
|
||||
//using System.Windows.Media.Imaging;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Mip
|
||||
{
|
||||
@@ -63,19 +61,19 @@ namespace Mip
|
||||
public void VypisSpojenyRozmer()
|
||||
{
|
||||
string strSpojeny = "";
|
||||
string strKonZnak ="";
|
||||
string strKonZnak = "";
|
||||
|
||||
if (textBox2.Text != "")
|
||||
{
|
||||
if(textBox1.Text =="") strKonZnak = "";
|
||||
else strKonZnak = " -" + textBox1.Text ;
|
||||
if (textBox1.Text == "") strKonZnak = "";
|
||||
else strKonZnak = " -" + textBox1.Text;
|
||||
|
||||
if (numericUpDown1.Value == 0)
|
||||
{
|
||||
if (textBox3.Text != "" && textBox3.Text != "0") strSpojeny = label10.Text + textBox2.Text + "/" + textBox3.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
if (textBox3.Text != "" && textBox3.Text != "0") strSpojeny = label10.Text + textBox2.Text + "/" + textBox3.Text + "x" + textBox4.Text + strKonZnak;
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox4.Text + strKonZnak;
|
||||
}
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox3.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox3.Text + "x" + textBox4.Text + strKonZnak;
|
||||
}
|
||||
else strSpojeny = "";
|
||||
label12.Text = strSpojeny;
|
||||
@@ -159,9 +157,11 @@ namespace Mip
|
||||
DataRow[] foundRows;
|
||||
openFileDialog1.Multiselect = false;
|
||||
openFileDialog1.DefaultExt = "jpg";
|
||||
openFileDialog1.Filter = "Obrázky (*.BMP;*.JPG;*.JPEG;*.GIF;*.PNG;*.EXIF;*.TIFF)|*.BMP;*.JPG;*.JPEG;*.GIF;*.PNG;*.EXIF;*.TIFF|" + "Pdf súbory (*.pdf)|*.pdf";
|
||||
openFileDialog1.FilterIndex = 1;
|
||||
openFileDialog1.FileName = "";
|
||||
openFileDialog1.ShowDialog();
|
||||
int _index=0;
|
||||
int _index = 0;
|
||||
if (openFileDialog1.FileNames != null && openFileDialog1.FileName != "")
|
||||
{
|
||||
foreach (string FN in openFileDialog1.FileNames)
|
||||
@@ -187,7 +187,7 @@ namespace Mip
|
||||
DTVykresy.Select("IndexVykresu<100", "IndexVykresu DESC");
|
||||
|
||||
//ŠTVRTOK
|
||||
_index=Convert.ToInt16(foundRows[0].ItemArray[1].ToString())+1;
|
||||
_index = Convert.ToInt16(foundRows[0].ItemArray[1].ToString()) + 1;
|
||||
|
||||
|
||||
DTVykresy.Rows.Add(dataGridView1.Rows[0].Cells["IDVyrobok"].Value.ToString(), //IDVyrobok
|
||||
@@ -202,30 +202,16 @@ namespace Mip
|
||||
dataGridView1.DataSource = DTVykresy;
|
||||
dataGridView1.AutoResizeColumns();
|
||||
dataGridView1.AutoResizeRows();
|
||||
//dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true;
|
||||
//obrazok_Refresh(dataGridView1.Rows.Count - 1);
|
||||
if (dataGridView1.Rows.Count > 4) dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows.Count - 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Súbor: " + FN + "\n už v zozname figuruje!", "Upozornenie ...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
//MessageBox.Show(
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Zoradiť tabulku po pridani noveho výkresu a nastavenie selectu nan (POZOR môžu tam byť neaktívne výkresy)
|
||||
|
||||
|
||||
|
||||
DataTable pomocDTable = new DataTable();
|
||||
pomocDTable = DTVykresy.Copy();
|
||||
/*foreach (DataRow DT in DTVykresy.Rows)
|
||||
{
|
||||
DataRow pomocDT = DT;
|
||||
pomocDTable.ImportRow(pomocDT);
|
||||
}
|
||||
*/
|
||||
dataGridView1.DataSource = pomocDTable;
|
||||
|
||||
foundRows = pomocDTable.Select("", "IndexVykresu");
|
||||
@@ -236,16 +222,13 @@ namespace Mip
|
||||
|
||||
dataGridView1.DataSource = DTVykresy;
|
||||
//Nastavenie selectu na pridaný rows
|
||||
int a=0;
|
||||
int a = 0;
|
||||
|
||||
for (int p1 = 0; p1 < DTVykresy.Rows.Count;p1++ )
|
||||
for (int p1 = 0; p1 < DTVykresy.Rows.Count; p1++)
|
||||
{
|
||||
DataRow DT;
|
||||
DT = DTVykresy.Rows[p1];
|
||||
if (Convert.ToInt32(DT["IndexVykresu"].ToString()) == _index) a=p1;
|
||||
|
||||
|
||||
|
||||
if (Convert.ToInt32(DT["IndexVykresu"].ToString()) == _index) a = p1;
|
||||
}
|
||||
|
||||
dataGridView1.Rows[a].Selected = true;
|
||||
@@ -253,52 +236,19 @@ namespace Mip
|
||||
|
||||
pictureBox1.Visible = true;
|
||||
btnIndexDwn.Enabled = false; btnAktualVykres.Enabled = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//dataGridView1_SelectionChanged(sender,e);
|
||||
}//
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void obrazok_Refresh(int index)
|
||||
{
|
||||
obrazok_Refresh2(index);
|
||||
|
||||
/*
|
||||
FileStream fs;
|
||||
int fileSize;
|
||||
byte[] fileData;
|
||||
|
||||
//DataRow dRow;
|
||||
//fs = new FileStream(dRow["Cesta"].ToString(), FileMode.Open, FileAccess.Read);//
|
||||
fileSize = (int)fs.Length;
|
||||
fileData = new byte[fileSize];
|
||||
fs.Read(fileData, 0, fileSize);
|
||||
fs.Close();
|
||||
|
||||
Bitmap obrazok;
|
||||
//using (MemoryStream stream = new MemoryStream(fileData)) obrazok = new Bitmap(stream);
|
||||
MemoryStream stream = new MemoryStream(fileData);
|
||||
obrazok = new Bitmap(stream);
|
||||
pictureBox1.Image = obrazok;
|
||||
pictureBox1.Height = obrazok.Height;
|
||||
pictureBox1.Width = obrazok.Width;
|
||||
sizeH = pictureBox1.Image.Size.Height;
|
||||
sizeW = pictureBox1.Image.Size.Width;
|
||||
z = 1;
|
||||
* */
|
||||
}
|
||||
|
||||
private void obrazok_Refresh2(int _index)
|
||||
{
|
||||
|
||||
DataRow dRow;
|
||||
int indexvSQL=0;
|
||||
string typ="";
|
||||
int indexvSQL = 0;
|
||||
string typ = "";
|
||||
|
||||
dRow = DTVykresy.Rows[_index];
|
||||
dRow = DTVykresy.Rows[index];
|
||||
typ = dRow["Názov"].ToString();
|
||||
|
||||
if (typ == "Z databázy SQL")
|
||||
@@ -313,28 +263,42 @@ namespace Mip
|
||||
sizeH = pictureBox1.Image.Size.Height;
|
||||
sizeW = pictureBox1.Image.Size.Width;
|
||||
z = 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (typ != "Z databázy SQL" && typ!="")
|
||||
if (typ != "Z databázy SQL" && typ != "")
|
||||
{
|
||||
FileStream fs;
|
||||
int fileSize;
|
||||
byte[] fileData;
|
||||
//DataRow dRow;
|
||||
|
||||
//dRow = DTVykresy.Rows[_index];
|
||||
var ExtensionStart = typ.LastIndexOf(".") + 1;
|
||||
var Extension = typ.Substring(ExtensionStart, typ.Length - ExtensionStart);
|
||||
|
||||
fs = new FileStream(dRow["Cesta"].ToString(), FileMode.Open, FileAccess.Read);//
|
||||
fileSize = (int)fs.Length;
|
||||
fileData = new byte[fileSize];
|
||||
fs.Read(fileData, 0, fileSize);
|
||||
|
||||
var fileToShow = new byte[fileSize];
|
||||
|
||||
if (Extension.ToLower() == "pdf")
|
||||
{
|
||||
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(fileData);
|
||||
Bitmap pdfToJpeg = loadedDocument.ExportAsImage(0);
|
||||
loadedDocument.Close(true);
|
||||
|
||||
fileToShow = SaveAsJpeg(pdfToJpeg);
|
||||
}
|
||||
else
|
||||
{
|
||||
fileToShow = fileData;
|
||||
}
|
||||
|
||||
fs.Close();
|
||||
|
||||
Bitmap obrazok;
|
||||
//using (MemoryStream stream = new MemoryStream(fileData)) obrazok = new Bitmap(stream);
|
||||
MemoryStream stream = new MemoryStream(fileData);
|
||||
obrazok = new Bitmap(stream);
|
||||
MemoryStream stream = new MemoryStream(fileToShow);
|
||||
var obrazok = new Bitmap(stream);
|
||||
pictureBox1.Image = obrazok;
|
||||
pictureBox1.Height = obrazok.Height;
|
||||
pictureBox1.Width = obrazok.Width;
|
||||
@@ -344,9 +308,21 @@ namespace Mip
|
||||
}
|
||||
}
|
||||
|
||||
private byte[] SaveAsJpeg(Bitmap image)
|
||||
{
|
||||
byte[] returnImageData;
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
|
||||
returnImageData = stream.ToArray();
|
||||
}
|
||||
|
||||
return returnImageData;
|
||||
}
|
||||
|
||||
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (dataGridView1.DataSource != null && dataGridView1.SelectedRows.Count>0 && deleteRow!=true )
|
||||
if (dataGridView1.DataSource != null && dataGridView1.SelectedRows.Count > 0 && deleteRow != true)
|
||||
{
|
||||
|
||||
|
||||
@@ -434,18 +410,12 @@ namespace Mip
|
||||
//dataGridView1.DataSource=DTVykresy();
|
||||
for (int p1 = 0; p1 < DTVykresy.Rows.Count; p1++)
|
||||
{
|
||||
if (Convert.ToInt32( dataGridView1.Rows[p1].Cells["IndexVykresu"].Value.ToString())== indexvykresu)
|
||||
if (Convert.ToInt32(dataGridView1.Rows[p1].Cells["IndexVykresu"].Value.ToString()) == indexvykresu)
|
||||
{
|
||||
dataGridView1.Rows[p1].Selected=true;
|
||||
dataGridView1.Rows[p1].Selected = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -458,7 +428,6 @@ namespace Mip
|
||||
{
|
||||
|
||||
DataGridViewRow Row;
|
||||
//Row = dataGridView1.Rows[dataGridView1.CurrentRow.Index];
|
||||
Row = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index];
|
||||
|
||||
//Pre aktuálne výkresy nastav NEAKTUÁLNY
|
||||
@@ -492,32 +461,15 @@ namespace Mip
|
||||
DTVykresy.Rows[dataGridView1.SelectedRows[0].Index]["IndexVykresu"] = indexLastActiv + 1;
|
||||
zoradDTGView();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
DataRow[] foundRows;
|
||||
foundRows = DTVykresy.Select("IndexVykresu>100", "IndexVykresu DESC");
|
||||
if (foundRows.Length == 0) DTVykresy.Rows[dataGridView1.CurrentRow.Index]["IndexVykresu"] = 101;
|
||||
else DTVykresy.Rows[dataGridView1.CurrentRow.Index]["IndexVykresu"] = Convert.ToInt32(foundRows[0].ItemArray[1].ToString()) + 1;
|
||||
DTVykresy.Rows[dataGridView1.CurrentRow.Index]["StatusVykresu"] = "NEAKTUÁLNY";
|
||||
|
||||
foundRows = DTVykresy.Select("", "IndexVykresu");
|
||||
*/
|
||||
}
|
||||
|
||||
private void btnIndexUp_Click(object sender, EventArgs e)
|
||||
{
|
||||
int oldindexvykresu;
|
||||
|
||||
oldindexvykresu = Convert.ToInt32(dataGridView1["IndexVykresu", (dataGridView1.SelectedRows[0].Index)].Value);
|
||||
//dataGridView1["IndexVykresu", (dataGridView1.SelectedRows[0].Index)].Value = dataGridView1["IndexVykresu", (dataGridView1.SelectedRows[0].Index) - 1].Value;
|
||||
//dataGridView1["IndexVykresu", (dataGridView1.SelectedRows[0].Index) - 1].Value = oldindexvykresu;
|
||||
|
||||
DTVykresy.Rows[dataGridView1.SelectedRows[0].Index]["IndexVykresu"] = DTVykresy.Rows[dataGridView1.SelectedRows[0].Index-1]["IndexVykresu"];
|
||||
DTVykresy.Rows[dataGridView1.SelectedRows[0].Index]["IndexVykresu"] = DTVykresy.Rows[dataGridView1.SelectedRows[0].Index - 1]["IndexVykresu"];
|
||||
DTVykresy.Rows[dataGridView1.SelectedRows[0].Index - 1]["IndexVykresu"] = oldindexvykresu;
|
||||
zoradDTGView();
|
||||
|
||||
@@ -526,10 +478,7 @@ namespace Mip
|
||||
private void btnIndexDwn_Click(object sender, EventArgs e)
|
||||
{
|
||||
int oldindexvykresu;
|
||||
|
||||
oldindexvykresu = Convert.ToInt32(dataGridView1["IndexVykresu", (dataGridView1.SelectedRows[0].Index)].Value);
|
||||
//dataGridView1["IndexVykresu", (dataGridView1.SelectedRows[0].Index)].Value = dataGridView1["IndexVykresu", (dataGridView1.SelectedRows[0].Index) + 1].Value;
|
||||
//dataGridView1["IndexVykresu", (dataGridView1.SelectedRows[0].Index) + 1].Value = oldindexvykresu;
|
||||
|
||||
DTVykresy.Rows[dataGridView1.SelectedRows[0].Index]["IndexVykresu"] = DTVykresy.Rows[dataGridView1.SelectedRows[0].Index + 1]["IndexVykresu"];
|
||||
DTVykresy.Rows[dataGridView1.SelectedRows[0].Index + 1]["IndexVykresu"] = oldindexvykresu;
|
||||
@@ -561,80 +510,32 @@ namespace Mip
|
||||
{
|
||||
string cmd;
|
||||
DataTable dtbl;
|
||||
|
||||
|
||||
|
||||
classGlobal.strNovyPomocnyUdaj = textBox6.Text; //pomocný údaj pre naplnenie comboboxu po zavreti okna
|
||||
|
||||
if (textBox7.Text == "") textBox7.Text = "1"; // Ak je pocet segmentov "" tak potom je 1
|
||||
/* MENIME NA UPDATE
|
||||
cmd = "INSERT INTO `mip`.`tabvyrobok` (`NazovVyrobku`, `RozmerTvar`, `Rozmer1`, `Rozmer2`, `Rozmer3`, `SpojeneRozmery`, `Zakaznik`, `InyNazov`, `RozlisZnakKonecnaOp`, `Alias`,`PocetSegmentov`) VALUES ('"
|
||||
+ textBox6.Text.ToString() + "', '" //NazovVyrobku*
|
||||
+ label10.Text.ToString() + "', " //RozmerTvar
|
||||
+ textBox2.Text.ToString().Replace(",",".") + ", " //rozmer1
|
||||
+ textBox3.Text.ToString().Replace(",", ".") + "," //rozmer2
|
||||
+ textBox4.Text.ToString().Replace(",", ".") + ", '" //rozmer3
|
||||
+ label12.Text.ToString() + "', '" //spojene rozmery*
|
||||
+ label2.Text.ToString() + "', '" //zakaznik*
|
||||
+ comboBox2.Text.ToString() + "', '" //Iny nazov*
|
||||
+ textBox1.Text.ToString() + "', '" //rozlis znak alebo konecna operacia*
|
||||
+ textBox5.Text.ToString() + "', " //alias*
|
||||
+ textBox7.Text.ToString() + ");"; //Pocet segmetnov
|
||||
|
||||
|
||||
dtbl=classSQL.commandSQL(cmd,1);
|
||||
*/
|
||||
|
||||
|
||||
|
||||
cmd = @"UPDATE `mip`.`tabvyrobok` SET "
|
||||
+ "`NazovVyrobku`='" + textBox6.Text.ToString() + "'," //NazovVyrobku*
|
||||
+ "`RozmerTvar`='" + label10.Text.ToString() + "'," //RozmerTvar
|
||||
+"`Rozmer1`=" + textBox2.Text.ToString().Replace(",", ".") + "," //rozmer1
|
||||
+"`Rozmer2`=" + textBox3.Text.ToString().Replace(",", ".") + "," //rozmer2
|
||||
+"`Rozmer3`=" + textBox4.Text.ToString().Replace(",", ".") + "," //rozmer3
|
||||
+ "`Rozmer1`=" + textBox2.Text.ToString().Replace(",", ".") + "," //rozmer1
|
||||
+ "`Rozmer2`=" + textBox3.Text.ToString().Replace(",", ".") + "," //rozmer2
|
||||
+ "`Rozmer3`=" + textBox4.Text.ToString().Replace(",", ".") + "," //rozmer3
|
||||
+ "`SpojeneRozmery`='" + label12.Text.ToString() + "'," //Spojené rozmery*
|
||||
+ "`Zakaznik`='" + label2.Text.ToString() + "'," //zakaznik*
|
||||
+ "`InyNazov`='" + comboBox2.Text.ToString() + "'," //Iny nazov*
|
||||
+ "`RozlisZnakKonecnaOp`='" + textBox1.Text.ToString() + "'," //rozlis znak alebo konecna operacia*
|
||||
+ "`Alias`='" + textBox5.Text.ToString() + "'," //alias*
|
||||
+"`PocetSegmentov`=" + textBox7.Text.ToString() //pocet segmentnov
|
||||
+ "`PocetSegmentov`=" + textBox7.Text.ToString() //pocet segmentnov
|
||||
+ " WHERE (`IDVyrobok`="
|
||||
+ IDVyrobok+");";
|
||||
+ IDVyrobok + ");";
|
||||
|
||||
classSQL.SQL(cmd,out dtbl);
|
||||
|
||||
|
||||
//================== Zistuje IDVykresu podla PridatVykres ======================================
|
||||
/*
|
||||
// <Pridať výkresovú dokumentáciu do tabvykresy>
|
||||
int intIDVyrobok;
|
||||
//classSQL.commandSQL("SELECT `IDVyrobok` FROM `mip`.`tabvyrobok` WHERE `Zakaznik`= '" + label2.Text + "';");
|
||||
// IDVyrobok = (int)classSQL.dTable.Rows[0]["IDVyrobok"];
|
||||
|
||||
string ccmmdd = "SELECT `NazovVyrobku`,`IDVyrobok` FROM `mip`.`tabvyrobok` WHERE `Zakaznik`= '" + label2.Text
|
||||
+ "' AND `NazovVyrobku` = '" + textBox6.Text + "';";
|
||||
|
||||
dtbl=classSQL.commandSQL(ccmmdd,1);
|
||||
DataRow dtrw = dtbl.Rows[0];
|
||||
intIDVyrobok = Convert.ToInt32(dtrw["IDVyrobok"].ToString());
|
||||
*/
|
||||
classSQL.SQL(cmd, out dtbl);
|
||||
|
||||
int intIDVyrobok;
|
||||
DataRow dtrw;
|
||||
|
||||
intIDVyrobok = Convert.ToInt32(IDVyrobok);
|
||||
|
||||
/*
|
||||
string ccmmdd = "SELECT `NazovVyrobku`,`IDVyrobok` FROM `mip`.`tabvyrobok` WHERE `Zakaznik`= '" + label2.Text
|
||||
+ "' AND `NazovVyrobku` = '" + textBox6.Text + "';";
|
||||
|
||||
dtbl = classSQL.commandSQL(ccmmdd, 1);
|
||||
DataRow dtrw = dtbl.Rows[0];
|
||||
*/
|
||||
|
||||
|
||||
for (int p1=0; p1 < DTVykresy.Rows.Count; p1++)
|
||||
for (int p1 = 0; p1 < DTVykresy.Rows.Count; p1++)
|
||||
{
|
||||
FileStream fs;
|
||||
int fileSize;
|
||||
@@ -650,12 +551,11 @@ namespace Mip
|
||||
cmd = @"UPDATE `mip`.`tabvykres` SET "
|
||||
+ "`IndexVykresu`=" + Convert.ToInt32(dtrw["IndexVykresu"].ToString())
|
||||
+ " WHERE (`IDVykres`="
|
||||
+ Convert.ToInt32(dtrw["IDVykres"].ToString()) + ");" ;
|
||||
+ Convert.ToInt32(dtrw["IDVykres"].ToString()) + ");";
|
||||
|
||||
classSQL.SQL(cmd, out dtbl);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -663,13 +563,27 @@ namespace Mip
|
||||
fileSize = (int)fs.Length;
|
||||
VykresData = new byte[fileSize];
|
||||
fs.Read(VykresData, 0, fileSize);
|
||||
fs.Close();
|
||||
classSQL.SaveVykresToSQL(intIDVyrobok, Convert.ToInt32(dtrw["IndexVykresu"].ToString()), VykresData);
|
||||
|
||||
var ExtensionStart = dtrw["Cesta"].ToString().LastIndexOf(".") + 1;
|
||||
var Extension = dtrw["Cesta"].ToString().Substring(ExtensionStart, dtrw["Cesta"].ToString().Length - ExtensionStart);
|
||||
|
||||
var fileToShow = new byte[fileSize];
|
||||
if (Extension.ToLower() == "pdf")
|
||||
{
|
||||
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(VykresData);
|
||||
Bitmap pdfToJpeg = loadedDocument.ExportAsImage(0);
|
||||
loadedDocument.Close(true);
|
||||
|
||||
fileToShow = SaveAsJpeg(pdfToJpeg);
|
||||
}
|
||||
else
|
||||
{
|
||||
fileToShow = VykresData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
fs.Close();
|
||||
classSQL.SaveVykresToSQL(intIDVyrobok, Convert.ToInt32(dtrw["IndexVykresu"].ToString()), fileToShow);
|
||||
}
|
||||
}
|
||||
|
||||
MessageBox.Show("Výrobok úspešne aktualizovaný!");
|
||||
|
||||
214
Mip/frmMain.cs
214
Mip/frmMain.cs
@@ -1,29 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using Excel = Microsoft.Office.Interop.Excel;
|
||||
using System.Globalization;
|
||||
using MonthCalendar;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Drawing.Printing;
|
||||
using System.Diagnostics;
|
||||
using GMap.NET;
|
||||
using GMap.NET;
|
||||
using GMap.NET.MapProviders;
|
||||
using GMap.NET.WindowsForms;
|
||||
using GMap.NET.WindowsForms.Markers;
|
||||
using GMap.NET.WindowsForms.ToolTips;
|
||||
using System.Windows.Documents;
|
||||
using MonthCalendar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Configuration;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Windows.Forms;
|
||||
using Excel = Microsoft.Office.Interop.Excel;
|
||||
|
||||
namespace Mip
|
||||
{
|
||||
@@ -217,7 +208,7 @@ namespace Mip
|
||||
{
|
||||
string strBack;
|
||||
string cmd = "SELECT ROUND (POWER (" + textBox1.Text.ToString().Replace(",", ".") + ", 2),5);";
|
||||
classSQL.SQL(cmd,out strBack);
|
||||
classSQL.SQL(cmd, out strBack);
|
||||
|
||||
textBox1.Text = "";
|
||||
SendKeys.Send(strBack);
|
||||
@@ -227,7 +218,7 @@ namespace Mip
|
||||
{
|
||||
string strBack;
|
||||
string cmd = "SELECT ROUND (POWER (" + textBox1.SelectedText.ToString().Replace(",", ".") + ", 2),5);";
|
||||
classSQL.SQL(cmd,out strBack);
|
||||
classSQL.SQL(cmd, out strBack);
|
||||
|
||||
SendKeys.Send(strBack);
|
||||
}
|
||||
@@ -583,7 +574,7 @@ namespace Mip
|
||||
d[i] = new DateItem();
|
||||
if (drwKal["StatusPoznamky"].ToString() == "Neprečítaná")
|
||||
{
|
||||
DateTime date = (DateTime) drwKal["DatumPoznamky"];
|
||||
DateTime date = (DateTime)drwKal["DatumPoznamky"];
|
||||
Int32 intYear = Convert.ToInt32(date.Year.ToString());
|
||||
Int32 intMonth = Convert.ToInt32(date.Month.ToString());
|
||||
Int32 intDay = Convert.ToInt32(date.Day.ToString());
|
||||
@@ -671,7 +662,7 @@ namespace Mip
|
||||
|
||||
|
||||
|
||||
int i=0;
|
||||
int i = 0;
|
||||
DataTable dttblPoznamkyNaDen;
|
||||
private void monthCalendar1_SelectDay(object sender, MonthCalendar.SelectDayEventArgs e)
|
||||
{
|
||||
@@ -801,7 +792,7 @@ namespace Mip
|
||||
void ClickEvent(object sender, EventArgs e)
|
||||
{
|
||||
Label label = sender as Label;
|
||||
if(nameSender != null) nameSender.BackColor = colorSender;
|
||||
if (nameSender != null) nameSender.BackColor = colorSender;
|
||||
|
||||
if (label.BackColor == Color.LightGray)
|
||||
{
|
||||
@@ -818,11 +809,11 @@ namespace Mip
|
||||
pBDelete.Visible = true;
|
||||
pBMarkAsRead.Visible = false;
|
||||
}
|
||||
indexSender = Convert.ToInt16(label.Text.ToString())-1;
|
||||
indexSender = Convert.ToInt16(label.Text.ToString()) - 1;
|
||||
nameSender = label;
|
||||
colorSender = label.BackColor;
|
||||
|
||||
for(int p=0;p<dttblPoznamkyNaDen.Rows.Count;p++ )
|
||||
for (int p = 0; p < dttblPoznamkyNaDen.Rows.Count; p++)
|
||||
{
|
||||
DataRow dr = dttblPoznamkyNaDen.Rows[p];
|
||||
if (dr["indexSender"].ToString() == indexSender.ToString()) idpoznamky = Convert.ToInt32(dr["IDPoznamky"].ToString());
|
||||
@@ -1103,7 +1094,7 @@ namespace Mip
|
||||
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();
|
||||
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();
|
||||
|
||||
xlApp.Visible = true;
|
||||
xlApp.ActiveWindow.Activate();
|
||||
@@ -1591,20 +1582,20 @@ namespace Mip
|
||||
}
|
||||
}
|
||||
|
||||
private void checkBox47_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox46_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox45_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox44_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox43_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox42_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox41_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox40_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox50_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox49_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox48_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox51_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void radioButton9_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void radioButton8_CheckedChanged(object sender, EventArgs e) {check();}
|
||||
private void checkBox47_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox46_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox45_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox44_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox43_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox42_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox41_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox40_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox50_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox49_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox48_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void checkBox51_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void radioButton9_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void radioButton8_CheckedChanged(object sender, EventArgs e) { check(); }
|
||||
private void textBox4_TextChanged(object sender, EventArgs e) { check(); }
|
||||
|
||||
private void textBox4_EnabledChanged(object sender, EventArgs e)
|
||||
@@ -1940,7 +1931,7 @@ namespace Mip
|
||||
|
||||
dataGridView2.Columns["IDUsers"].Visible = false;
|
||||
dataGridView2.ClearSelection();
|
||||
if(rowIndex > 0)dataGridView2.Rows[rowIndex].Selected = true;
|
||||
if (rowIndex > 0) dataGridView2.Rows[rowIndex].Selected = true;
|
||||
//odblokuj = true;
|
||||
}
|
||||
|
||||
@@ -1975,7 +1966,7 @@ namespace Mip
|
||||
string cmd = "";
|
||||
Int32 lastUserInsert;
|
||||
cmd = @"INSERT INTO `mip`.`tabusers` (`Meno`, `Priezvisko`, `OnlineStatus`, `PristupovePrava`, `Status`, `Zaradenie`) VALUES ('NoveMeno', '', 'Offline', 0, 'Neaktívny', 'Administratíva');";
|
||||
classSQL.SQL(cmd,out lastUserInsert);
|
||||
classSQL.SQL(cmd, out lastUserInsert);
|
||||
|
||||
btnObnovit_Click(null, null);
|
||||
dataGridView2.ClearSelection();
|
||||
@@ -2152,7 +2143,7 @@ namespace Mip
|
||||
classGlobal.SetServerIP();
|
||||
classUser.LimitSqlPrikazu = Convert.ToInt32(numericUpDown40.Value);
|
||||
|
||||
if(classUser.MariaDBServerIPAddress != "0.0.0.0")
|
||||
if (classUser.MariaDBServerIPAddress != "0.0.0.0")
|
||||
{
|
||||
Form frmLogo2 = new frmLogo();
|
||||
frmLogo2.ShowDialog();
|
||||
@@ -2184,7 +2175,7 @@ namespace Mip
|
||||
panel4.Visible = false;
|
||||
|
||||
string cmd = "SELECT COUNT(*) FROM `Mip`.`tabchat` WHERE `Status`= 'Neprečítaná' AND `Komu`= " + classUser.ID + ";";
|
||||
string strNoveSpravy="0";
|
||||
string strNoveSpravy = "0";
|
||||
classSQL.SQL(cmd, out strNoveSpravy);
|
||||
if (strNoveSpravy == "") strNoveSpravy = "0";
|
||||
if (Convert.ToInt32(strNoveSpravy) != 0) refreshZistiNovuSpravu.Interval = 500;
|
||||
@@ -2223,9 +2214,9 @@ namespace Mip
|
||||
// if (classUser.ID == 1 || classUser.ID == 2) numericUpDown40.Value = 100;
|
||||
|
||||
/////////////////////////// zobrazenie povolenych zaloziek usera v tabcontroll ////////////////////////////////////////////
|
||||
int p1,p2,p3; // p1 pocitadlo cyklu, p2 - pocet zaloziek, p3 - ukazovatel na aktualnu zalozku
|
||||
int p1, p2, p3; // p1 pocitadlo cyklu, p2 - pocet zaloziek, p3 - ukazovatel na aktualnu zalozku
|
||||
Int32 intMaska;
|
||||
for (p1 = 0, p2 = tabControl1.TabCount, intMaska=1,p3=0;
|
||||
for (p1 = 0, p2 = tabControl1.TabCount, intMaska = 1, p3 = 0;
|
||||
p1 < p2;
|
||||
p1++, intMaska *= 2)
|
||||
{
|
||||
@@ -2388,7 +2379,7 @@ namespace Mip
|
||||
numericUpDown14.Maximum = PocetStran;
|
||||
|
||||
dataGVSetColumnSortMode(dGVVydajMat, DataGridViewColumnSortMode.NotSortable);
|
||||
setDGV(dGVVydajMat, classUser.IndexVydajMat,textBox17);
|
||||
setDGV(dGVVydajMat, classUser.IndexVydajMat, textBox17);
|
||||
|
||||
}
|
||||
|
||||
@@ -2423,7 +2414,7 @@ namespace Mip
|
||||
string cmd = "UPDATE `mip`.`tabvyroba` SET `PocetVydkusov`=" + lpocet.ToString() + ", `DatumVydMat` = DATE(NOW()) WHERE `IDVyroba`=" + intIDVyroba.ToString() + ";";
|
||||
classSQL.SQL(cmd);
|
||||
cmd = "UPDATE `mip`.`tabdopyt` SET `StatusDopytu`= 'Vo výrobe' WHERE `IDCPOBJ`=" + intIDDopyt.ToString() + ";";
|
||||
if(strStatus == "Zaradená do výroby") classSQL.SQL(cmd);
|
||||
if (strStatus == "Zaradená do výroby") classSQL.SQL(cmd);
|
||||
|
||||
//if (rBVydMatNezadane.Checked == true) refreshVydajMat("SELECT * FROM `mip`.`pohladvyroba` WHERE (TypDopytu = 'Objednávka' OR TypDopytu = 'Objednávka do kontraktu') AND StatusDopytu = 'Zaradená do výroby';");
|
||||
//if (rBVydMatVsetky.Checked == true) refreshVydajMat("SELECT * FROM `mip`.`pohladvyroba` WHERE TypDopytu = 'Objednávka' OR TypDopytu = 'Objednávka do kontraktu';");
|
||||
@@ -2522,7 +2513,7 @@ namespace Mip
|
||||
else x = MousePosition.X;
|
||||
if (MousePosition.Y + pPocetKusov.Height + 70 > this.Height) y = MousePosition.Y - pPocetKusov.Height;
|
||||
else y = MousePosition.Y;
|
||||
pPocetKusov.Location = new Point(x-10, y-25);
|
||||
pPocetKusov.Location = new Point(x - 10, y - 25);
|
||||
|
||||
pPocetKusov.Controls.Add(lPocetKusov);
|
||||
pPocetKusov.Controls.Add(lTextBox);
|
||||
@@ -2888,7 +2879,7 @@ namespace Mip
|
||||
|
||||
private void dGVRV_MouseWheel(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Delta > 0 && numericUpDown12.Value< numericUpDown12.Maximum) numericUpDown12.Value++;
|
||||
if (e.Delta > 0 && numericUpDown12.Value < numericUpDown12.Maximum) numericUpDown12.Value++;
|
||||
if (e.Delta < 0 && numericUpDown12.Value > numericUpDown12.Minimum) numericUpDown12.Value--;
|
||||
}
|
||||
|
||||
@@ -2953,7 +2944,7 @@ namespace Mip
|
||||
|
||||
}
|
||||
|
||||
MonthCalendar.Calendar monthcal= new MonthCalendar.Calendar();
|
||||
MonthCalendar.Calendar monthcal = new MonthCalendar.Calendar();
|
||||
|
||||
private void dGVRV_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e)
|
||||
{
|
||||
@@ -3304,7 +3295,7 @@ namespace Mip
|
||||
DataTable dtbZoznamVyrobkov = new DataTable();
|
||||
Int32 StartRecord = (Convert.ToInt32(numericUpDown4.Value) * classSQL.intPocetNaStranu) - classSQL.intPocetNaStranu;
|
||||
|
||||
classSQL.SQL(sqlCommandZoznamVyrobkov,StartRecord,classSQL.intPocetNaStranu, out dtbZoznamVyrobkov);
|
||||
classSQL.SQL(sqlCommandZoznamVyrobkov, StartRecord, classSQL.intPocetNaStranu, out dtbZoznamVyrobkov);
|
||||
dGVZoznamVyrobkov.DataSource = dtbZoznamVyrobkov;
|
||||
dGVZoznamVyrobkov.Visible = true;
|
||||
|
||||
@@ -3319,7 +3310,7 @@ namespace Mip
|
||||
setDGV(dGVZoznamVyrobkov, classUser.IndexExpedicia, textBox6);
|
||||
|
||||
//lblZobrazenyPocet.Text = dGVExpedicia.Rows.Count.ToString();
|
||||
/*
|
||||
/*
|
||||
lblZobrazenyPocet.Text = dGVZoznamVyrobkov.Rows.Count.ToString();
|
||||
if (dGVZoznamVyrobkov.Rows.Count == 0) btnEditVyrobok.Enabled = false;
|
||||
else btnEditVyrobok.Enabled = true;
|
||||
@@ -3424,8 +3415,7 @@ namespace Mip
|
||||
private void btnEditVyrobok_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
//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());
|
||||
Form Add = new frmEditVyrobok(dGVZoznamVyrobkov.CurrentRow.Cells["IDVyrobok"].Value.ToString());
|
||||
Add.ShowDialog();
|
||||
refreshZoznamVyrobkov();
|
||||
}
|
||||
@@ -3505,7 +3495,7 @@ namespace Mip
|
||||
Int32 intPocetVydKusov = 0;
|
||||
string pocetkusov = "";
|
||||
bool cancel = false;
|
||||
Int32 intIDdopyt = Convert.ToInt32( dGVExpedicia.Rows[e.RowIndex].Cells["IDCPOBJ"].Value.ToString());
|
||||
Int32 intIDdopyt = Convert.ToInt32(dGVExpedicia.Rows[e.RowIndex].Cells["IDCPOBJ"].Value.ToString());
|
||||
string strZistiPocetVydKusov;
|
||||
classSQL.SQL("SELECT `PocetVydKusov` FROM `mip`.`tabvyroba` WHERE `IDDopyt`=" + intIDdopyt.ToString() + ";", out strZistiPocetVydKusov);
|
||||
if (strZistiPocetVydKusov != "") intPocetVydKusov = Convert.ToInt32(strZistiPocetVydKusov);
|
||||
@@ -3591,7 +3581,7 @@ namespace Mip
|
||||
#region definicia_controlov
|
||||
dtpDatum = new DateTimePicker();
|
||||
dtpDatum.Value = DateTime.Now;
|
||||
dtpDatum.Location = new Point(1,1);
|
||||
dtpDatum.Location = new Point(1, 1);
|
||||
dtpDatum.Size = new Size(160, 20);
|
||||
Label lPocetDobVyrKus = new Label();
|
||||
lPocetDobVyrKus.AutoSize = true;
|
||||
@@ -3751,7 +3741,7 @@ namespace Mip
|
||||
+ lTextBoxDobVyrKus.Text.ToString() + ", "
|
||||
+ lTextBoxOdoslKus.Text.ToString() + ", "
|
||||
+ lTextKusNaSklad.Text.ToString() + ", '"
|
||||
+ dtpDatum.Value.ToString("yyyy-MM-dd")+ "');";
|
||||
+ dtpDatum.Value.ToString("yyyy-MM-dd") + "');";
|
||||
classSQL.SQL(cmd, out intIndex);
|
||||
|
||||
//DataTable d2 = classSQL.commandSQL("SELECT last_insert_id()", 1);
|
||||
@@ -3825,7 +3815,7 @@ namespace Mip
|
||||
int pocetNaSklade;
|
||||
int pocetDoZoSkladu;
|
||||
|
||||
# region Zistiť poČet kusov na sklade
|
||||
#region Zistiť poČet kusov na sklade
|
||||
|
||||
Int32 intIDVyrobok = 0;
|
||||
Int32 intIDDopyt = 0;
|
||||
@@ -3858,7 +3848,7 @@ namespace Mip
|
||||
classSQL.SQL(cmd, out strTotalNaSklade);
|
||||
if (strTotalNaSklade != "") pocetNaSklade = Convert.ToInt32(strTotalNaSklade);
|
||||
else pocetNaSklade = 0;
|
||||
# endregion
|
||||
#endregion
|
||||
|
||||
//pocetNaSklade = 10;//vyhodiť
|
||||
|
||||
@@ -4231,7 +4221,7 @@ namespace Mip
|
||||
textBox13.Enabled = false;
|
||||
button110.Enabled = false;
|
||||
//label19.Text = "Hľadať v stĺpci: ---";
|
||||
classGlobal.SetRowColor2(dGVExpedicia,"StatusDopytu");
|
||||
classGlobal.SetRowColor2(dGVExpedicia, "StatusDopytu");
|
||||
refreshExpedicia();
|
||||
}
|
||||
|
||||
@@ -4708,7 +4698,7 @@ namespace Mip
|
||||
|
||||
private void panelPridatPU_Leave(object sender, EventArgs e)
|
||||
{
|
||||
if(panel27.Visible == false) panelPridatPU.Visible = false;
|
||||
if (panel27.Visible == false) panelPridatPU.Visible = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -4820,7 +4810,7 @@ namespace Mip
|
||||
|
||||
private void button76_Click(object sender, EventArgs e)
|
||||
{
|
||||
string cmd="";
|
||||
string cmd = "";
|
||||
string format = "yyyy-MM-dd";
|
||||
|
||||
cmd = @"INSERT INTO `mip`.`tabstroje` ( `Vyrobca`,
|
||||
@@ -4997,7 +4987,7 @@ namespace Mip
|
||||
case "Ročne":
|
||||
comboBox4.Items.Clear();
|
||||
comboBox4.Text = "";
|
||||
for (int i = 1; i < 13; i++) comboBox4.Items.Add( DateTimeFormatInfo.CurrentInfo.GetMonthName(i));
|
||||
for (int i = 1; i < 13; i++) comboBox4.Items.Add(DateTimeFormatInfo.CurrentInfo.GetMonthName(i));
|
||||
comboBox4.DropDownWidth = comboBox4.Size.Width;
|
||||
comboBox4.Enabled = true;
|
||||
comboBox4.Focus();
|
||||
@@ -5766,7 +5756,7 @@ namespace Mip
|
||||
private void panel39_Click(object sender, EventArgs e)
|
||||
{
|
||||
Form frmPridatFirmu = new frmAddFirma();
|
||||
frmPridatFirmu.Location = new Point(trackBar1.Location.X+20,trackBar1.Location.Y+116);
|
||||
frmPridatFirmu.Location = new Point(trackBar1.Location.X + 20, trackBar1.Location.Y + 116);
|
||||
frmPridatFirmu.ShowDialog();
|
||||
RefreshFirmy();
|
||||
//if (panel42.Visible == false) panel42.Visible = true;
|
||||
@@ -5781,7 +5771,7 @@ namespace Mip
|
||||
private void button91_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
classMapa.SearchGoogleAPI(gMapControl1.Position.Lat.ToString().Replace(",",".")+","+gMapControl1.Position.Lng.ToString().Replace(",","."), "latlng=");
|
||||
classMapa.SearchGoogleAPI(gMapControl1.Position.Lat.ToString().Replace(",", ".") + "," + gMapControl1.Position.Lng.ToString().Replace(",", "."), "latlng=");
|
||||
//https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true_or_false&key=API_KEY
|
||||
|
||||
ndgv.DataSource = classMapa.dataTable;
|
||||
@@ -5839,7 +5829,7 @@ namespace Mip
|
||||
|
||||
private void setPanelColor(Panel pnl, Label lbl)
|
||||
{
|
||||
if(pnl.Size.Height == 25)
|
||||
if (pnl.Size.Height == 25)
|
||||
{
|
||||
pnl.BackColor = Color.Transparent;
|
||||
lbl.BackColor = Color.Transparent;
|
||||
@@ -5895,7 +5885,7 @@ namespace Mip
|
||||
|
||||
private void dataGridView3_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
Int32 intID = Convert.ToInt32(dataGridView3[dataGridView3.Columns["IDCPOBJ"].Index,e.RowIndex].Value.ToString());
|
||||
Int32 intID = Convert.ToInt32(dataGridView3[dataGridView3.Columns["IDCPOBJ"].Index, e.RowIndex].Value.ToString());
|
||||
frmZadatZmatkovitost frmZadatZmatkovitost2 = new frmZadatZmatkovitost(intID);
|
||||
frmZadatZmatkovitost2.ShowDialog();
|
||||
refreshZmatkovitost();
|
||||
@@ -5913,7 +5903,7 @@ namespace Mip
|
||||
_setdgv.Visible = true;
|
||||
lblZobrazenyPocet.Text = classSQL.intCelkovyPocetZazanmov.ToString();
|
||||
|
||||
if(_setdgv.Rows.Count !=0)
|
||||
if (_setdgv.Rows.Count != 0)
|
||||
if (_tb.Enabled == true) _tb.Focus();
|
||||
else
|
||||
{
|
||||
@@ -6230,7 +6220,7 @@ namespace Mip
|
||||
string strNazovRozmer = "";
|
||||
string strMat = "";
|
||||
|
||||
if (dataGridView13.SelectedRows.Count >0) strNazovRozmer = dataGridView13.SelectedRows[0].Cells["NazovVyrobku"].Value.ToString() + " [" + dataGridView13.SelectedRows[0].Cells["SpojeneRozmery"].Value.ToString() + "]";
|
||||
if (dataGridView13.SelectedRows.Count > 0) strNazovRozmer = dataGridView13.SelectedRows[0].Cells["NazovVyrobku"].Value.ToString() + " [" + dataGridView13.SelectedRows[0].Cells["SpojeneRozmery"].Value.ToString() + "]";
|
||||
if (dataGridView13.SelectedRows.Count > 0) strMat = " AND `MaterialSUpravouMat` = '" + dataGridView13.SelectedRows[0].Cells["MaterialSUpravouMat"].Value.ToString() + "'";
|
||||
|
||||
string cmdPocty = "SELECT CisKrabice, Pocet FROM `pohladkrabice-vyrobky` WHERE Nazov = '" + strNazovRozmer + "'" + strMat + " AND Pocet >0;";
|
||||
@@ -6317,7 +6307,7 @@ namespace Mip
|
||||
if (selectedIndex <= dataGridView7.Rows.Count - 1) dataGridView7.Rows[selectedIndex].Selected = true;
|
||||
else if ((selectedIndex - 1) >= dataGridView7.Rows.Count) dataGridView7.Rows[dataGridView7.Rows.Count - 1].Selected = true;
|
||||
else dataGridView7.Rows[selectedIndex - 1].Selected = true;
|
||||
/*
|
||||
/*
|
||||
if (dataGridView7.Rows.Count != 0)
|
||||
if (selectedIndex <= dataGridView7.Rows.Count - 1) dataGridView7.Rows[selectedIndex].Selected = true;
|
||||
else dataGridView7.Rows[selectedIndex - 1].Selected = true;
|
||||
@@ -6629,9 +6619,9 @@ namespace Mip
|
||||
int excelRowIndex = ri + 7;
|
||||
DataRow dtrTlacitPU = tblTlacitPU.Rows[ri];
|
||||
|
||||
xlWorkSheet.Range["C" + excelRowIndex.ToString(),"J" + excelRowIndex.ToString()].Value = dtrTlacitPU["PeriodaPU"].ToString();
|
||||
xlWorkSheet.Range["D" + excelRowIndex.ToString(),"J" + excelRowIndex.ToString()].Value = dtrTlacitPU["MesiacPU"].ToString();
|
||||
xlWorkSheet.Range["E" + excelRowIndex.ToString(),"J" + excelRowIndex.ToString()].Value = dtrTlacitPU["PopisPU"].ToString();
|
||||
xlWorkSheet.Range["C" + excelRowIndex.ToString(), "J" + excelRowIndex.ToString()].Value = dtrTlacitPU["PeriodaPU"].ToString();
|
||||
xlWorkSheet.Range["D" + excelRowIndex.ToString(), "J" + excelRowIndex.ToString()].Value = dtrTlacitPU["MesiacPU"].ToString();
|
||||
xlWorkSheet.Range["E" + excelRowIndex.ToString(), "J" + excelRowIndex.ToString()].Value = dtrTlacitPU["PopisPU"].ToString();
|
||||
|
||||
}
|
||||
|
||||
@@ -6863,7 +6853,7 @@ namespace Mip
|
||||
|
||||
private void dataGridView7_RowEnter(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if(dataGridView7.SelectedRows.Count == 1)
|
||||
if (dataGridView7.SelectedRows.Count == 1)
|
||||
{
|
||||
DataGridViewRow dtgvr = dataGridView7.SelectedRows[0];
|
||||
if (dtgvr.Cells["Status"].Value.ToString() == "Prijatá") button57.Text = "Naceniť";
|
||||
@@ -7001,7 +6991,7 @@ namespace Mip
|
||||
private void button133_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if(dGVZoznamVyrobkov.SelectedRows.Count !=0)
|
||||
if (dGVZoznamVyrobkov.SelectedRows.Count != 0)
|
||||
{
|
||||
Form frmAddCenovuPonuku2 = new frmAddCenovuPonuku(dGVZoznamVyrobkov.SelectedRows[0].Cells["NazovVyrobku"].Value.ToString(),
|
||||
Convert.ToInt32(dGVZoznamVyrobkov.SelectedRows[0].Cells["IDVyrobok"].Value.ToString()),
|
||||
@@ -7094,9 +7084,9 @@ namespace Mip
|
||||
dataGridView16.DataSource = outdtbl;
|
||||
|
||||
if (dataGridView16.Rows.Count != 0)
|
||||
if (selectedIndex <= dataGridView16.Rows.Count-1) dataGridView16.Rows[selectedIndex].Selected = true;
|
||||
else if((selectedIndex - 1) >= dataGridView16.Rows.Count) dataGridView16.Rows[dataGridView16.Rows.Count - 1].Selected = true;
|
||||
else dataGridView16.Rows[selectedIndex-1].Selected = true;
|
||||
if (selectedIndex <= dataGridView16.Rows.Count - 1) dataGridView16.Rows[selectedIndex].Selected = true;
|
||||
else if ((selectedIndex - 1) >= dataGridView16.Rows.Count) dataGridView16.Rows[dataGridView16.Rows.Count - 1].Selected = true;
|
||||
else dataGridView16.Rows[selectedIndex - 1].Selected = true;
|
||||
|
||||
/*
|
||||
Int32 PocetStran = Convert.ToInt32(Math.Ceiling((double)classSQL.intCelkovyPocetZazanmov / classSQL.intPocetNaStranu));
|
||||
@@ -7187,7 +7177,7 @@ namespace Mip
|
||||
}
|
||||
|
||||
|
||||
if(FileData != null)
|
||||
if (FileData != null)
|
||||
{
|
||||
Form showVykres = new frmShowVykres(FileData);
|
||||
showVykres.ShowDialog();
|
||||
@@ -7478,7 +7468,7 @@ namespace Mip
|
||||
|
||||
private void button144_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(panel56.Visible == false)
|
||||
if (panel56.Visible == false)
|
||||
{
|
||||
panel56.Visible = true;
|
||||
button147.Text = "Zahájiť odstávku";
|
||||
@@ -7692,7 +7682,7 @@ namespace Mip
|
||||
cbn = sender as ComboBox;
|
||||
DataTable tbl = new DataTable();
|
||||
|
||||
for(int i = flowLayoutPanel4.Controls.Count - 1; i>=0 ; i--) if (flowLayoutPanel4.Controls[i] is FlowLayoutPanel) flowLayoutPanel4.Controls[i].Dispose();
|
||||
for (int i = flowLayoutPanel4.Controls.Count - 1; i >= 0; i--) if (flowLayoutPanel4.Controls[i] is FlowLayoutPanel) flowLayoutPanel4.Controls[i].Dispose();
|
||||
|
||||
string cmd = "select * from `pohladudrzbyplanovanie` where `IDStroja` = " + cbn.SelectedValue.ToString() + ";";
|
||||
classSQL.SQL(cmd, out tbl);
|
||||
@@ -7824,7 +7814,7 @@ namespace Mip
|
||||
cb.SelectedIndex = -1;
|
||||
cb.Margin = pad;
|
||||
cb.Location = new Point(1, 1);
|
||||
cb.Size = new Size(panel.Size.Width-2, panel.Size.Height-2);
|
||||
cb.Size = new Size(panel.Size.Width - 2, panel.Size.Height - 2);
|
||||
//cb.Anchor = AnchorStyles.Left | AnchorStyles.Right;
|
||||
cb.SelectedValueChanged += new EventHandler(strojeLoad);
|
||||
|
||||
@@ -7846,12 +7836,12 @@ namespace Mip
|
||||
|
||||
private void button152_Click(object sender, EventArgs e)
|
||||
{
|
||||
UpdateDate("Potvrdený dátum",sender);
|
||||
UpdateDate("Potvrdený dátum", sender);
|
||||
}
|
||||
|
||||
private void button174_Click(object sender, EventArgs e)
|
||||
{
|
||||
UpdateDate("Dátum prijatia",sender);
|
||||
UpdateDate("Dátum prijatia", sender);
|
||||
|
||||
}
|
||||
|
||||
@@ -7890,7 +7880,7 @@ namespace Mip
|
||||
|
||||
private void panel57_VisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
if(panel57.Visible == false)
|
||||
if (panel57.Visible == false)
|
||||
{
|
||||
if (button174.BackColor == Color.LightYellow) button174.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
if (button152.BackColor == Color.LightYellow) button152.BackColor = System.Drawing.SystemColors.ControlLight;
|
||||
@@ -7905,7 +7895,7 @@ namespace Mip
|
||||
|
||||
private void button156_Click(object sender, EventArgs e)
|
||||
{
|
||||
UpdateText("Faktúra",sender);
|
||||
UpdateText("Faktúra", sender);
|
||||
}
|
||||
|
||||
private void button175_Click(object sender, EventArgs e)
|
||||
@@ -8149,7 +8139,7 @@ namespace Mip
|
||||
DataGridViewSelectedRowCollection dgvr;
|
||||
dgvr = dataGridView16.SelectedRows;
|
||||
|
||||
Form frmDopInf = new frmZiadankaDoplnujuceInfo(dgvr, btn.Tag.ToString(),label113.Text);
|
||||
Form frmDopInf = new frmZiadankaDoplnujuceInfo(dgvr, btn.Tag.ToString(), label113.Text);
|
||||
//frmDopInf.Tag = label113.Text;
|
||||
frmDopInf.ShowDialog();
|
||||
}
|
||||
@@ -8198,7 +8188,7 @@ namespace Mip
|
||||
|
||||
private void panel64_Click(object sender, EventArgs e)
|
||||
{
|
||||
Form frmPridatFirmu = new frmAddFirma(Convert.ToInt32(dataGridView11.SelectedRows[0].Cells["IDFirma"].Value.ToString()),true);
|
||||
Form frmPridatFirmu = new frmAddFirma(Convert.ToInt32(dataGridView11.SelectedRows[0].Cells["IDFirma"].Value.ToString()), true);
|
||||
frmPridatFirmu.Location = new Point(trackBar1.Location.X + 20, trackBar1.Location.Y + 116);
|
||||
frmPridatFirmu.ShowDialog();
|
||||
RefreshFirmy();
|
||||
@@ -8215,7 +8205,7 @@ namespace Mip
|
||||
dataGridView16.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridView16.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
|
||||
for(int i=0; i< dataGridView16.Columns.Count; i++) dataGridView16.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
|
||||
for (int i = 0; i < dataGridView16.Columns.Count; i++) dataGridView16.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -8263,7 +8253,7 @@ namespace Mip
|
||||
classGlobal.RowColor(dataGridView16, -1);
|
||||
}
|
||||
catch
|
||||
{}
|
||||
{ }
|
||||
|
||||
}
|
||||
|
||||
@@ -8466,14 +8456,14 @@ string editDateRV;
|
||||
private void dataGridView16_RowEnter(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
//if (classGlobal.PristupovePrava(classUser.ID, "Ziadanka-zobrazit vymazane") == false)
|
||||
if(dataGridView16.SelectedRows.Count >0)
|
||||
if (dataGridView16.SelectedRows.Count > 0)
|
||||
{
|
||||
if (dataGridView16.SelectedRows[0].Cells["Nákres"].Value.ToString() == "Áno") button135.BackColor = Color.Coral;
|
||||
else button135.BackColor = SystemColors.ControlLight;
|
||||
|
||||
}
|
||||
|
||||
if (dataGridView16.SelectedRows.Count >0)
|
||||
if (dataGridView16.SelectedRows.Count > 0)
|
||||
switch (dataGridView16.SelectedRows[0].Cells["Status žiadanky"].Value.ToString())
|
||||
{
|
||||
case "Prijatá":
|
||||
@@ -8675,7 +8665,7 @@ string editDateRV;
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
default:
|
||||
|
||||
break;
|
||||
|
||||
@@ -8710,7 +8700,7 @@ string editDateRV;
|
||||
string cmd = "select * from `pohladzmetkovitost-export` order by `Percento` DESC";
|
||||
classSQL.SQL(cmd, out tabZmatky);
|
||||
|
||||
cmd= "select distinct `Obdobie` from `pohladzmetkovitost-export` order by `Obdobie`;";
|
||||
cmd = "select distinct `Obdobie` from `pohladzmetkovitost-export` order by `Obdobie`;";
|
||||
DataTable tabObdobia = new DataTable();
|
||||
classSQL.SQL(cmd, out tabObdobia);
|
||||
|
||||
@@ -8731,14 +8721,14 @@ string editDateRV;
|
||||
|
||||
void refreshZmetkovitostExport()
|
||||
{
|
||||
if(comboBox17.Text != "" && comboBox18.Text != "")
|
||||
if (comboBox17.Text != "" && comboBox18.Text != "")
|
||||
{
|
||||
DataView dvZmatky = new DataView(tabZmatky);
|
||||
string dvZmatkyFilter = "Obdobie >= " + comboBox17.Text + " AND Obdobie <= " + comboBox18.Text ;
|
||||
string dvZmatkyFilter = "Obdobie >= " + comboBox17.Text + " AND Obdobie <= " + comboBox18.Text;
|
||||
dvZmatky.RowFilter = dvZmatkyFilter;
|
||||
|
||||
DataView dv = new DataView(dvZmatky.ToTable());
|
||||
if(dataGridView18.Tag.ToString() != null) dv.RowFilter = dataGridView18.Tag.ToString();
|
||||
if (dataGridView18.Tag.ToString() != null) dv.RowFilter = dataGridView18.Tag.ToString();
|
||||
dataGridView18.DataSource = dv;
|
||||
|
||||
string filter = "";
|
||||
@@ -8853,7 +8843,7 @@ string editDateRV;
|
||||
else outputValue = 0;
|
||||
}
|
||||
|
||||
return Math.Round(outputValue,3);
|
||||
return Math.Round(outputValue, 3);
|
||||
}
|
||||
|
||||
private void PocitacZmatkov(DataView _DataView)
|
||||
@@ -8906,14 +8896,14 @@ string editDateRV;
|
||||
private void panel67_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
panel67.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
if(Convert.ToBoolean(panel67.Tag) == true) panel67.BackgroundImage = Mip.Properties.Resources.Arrow_left;
|
||||
if (Convert.ToBoolean(panel67.Tag) == true) panel67.BackgroundImage = Mip.Properties.Resources.Arrow_left;
|
||||
else panel67.BackgroundImage = Mip.Properties.Resources.Arrow_right;
|
||||
|
||||
}
|
||||
|
||||
private void panel67_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
if(Convert.ToBoolean(panel67.Tag) == true)
|
||||
if (Convert.ToBoolean(panel67.Tag) == true)
|
||||
{
|
||||
panel67.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
panel67.BackgroundImage = null;
|
||||
@@ -8923,7 +8913,7 @@ string editDateRV;
|
||||
|
||||
private void panel67_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(Convert.ToBoolean(panel67.Tag) == true)
|
||||
if (Convert.ToBoolean(panel67.Tag) == true)
|
||||
{
|
||||
panel67.Tag = false;
|
||||
panel67.Location = new Point(panel67.Location.X - 100, panel67.Location.Y);
|
||||
@@ -8997,7 +8987,7 @@ string editDateRV;
|
||||
|
||||
private void label158_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(label158.BackColor == Color.Beige)
|
||||
if (label158.BackColor == Color.Beige)
|
||||
{
|
||||
label158.BackColor = Color.Coral;
|
||||
label159.BackColor = Color.Beige;
|
||||
@@ -9297,8 +9287,8 @@ string editDateRV;
|
||||
decimal y = 0;
|
||||
double uhol = Math.PI / (double)_n3;
|
||||
|
||||
x = Math.Round(Convert.ToDecimal((double)_n1 * Math.Sin(uhol)),3);
|
||||
y = Math.Round(_n1/2 - Convert.ToDecimal((double)_n2 /2 * Math.Cos(uhol)),3);
|
||||
x = Math.Round(Convert.ToDecimal((double)_n1 * Math.Sin(uhol)), 3);
|
||||
y = Math.Round(_n1 / 2 - Convert.ToDecimal((double)_n2 / 2 * Math.Cos(uhol)), 3);
|
||||
|
||||
label188.Text = x.ToString();
|
||||
label190.Text = y.ToString();
|
||||
@@ -9572,7 +9562,7 @@ string editDateRV;
|
||||
|
||||
private void button184_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(dataGridView20.SelectedRows[0].Cells["Číslo nástroja"].Value.ToString() != "")
|
||||
if (dataGridView20.SelectedRows[0].Cells["Číslo nástroja"].Value.ToString() != "")
|
||||
{
|
||||
Int32 index = Convert.ToInt32(dataGridView20.SelectedRows[0].Cells["Index brusenie"].Value.ToString());
|
||||
string cmd = "update `mip`.`tab-evidenciabruseni` SET `Status` = 'Vo výrobe', `Dátum zaradenia do výroby` = DATE(NOW()), `Číslo nástroja` = "
|
||||
@@ -10158,7 +10148,7 @@ string editDateRV;
|
||||
private void button198_Click(object sender, EventArgs e)
|
||||
{
|
||||
//vratit do vyroby
|
||||
if(dataGridView22.SelectedRows.Count > 0)
|
||||
if (dataGridView22.SelectedRows.Count > 0)
|
||||
{
|
||||
Int32 index = Convert.ToInt32(dataGridView22.SelectedRows[0].Cells["Index brusenie"].Value.ToString());
|
||||
string cmd = "update `mip`.`tab-evidenciabruseni` SET `Status` = 'Vo výrobe', `Dátum` = DATE(NOW()) where `Index brusenie` = " + index.ToString() + ";";
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using Syncfusion.Pdf.Parsing;
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using Syncfusion.Pdf.Parsing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
||||
namespace Mip
|
||||
@@ -18,25 +12,25 @@ namespace Mip
|
||||
{
|
||||
DataTable pomocnaDT = new DataTable();
|
||||
Point poinPosition;
|
||||
bool deleteRow=false;
|
||||
Single z=1;
|
||||
bool deleteRow = false;
|
||||
Single z = 1;
|
||||
int sizeH;
|
||||
int sizeW;
|
||||
string IDVyrobok;
|
||||
DataTable DTVykresy = new DataTable();
|
||||
|
||||
|
||||
public frmPridatVyrobok(string strZakaznik, string idVyrobok = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
label2.Text = strZakaznik;
|
||||
IDVyrobok = idVyrobok;
|
||||
this.MouseWheel += new MouseEventHandler(pictureBox1_MouseWheel);
|
||||
|
||||
}
|
||||
|
||||
private void pictureBox1_MouseWheel(object sender, MouseEventArgs e)
|
||||
{
|
||||
if(pictureBox1.Image != null)
|
||||
if (pictureBox1.Image != null)
|
||||
{
|
||||
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
|
||||
z += (Convert.ToSingle(0.1) * (e.Delta / Math.Abs(e.Delta)));
|
||||
@@ -53,52 +47,52 @@ namespace Mip
|
||||
|
||||
private void frmPridatVyrobok_Load(object sender, EventArgs e)
|
||||
{
|
||||
pomocnaDT.Columns.Add("Nazov_suboru",typeof (string));
|
||||
pomocnaDT.Columns.Add("Velkost_suboru",typeof (string));
|
||||
pomocnaDT.Columns.Add("Nazov_suboru", typeof(string));
|
||||
pomocnaDT.Columns.Add("Velkost_suboru", typeof(string));
|
||||
pomocnaDT.Columns.Add("Typ_suboru", typeof(string));
|
||||
pomocnaDT.Columns.Add("Cesta",typeof (string));
|
||||
pomocnaDT.Columns.Add("Cesta", typeof(string));
|
||||
pomocnaDT.Columns.Add("Data", typeof(string));
|
||||
pomocnaDT.Columns.Add("Valid", typeof(int));
|
||||
VypisSpojenyRozmer();
|
||||
classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať iný názov");
|
||||
if (IDVyrobok != null)
|
||||
{
|
||||
LoadEditData();
|
||||
}
|
||||
//if (IDVyrobok != null)
|
||||
//{
|
||||
// LoadEditData();
|
||||
//}
|
||||
}
|
||||
|
||||
private void LoadEditData()
|
||||
{
|
||||
DataTable DTEditVyrobok = new DataTable();
|
||||
//dGVZoznamVyrobkov.CurrentRow.Cells["IDVyrobok"].Value.ToString()
|
||||
//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();
|
||||
// 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();
|
||||
// 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();
|
||||
// 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;
|
||||
}
|
||||
// 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)
|
||||
{
|
||||
@@ -209,7 +203,7 @@ namespace Mip
|
||||
obrazok_Refresh(currentRowIndex);
|
||||
pictureBox1.Visible = true;
|
||||
}
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count !=0) button5.Enabled = true;
|
||||
if (textBox6.Text != "" && textBox2.Text != "" && textBox3.Text != "" && textBox4.Text != "" && dataGridView1.Rows.Count != 0) button5.Enabled = true;
|
||||
else button5.Enabled = false; //kontrola naplnenia povinných dát
|
||||
}
|
||||
|
||||
@@ -251,7 +245,7 @@ namespace Mip
|
||||
var isPdf = dRow["Typ_suboru"].ToString() == "pdf";
|
||||
var isValid = dRow["Valid"].ToString() == "1";
|
||||
|
||||
if(isValid)
|
||||
if (isValid)
|
||||
{
|
||||
if (isPdf)
|
||||
{
|
||||
@@ -316,19 +310,19 @@ namespace Mip
|
||||
public void VypisSpojenyRozmer()
|
||||
{
|
||||
string strSpojeny = "";
|
||||
string strKonZnak ="";
|
||||
string strKonZnak = "";
|
||||
|
||||
if (textBox2.Text != "")
|
||||
{
|
||||
if(textBox1.Text =="") strKonZnak = "";
|
||||
else strKonZnak = " -" + textBox1.Text ;
|
||||
if (textBox1.Text == "") strKonZnak = "";
|
||||
else strKonZnak = " -" + textBox1.Text;
|
||||
|
||||
if (numericUpDown1.Value == 0)
|
||||
{
|
||||
if (textBox3.Text != "" && textBox3.Text != "0") strSpojeny = label10.Text + textBox2.Text + "/" + textBox3.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
if (textBox3.Text != "" && textBox3.Text != "0") strSpojeny = label10.Text + textBox2.Text + "/" + textBox3.Text + "x" + textBox4.Text + strKonZnak;
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox4.Text + strKonZnak;
|
||||
}
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox3.Text + "x" + textBox4.Text + strKonZnak ;
|
||||
else strSpojeny = label10.Text + textBox2.Text + "x" + textBox3.Text + "x" + textBox4.Text + strKonZnak;
|
||||
}
|
||||
else strSpojeny = "";
|
||||
label12.Text = strSpojeny;
|
||||
@@ -464,7 +458,7 @@ namespace Mip
|
||||
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
Point changePoint = new Point (e.Location.X - poinPosition.X, e.Location.Y - poinPosition.Y);
|
||||
Point changePoint = new Point(e.Location.X - poinPosition.X, e.Location.Y - poinPosition.Y);
|
||||
panel1.AutoScrollPosition = new Point(-panel1.AutoScrollPosition.X - changePoint.X, -panel1.AutoScrollPosition.Y - changePoint.Y);
|
||||
}
|
||||
|
||||
@@ -533,7 +527,7 @@ namespace Mip
|
||||
+ "' AND `NazovVyrobku` = '" + textBox6.Text + "';", out dtbl);
|
||||
|
||||
if (dtbl.Rows.Count != 0) MessageBox.Show("Výrobok s názvom: \n " + textBox6.Text + "\n v datábáze výrobkov odberateľa " + label2.Text + " už existuje!!!\n Prosím zmeňte názov výrobku", "Pozor ... ",
|
||||
MessageBoxButtons.OK,MessageBoxIcon.Warning); //Ak sa výrobok v databaze uz nachádza
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Warning); //Ak sa výrobok v databaze uz nachádza
|
||||
else // ak sa výrobok v dtbaze nenachádza tak ho pridať
|
||||
{
|
||||
classGlobal.strNovyPomocnyUdaj = textBox6.Text; //pomocný údaj pre naplnenie comboboxu po zavreti okna
|
||||
@@ -545,7 +539,7 @@ namespace Mip
|
||||
cmd = "INSERT INTO `mip`.`tabvyrobok` (`NazovVyrobku`, `RozmerTvar`, `Rozmer1`, `Rozmer2`, `Rozmer3`, `SpojeneRozmery`, `Zakaznik`, `InyNazov`, `RozlisZnakKonecnaOp`, `Alias`,`PocetSegmentov`, `Status výrobku`) VALUES ('"
|
||||
+ textBox6.Text.ToString() + "', '" //NazovVyrobku
|
||||
+ label10.Text.ToString() + "', " //RozmerTvar
|
||||
+ textBox2.Text.ToString().Replace(",",".") + ", " //rozmer1
|
||||
+ textBox2.Text.ToString().Replace(",", ".") + ", " //rozmer1
|
||||
+ textBox3.Text.ToString().Replace(",", ".") + "," //rozmer2
|
||||
+ textBox4.Text.ToString().Replace(",", ".") + ", '" //rozmer3
|
||||
+ label12.Text.ToString() + "', '" //spojene rozmery
|
||||
@@ -573,16 +567,16 @@ namespace Mip
|
||||
|
||||
var indexVykresu = 1;
|
||||
|
||||
for (int p1=0; p1 < pomocnaDT.Rows.Count; p1++)
|
||||
for (int p1 = 0; p1 < pomocnaDT.Rows.Count; p1++)
|
||||
{
|
||||
FileStream fs;
|
||||
int fileSize;
|
||||
byte[] VykresData;
|
||||
|
||||
dtrw=pomocnaDT.Rows[p1];
|
||||
dtrw = pomocnaDT.Rows[p1];
|
||||
var isValid = dtrw["Valid"].ToString() == "1";
|
||||
|
||||
if(isValid)
|
||||
if (isValid)
|
||||
{
|
||||
fs = new FileStream(dtrw["Cesta"].ToString(), FileMode.Open, FileAccess.Read);
|
||||
fileSize = (int)fs.Length;
|
||||
@@ -670,7 +664,7 @@ namespace Mip
|
||||
|
||||
*/
|
||||
|
||||
if((int)e.KeyChar!=8) foreach (char znak in Path.GetInvalidFileNameChars()) if (e.KeyChar == znak) e.KeyChar = '\0';
|
||||
if ((int)e.KeyChar != 8) foreach (char znak in Path.GetInvalidFileNameChars()) if (e.KeyChar == znak) e.KeyChar = '\0';
|
||||
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user