diff --git a/.vs/Mip_v1/v16/.suo b/.vs/Mip_v1/v16/.suo index ccab059..45c3a14 100644 Binary files a/.vs/Mip_v1/v16/.suo and b/.vs/Mip_v1/v16/.suo differ diff --git a/Mip/Properties/AssemblyInfo.cs b/Mip/Properties/AssemblyInfo.cs index 674421c..0a7ce9d 100644 --- a/Mip/Properties/AssemblyInfo.cs +++ b/Mip/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.9.0")] -[assembly: AssemblyFileVersion("1.1.9.0")] +[assembly: AssemblyVersion("1.1.10.0")] +[assembly: AssemblyFileVersion("1.1.10.0")] diff --git a/Mip/frmEditDopyt.Designer.cs b/Mip/frmEditDopyt.Designer.cs index 0c7e76f..a30e5a1 100644 --- a/Mip/frmEditDopyt.Designer.cs +++ b/Mip/frmEditDopyt.Designer.cs @@ -69,6 +69,7 @@ this.comboBox2 = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.textBox2 = new System.Windows.Forms.TextBox(); this.label24 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); this.checkBox2 = new System.Windows.Forms.CheckBox(); @@ -85,7 +86,8 @@ this.button2 = new System.Windows.Forms.Button(); this.comboBox3 = new System.Windows.Forms.ComboBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.textBox2 = new System.Windows.Forms.TextBox(); + this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker(); + this.label25 = new System.Windows.Forms.Label(); this.groupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.groupBox4.SuspendLayout(); @@ -98,7 +100,7 @@ this.groupBox3.Controls.Add(this.label3); this.groupBox3.Location = new System.Drawing.Point(1, 244); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(247, 53); + this.groupBox3.Size = new System.Drawing.Size(247, 79); this.groupBox3.TabIndex = 16; this.groupBox3.TabStop = false; this.groupBox3.Text = "Rozmery výrobku"; @@ -114,7 +116,7 @@ // // button8 // - this.button8.Location = new System.Drawing.Point(444, 273); + this.button8.Location = new System.Drawing.Point(500, 298); this.button8.Name = "button8"; this.button8.Size = new System.Drawing.Size(83, 23); this.button8.TabIndex = 15; @@ -125,7 +127,7 @@ // btnUlozitZmeny // this.btnUlozitZmeny.Enabled = false; - this.btnUlozitZmeny.Location = new System.Drawing.Point(347, 273); + this.btnUlozitZmeny.Location = new System.Drawing.Point(377, 298); this.btnUlozitZmeny.Name = "btnUlozitZmeny"; this.btnUlozitZmeny.Size = new System.Drawing.Size(91, 23); this.btnUlozitZmeny.TabIndex = 14; @@ -136,7 +138,7 @@ // btnZobrazVykres // this.btnZobrazVykres.Enabled = false; - this.btnZobrazVykres.Location = new System.Drawing.Point(248, 273); + this.btnZobrazVykres.Location = new System.Drawing.Point(251, 298); this.btnZobrazVykres.Name = "btnZobrazVykres"; this.btnZobrazVykres.Size = new System.Drawing.Size(93, 23); this.btnZobrazVykres.TabIndex = 13; @@ -147,16 +149,17 @@ // dateTimePicker1 // this.dateTimePicker1.CustomFormat = "YYYY-mm-DD"; - this.dateTimePicker1.Location = new System.Drawing.Point(98, 87); + this.dateTimePicker1.Location = new System.Drawing.Point(158, 87); this.dateTimePicker1.Name = "dateTimePicker1"; this.dateTimePicker1.Size = new System.Drawing.Size(174, 20); this.dateTimePicker1.TabIndex = 28; + this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged); // // label23 // this.label23.AutoSize = true; this.label23.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.label23.Location = new System.Drawing.Point(150, 112); + this.label23.Location = new System.Drawing.Point(210, 134); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(54, 13); this.label23.TabIndex = 38; @@ -165,7 +168,7 @@ // // label22 // - this.label22.Location = new System.Drawing.Point(213, 142); + this.label22.Location = new System.Drawing.Point(273, 164); this.label22.Name = "label22"; this.label22.Size = new System.Drawing.Size(55, 13); this.label22.TabIndex = 37; @@ -175,7 +178,7 @@ // label21 // this.label21.AutoSize = true; - this.label21.Location = new System.Drawing.Point(213, 129); + this.label21.Location = new System.Drawing.Point(273, 151); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(55, 13); this.label21.TabIndex = 36; @@ -183,7 +186,7 @@ // // numericUpDown1 // - this.numericUpDown1.Location = new System.Drawing.Point(205, 109); + this.numericUpDown1.Location = new System.Drawing.Point(265, 131); this.numericUpDown1.Maximum = new decimal(new int[] { 99999, 0, @@ -197,7 +200,7 @@ // checkBox1 // this.checkBox1.AutoSize = true; - this.checkBox1.Location = new System.Drawing.Point(259, 112); + this.checkBox1.Location = new System.Drawing.Point(319, 134); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(15, 14); this.checkBox1.TabIndex = 35; @@ -207,7 +210,7 @@ // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(155, 129); + this.label11.Location = new System.Drawing.Point(215, 151); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(55, 13); this.label11.TabIndex = 33; @@ -215,6 +218,8 @@ // // groupBox4 // + this.groupBox4.Controls.Add(this.dateTimePicker2); + this.groupBox4.Controls.Add(this.label25); this.groupBox4.Controls.Add(this.dateTimePicker1); this.groupBox4.Controls.Add(this.label23); this.groupBox4.Controls.Add(this.label22); @@ -248,7 +253,7 @@ this.groupBox4.Controls.Add(this.label7); this.groupBox4.Location = new System.Drawing.Point(249, 1); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(278, 272); + this.groupBox4.Size = new System.Drawing.Size(335, 294); this.groupBox4.TabIndex = 12; this.groupBox4.TabStop = false; this.groupBox4.Text = "Informácie o zázname"; @@ -256,7 +261,7 @@ // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(97, 129); + this.label10.Location = new System.Drawing.Point(157, 151); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(55, 13); this.label10.TabIndex = 32; @@ -264,7 +269,7 @@ // // label6 // - this.label6.Location = new System.Drawing.Point(3, 251); + this.label6.Location = new System.Drawing.Point(3, 273); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(90, 14); this.label6.TabIndex = 30; @@ -274,7 +279,7 @@ // 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(101, 247); + this.label5.Location = new System.Drawing.Point(161, 269); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(0, 20); this.label5.TabIndex = 9; @@ -283,14 +288,14 @@ // this.lblInynazov.AutoSize = true; this.lblInynazov.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.lblInynazov.Location = new System.Drawing.Point(101, 155); + this.lblInynazov.Location = new System.Drawing.Point(161, 177); this.lblInynazov.Name = "lblInynazov"; this.lblInynazov.Size = new System.Drawing.Size(0, 20); this.lblInynazov.TabIndex = 29; // // label19 // - this.label19.Location = new System.Drawing.Point(3, 203); + this.label19.Location = new System.Drawing.Point(3, 225); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(90, 14); this.label19.TabIndex = 25; @@ -300,7 +305,7 @@ // this.comboBox7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox7.FormattingEnabled = true; - this.comboBox7.Location = new System.Drawing.Point(98, 200); + this.comboBox7.Location = new System.Drawing.Point(158, 222); this.comboBox7.Name = "comboBox7"; this.comboBox7.Size = new System.Drawing.Size(174, 21); this.comboBox7.TabIndex = 24; @@ -308,7 +313,7 @@ // // label18 // - this.label18.Location = new System.Drawing.Point(97, 142); + this.label18.Location = new System.Drawing.Point(157, 164); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(55, 13); this.label18.TabIndex = 23; @@ -317,7 +322,7 @@ // // label17 // - this.label17.Location = new System.Drawing.Point(155, 142); + this.label17.Location = new System.Drawing.Point(215, 164); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(55, 13); this.label17.TabIndex = 22; @@ -326,14 +331,14 @@ // // textBox8 // - this.textBox8.Location = new System.Drawing.Point(98, 224); + this.textBox8.Location = new System.Drawing.Point(158, 246); this.textBox8.Name = "textBox8"; this.textBox8.Size = new System.Drawing.Size(174, 20); this.textBox8.TabIndex = 18; // // textBox7 // - this.textBox7.Location = new System.Drawing.Point(98, 177); + this.textBox7.Location = new System.Drawing.Point(158, 199); this.textBox7.Name = "textBox7"; this.textBox7.Size = new System.Drawing.Size(174, 20); this.textBox7.TabIndex = 17; @@ -341,7 +346,7 @@ // // textBox6 // - this.textBox6.Location = new System.Drawing.Point(98, 109); + this.textBox6.Location = new System.Drawing.Point(158, 131); this.textBox6.MaxLength = 6; this.textBox6.Name = "textBox6"; this.textBox6.Size = new System.Drawing.Size(51, 20); @@ -350,7 +355,7 @@ // // button3 // - this.button3.Location = new System.Drawing.Point(245, 62); + this.button3.Location = new System.Drawing.Point(305, 62); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(27, 23); this.button3.TabIndex = 13; @@ -361,7 +366,7 @@ // this.comboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox4.FormattingEnabled = true; - this.comboBox4.Location = new System.Drawing.Point(98, 63); + this.comboBox4.Location = new System.Drawing.Point(158, 63); this.comboBox4.Name = "comboBox4"; this.comboBox4.Size = new System.Drawing.Size(141, 21); this.comboBox4.TabIndex = 12; @@ -369,7 +374,7 @@ // // button4 // - this.button4.Location = new System.Drawing.Point(245, 39); + this.button4.Location = new System.Drawing.Point(305, 39); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(27, 23); this.button4.TabIndex = 10; @@ -380,7 +385,7 @@ // this.comboBox5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox5.FormattingEnabled = true; - this.comboBox5.Location = new System.Drawing.Point(98, 40); + this.comboBox5.Location = new System.Drawing.Point(158, 40); this.comboBox5.Name = "comboBox5"; this.comboBox5.Size = new System.Drawing.Size(141, 21); this.comboBox5.TabIndex = 9; @@ -388,7 +393,7 @@ // // textBox5 // - this.textBox5.Location = new System.Drawing.Point(98, 17); + this.textBox5.Location = new System.Drawing.Point(158, 17); this.textBox5.Name = "textBox5"; this.textBox5.Size = new System.Drawing.Size(174, 20); this.textBox5.TabIndex = 8; @@ -396,7 +401,7 @@ // // label16 // - this.label16.Location = new System.Drawing.Point(3, 226); + this.label16.Location = new System.Drawing.Point(3, 248); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(90, 14); this.label16.TabIndex = 7; @@ -404,7 +409,7 @@ // // label15 // - this.label15.Location = new System.Drawing.Point(3, 180); + this.label15.Location = new System.Drawing.Point(3, 202); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(90, 14); this.label15.TabIndex = 6; @@ -412,7 +417,7 @@ // // label14 // - this.label14.Location = new System.Drawing.Point(3, 157); + this.label14.Location = new System.Drawing.Point(3, 179); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(90, 14); this.label14.TabIndex = 5; @@ -420,7 +425,7 @@ // // label13 // - this.label13.Location = new System.Drawing.Point(3, 109); + this.label13.Location = new System.Drawing.Point(3, 131); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(90, 45); this.label13.TabIndex = 4; @@ -507,10 +512,19 @@ this.groupBox1.TabStop = false; this.groupBox1.Text = "Typ záznamu"; // + // textBox2 + // + this.textBox2.Enabled = false; + this.textBox2.Location = new System.Drawing.Point(3, 116); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(68, 20); + this.textBox2.TabIndex = 11; + this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged); + // // label24 // this.label24.AutoSize = true; - this.label24.Location = new System.Drawing.Point(130, 77); + this.label24.Location = new System.Drawing.Point(127, 77); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(52, 13); this.label24.TabIndex = 9; @@ -681,20 +695,27 @@ this.groupBox2.TabStop = false; this.groupBox2.Text = "Zákazník a výkres"; // - // textBox2 + // dateTimePicker2 // - this.textBox2.Enabled = false; - this.textBox2.Location = new System.Drawing.Point(3, 116); - this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(68, 20); - this.textBox2.TabIndex = 11; - this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged); + this.dateTimePicker2.CustomFormat = "YYYY-mm-DD"; + this.dateTimePicker2.Location = new System.Drawing.Point(158, 109); + this.dateTimePicker2.Name = "dateTimePicker2"; + this.dateTimePicker2.Size = new System.Drawing.Size(174, 20); + this.dateTimePicker2.TabIndex = 40; + // + // label25 + // + this.label25.Location = new System.Drawing.Point(3, 111); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(149, 18); + this.label25.TabIndex = 39; + this.label25.Text = "Dátum potvrdený zákazníkovi"; // // frmEditDopyt // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(528, 297); + this.ClientSize = new System.Drawing.Size(585, 323); this.Controls.Add(this.groupBox3); this.Controls.Add(this.button8); this.Controls.Add(this.btnUlozitZmeny); @@ -779,5 +800,7 @@ private System.Windows.Forms.ComboBox comboBox3; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.DateTimePicker dateTimePicker2; + private System.Windows.Forms.Label label25; } } \ No newline at end of file diff --git a/Mip/frmEditDopyt.cs b/Mip/frmEditDopyt.cs index 3d514b3..7c70f28 100644 --- a/Mip/frmEditDopyt.cs +++ b/Mip/frmEditDopyt.cs @@ -1,11 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace Mip @@ -30,7 +24,7 @@ namespace Mip string strStatusDopytu = ""; string strPocetDoVyroby = ""; strPocetDoVyroby = label22.Text.ToString(); - if (Convert.ToInt32(strPocetDoVyroby) == 0 && (rBdopyt.Checked==true || rBzKontraktu.Checked==true)) + if (Convert.ToInt32(strPocetDoVyroby) == 0 && (rBdopyt.Checked == true || rBzKontraktu.Checked == true)) { classSQL.SQL("DELETE FROM `mip`.`tabvyroba` WHERE `IDDopyt` = " + strIDDopyt + ";"); strStatusDopytu = "`StatusDopytu` = 'Na lapovni',"; @@ -82,7 +76,7 @@ namespace Mip classSQL.SQL(cmd); } } - else + else { if (numericUpDown1.Value != 0) // insert { @@ -98,17 +92,17 @@ namespace Mip + "'Nevybavený'" + ", " + IDvyrobokPrePocetNaSklade.ToString() + ", " + "0" + ", " //v pripade vyberu zo skladu je namiesto id expedicia vlozena hodnota "0", lebo id expedicia pre tento zaznam neexistuje - + strIDDopyt + ", '" + + strIDDopyt + ", '" + strMatUMat + "', " + numericUpDown1.Value.ToString() + ", " + "DATE(NOW()) );"; classSQL.SQL(cmd); } } - + MessageBox.Show("Dopyt zmenený!"); this.Close(); - + } private void frmEditDopyt_Load(object sender, EventArgs e) @@ -118,8 +112,8 @@ namespace Mip classSQL.SQL("SELECT * FROM pohladdopyty WHERE `IDCPOBJ` = " + strIDDopyt + ";", out DTEditDopyt); - if (DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["TypDopytu"].Ordinal].ToString() == "Cenová ponuka"){rBdopyt.Checked = true; rBdopyt.Enabled = true;} - if (DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["TypDopytu"].Ordinal].ToString() == "Objednávka"){rBObj.Checked = true; rBObj.Enabled = true;} + if (DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["TypDopytu"].Ordinal].ToString() == "Cenová ponuka") { rBdopyt.Checked = true; rBdopyt.Enabled = true; } + if (DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["TypDopytu"].Ordinal].ToString() == "Objednávka") { rBObj.Checked = true; rBObj.Enabled = true; } if (DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["TypDopytu"].Ordinal].ToString() == "Objednávka do kontraktu") { rBObjDoKontr.Checked = true; rBObjDoKontr.Enabled = true; } if (DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["TypDopytu"].Ordinal].ToString() == "Kontrakt") { rBKontrakt.Checked = true; rBKontrakt.Enabled = true; } if (DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["TypDopytu"].Ordinal].ToString() == "Call Off") { rBzKontraktu.Checked = true; rBzKontraktu.Enabled = true; } @@ -136,7 +130,7 @@ namespace Mip textBox5.Text = DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["CisloObj"].Ordinal].ToString(); comboBox5.Text = DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["Material"].Ordinal].ToString(); comboBox4.Text = DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["UpravaMaterialu"].Ordinal].ToString(); - dateTimePicker1.Value = Convert.ToDateTime( DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["DatumPotvrdeny"].Ordinal]); + dateTimePicker1.Value = Convert.ToDateTime(DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["DatumPotvrdeny"].Ordinal]); textBox6.Text = DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["PocetKusov"].Ordinal].ToString(); //numericUpDown1.Minimum = 0; //numericUpDown1.Maximum = Convert.ToInt32(DTEditDopyt.Rows[0].ItemArray[DTEditDopyt.Columns["PocetZoSkladu"].Ordinal].ToString()); @@ -201,14 +195,14 @@ namespace Mip textBox8.Text = ""; btnAddOBJ.Enabled = false; btnZobrazVykres.Enabled = false;*/ - + } Int32 IDvyrobokPrePocetNaSklade; private void comboBox3_SelectedValueChanged(object sender, EventArgs e) { string cmd; - + cmd = "SELECT * FROM `mip`.`tabvyrobok` WHERE `NazovVyrobku` = '" //SELECT `NazovVyrobku`, `Alias` + comboBox3.Text + "' AND `Zakaznik` = '" + comboBox2.Text + "' ;"; @@ -228,7 +222,7 @@ namespace Mip ZistiPocetNaSklade(); ZistiPocetVoVyrobe(); ZistiPouziteCeny(); - + } private void button8_Click(object sender, EventArgs e) @@ -309,9 +303,9 @@ namespace Mip if (comboBox5.Text != "") { - ZistiPocetNaSklade(); - ZistiPocetVoVyrobe(); - ZistiPouziteCeny(); + ZistiPocetNaSklade(); + ZistiPocetVoVyrobe(); + ZistiPouziteCeny(); } else { @@ -325,11 +319,11 @@ namespace Mip { if (EnableSelectedValueChange == true) { - /* string CenaDoTextBoxu ; - classSQL.SQL("SELECT `CenaOBJ` FROM `tabdopyt` WHERE `tabdopyt`.IDCPOBJ = '" + comboBox7.SelectedValue.ToString() + "';", out CenaDoTextBoxu); + /* string CenaDoTextBoxu ; + classSQL.SQL("SELECT `CenaOBJ` FROM `tabdopyt` WHERE `tabdopyt`.IDCPOBJ = '" + comboBox7.SelectedValue.ToString() + "';", out CenaDoTextBoxu); - textBox7.Text = CenaDoTextBoxu; - */ + textBox7.Text = CenaDoTextBoxu; + */ } } @@ -372,7 +366,7 @@ namespace Mip `tabskladvyrobkov`.IDvyr = " + IDvyrobokPrePocetNaSklade + @"),0) AS `TotalNaSklade`"; classSQL.SQL(cmd, out TotalNaSklade); - if (Convert.ToInt32(TotalNaSklade.Rows[0][0].ToString()) != 0) label17.Text = TotalNaSklade.Rows[0][0].ToString(); + if (Convert.ToInt32(TotalNaSklade.Rows[0][0].ToString()) != 0) label17.Text = TotalNaSklade.Rows[0][0].ToString(); else label17.Text = "0"; } @@ -467,6 +461,9 @@ namespace Mip classGlobal.FillCB(comboBox1, "tabdopyt", "CisloObj", "TypDopytu", "Kontrakt", textBox2); } - + private void dateTimePicker1_ValueChanged(object sender, EventArgs e) + { + dateTimePicker2.MinDate = dateTimePicker1.Value; + } } } diff --git a/Mip/frmMain.Designer.cs b/Mip/frmMain.Designer.cs index 3a3bf2f..134aa69 100644 --- a/Mip/frmMain.Designer.cs +++ b/Mip/frmMain.Designer.cs @@ -11935,7 +11935,7 @@ this.lblVerzia.Name = "lblVerzia"; this.lblVerzia.Size = new System.Drawing.Size(34, 13); this.lblVerzia.TabIndex = 13; - this.lblVerzia.Text = "1,009"; + this.lblVerzia.Text = "1,010"; this.lblVerzia.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label50 diff --git a/Mip/frmMain.cs b/Mip/frmMain.cs index bcf63f6..969ea4f 100644 --- a/Mip/frmMain.cs +++ b/Mip/frmMain.cs @@ -1240,7 +1240,7 @@ namespace Mip IF (UpravaMaterialu = '',Material,CONCAT(Material,'-',UpravaMaterialu)) AS Material, UpravaMaterialu, Material, - IF (PocetDoVyroby=0,PocetKusov,CONCAT (PocetKusov,'(',PocetDoVyroby,')')) AS PocetKusov, + IF (PocetDoVyroby=0,PocetKusov,CONCAT (PocetKusov,',',PocetDoVyroby,',', PocetKusov-(SELECT IFNULL( SUM(`tabexpedicia`.PocetOdoslanychKusov), 0) FROM `tabexpedicia` WHERE `tabexpedicia`.IDDopyt=`pohladdopyty`.IDCPOBJ ))) AS PocetKusov, RozlisZnakKonecnaOp, SpojeneRozmery, IF (StatusDopytu='Pozastavená',StatusDopytu,PoznamkaOBJ) AS PoznamkaOBJ @@ -1251,7 +1251,7 @@ namespace Mip `PocetDoVyroby` != 0 AND `StatusDopytu` != 'Zrušená' AND `StatusDopytu` != 'Odoslaná' - ORDER BY `DatumPotvrdeny`, `Zakaznik`, `DatumPrijatiaOBJ`"; + ORDER BY `DatumPotvrdeny`, `Zakaznik`, `DatumPrijatiaOBJ`;"; classSQL.SQL(cmdZoznamy, out tblTlacitZoznamy); CultureInfo local = new CultureInfo("sk-SK"); diff --git a/Mip/frmNewDopyt.Designer.cs b/Mip/frmNewDopyt.Designer.cs index caa1e9a..47c6ea5 100644 --- a/Mip/frmNewDopyt.Designer.cs +++ b/Mip/frmNewDopyt.Designer.cs @@ -52,6 +52,8 @@ this.comboBox2 = new System.Windows.Forms.ComboBox(); this.label1 = new System.Windows.Forms.Label(); this.groupBox4 = new System.Windows.Forms.GroupBox(); + this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker(); + this.label25 = new System.Windows.Forms.Label(); this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); this.label23 = new System.Windows.Forms.Label(); this.label22 = new System.Windows.Forms.Label(); @@ -127,7 +129,7 @@ // label24 // this.label24.AutoSize = true; - this.label24.Location = new System.Drawing.Point(130, 77); + this.label24.Location = new System.Drawing.Point(127, 77); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(52, 13); this.label24.TabIndex = 9; @@ -366,6 +368,8 @@ // // groupBox4 // + this.groupBox4.Controls.Add(this.dateTimePicker2); + this.groupBox4.Controls.Add(this.label25); this.groupBox4.Controls.Add(this.dateTimePicker1); this.groupBox4.Controls.Add(this.label23); this.groupBox4.Controls.Add(this.label22); @@ -400,25 +404,42 @@ this.groupBox4.Enabled = false; this.groupBox4.Location = new System.Drawing.Point(249, 1); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(278, 272); + this.groupBox4.Size = new System.Drawing.Size(335, 294); this.groupBox4.TabIndex = 3; this.groupBox4.TabStop = false; this.groupBox4.Text = "Informácie o zázname"; // + // dateTimePicker2 + // + this.dateTimePicker2.CustomFormat = "YYYY-mm-DD"; + this.dateTimePicker2.Location = new System.Drawing.Point(158, 110); + this.dateTimePicker2.Name = "dateTimePicker2"; + this.dateTimePicker2.Size = new System.Drawing.Size(174, 20); + this.dateTimePicker2.TabIndex = 40; + // + // label25 + // + this.label25.Location = new System.Drawing.Point(3, 112); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(149, 18); + this.label25.TabIndex = 39; + this.label25.Text = "Dátum potvrdený zákazníkovi"; + // // dateTimePicker1 // this.dateTimePicker1.CustomFormat = "YYYY-mm-DD"; - this.dateTimePicker1.Location = new System.Drawing.Point(98, 87); + this.dateTimePicker1.Location = new System.Drawing.Point(158, 87); this.dateTimePicker1.Name = "dateTimePicker1"; this.dateTimePicker1.Size = new System.Drawing.Size(174, 20); this.dateTimePicker1.TabIndex = 28; + this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged); // // label23 // this.label23.AutoSize = true; this.label23.Enabled = false; this.label23.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.label23.Location = new System.Drawing.Point(150, 112); + this.label23.Location = new System.Drawing.Point(210, 135); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(54, 13); this.label23.TabIndex = 38; @@ -427,7 +448,7 @@ // // label22 // - this.label22.Location = new System.Drawing.Point(213, 142); + this.label22.Location = new System.Drawing.Point(273, 165); this.label22.Name = "label22"; this.label22.Size = new System.Drawing.Size(55, 13); this.label22.TabIndex = 37; @@ -437,7 +458,7 @@ // label21 // this.label21.AutoSize = true; - this.label21.Location = new System.Drawing.Point(213, 129); + this.label21.Location = new System.Drawing.Point(273, 152); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(55, 13); this.label21.TabIndex = 36; @@ -446,7 +467,7 @@ // numericUpDown1 // this.numericUpDown1.Enabled = false; - this.numericUpDown1.Location = new System.Drawing.Point(205, 109); + this.numericUpDown1.Location = new System.Drawing.Point(265, 132); this.numericUpDown1.Maximum = new decimal(new int[] { 99999, 0, @@ -460,7 +481,7 @@ // checkBox1 // this.checkBox1.AutoSize = true; - this.checkBox1.Location = new System.Drawing.Point(259, 112); + this.checkBox1.Location = new System.Drawing.Point(319, 135); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(15, 14); this.checkBox1.TabIndex = 35; @@ -470,7 +491,7 @@ // label11 // this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(155, 129); + this.label11.Location = new System.Drawing.Point(215, 152); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(55, 13); this.label11.TabIndex = 33; @@ -479,7 +500,7 @@ // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(97, 129); + this.label10.Location = new System.Drawing.Point(157, 152); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(55, 13); this.label10.TabIndex = 32; @@ -487,7 +508,7 @@ // // label6 // - this.label6.Location = new System.Drawing.Point(3, 251); + this.label6.Location = new System.Drawing.Point(3, 274); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(90, 14); this.label6.TabIndex = 30; @@ -497,7 +518,7 @@ // 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(101, 245); + this.label5.Location = new System.Drawing.Point(160, 268); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(0, 20); this.label5.TabIndex = 9; @@ -506,14 +527,14 @@ // this.lblInynazov.AutoSize = true; this.lblInynazov.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.lblInynazov.Location = new System.Drawing.Point(101, 155); + this.lblInynazov.Location = new System.Drawing.Point(161, 178); this.lblInynazov.Name = "lblInynazov"; this.lblInynazov.Size = new System.Drawing.Size(0, 20); this.lblInynazov.TabIndex = 29; // // label19 // - this.label19.Location = new System.Drawing.Point(3, 203); + this.label19.Location = new System.Drawing.Point(3, 226); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(90, 14); this.label19.TabIndex = 25; @@ -524,7 +545,7 @@ this.comboBox7.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox7.Enabled = false; this.comboBox7.FormattingEnabled = true; - this.comboBox7.Location = new System.Drawing.Point(98, 200); + this.comboBox7.Location = new System.Drawing.Point(158, 223); this.comboBox7.Name = "comboBox7"; this.comboBox7.Size = new System.Drawing.Size(174, 21); this.comboBox7.TabIndex = 24; @@ -532,7 +553,7 @@ // // label18 // - this.label18.Location = new System.Drawing.Point(97, 142); + this.label18.Location = new System.Drawing.Point(157, 165); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(55, 13); this.label18.TabIndex = 23; @@ -541,7 +562,7 @@ // // label17 // - this.label17.Location = new System.Drawing.Point(155, 142); + this.label17.Location = new System.Drawing.Point(215, 165); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(55, 13); this.label17.TabIndex = 22; @@ -550,14 +571,14 @@ // // textBox8 // - this.textBox8.Location = new System.Drawing.Point(98, 224); + this.textBox8.Location = new System.Drawing.Point(158, 247); this.textBox8.Name = "textBox8"; this.textBox8.Size = new System.Drawing.Size(174, 20); this.textBox8.TabIndex = 18; // // textBox7 // - this.textBox7.Location = new System.Drawing.Point(98, 177); + this.textBox7.Location = new System.Drawing.Point(158, 200); this.textBox7.Name = "textBox7"; this.textBox7.Size = new System.Drawing.Size(174, 20); this.textBox7.TabIndex = 17; @@ -568,7 +589,7 @@ // // textBox6 // - this.textBox6.Location = new System.Drawing.Point(98, 109); + this.textBox6.Location = new System.Drawing.Point(158, 132); this.textBox6.MaxLength = 6; this.textBox6.Name = "textBox6"; this.textBox6.Size = new System.Drawing.Size(51, 20); @@ -578,7 +599,7 @@ // // button3 // - this.button3.Location = new System.Drawing.Point(245, 62); + this.button3.Location = new System.Drawing.Point(305, 62); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(27, 23); this.button3.TabIndex = 13; @@ -590,7 +611,7 @@ // this.comboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox4.FormattingEnabled = true; - this.comboBox4.Location = new System.Drawing.Point(98, 63); + this.comboBox4.Location = new System.Drawing.Point(158, 63); this.comboBox4.Name = "comboBox4"; this.comboBox4.Size = new System.Drawing.Size(141, 21); this.comboBox4.TabIndex = 12; @@ -598,7 +619,7 @@ // // button4 // - this.button4.Location = new System.Drawing.Point(245, 39); + this.button4.Location = new System.Drawing.Point(305, 39); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(27, 23); this.button4.TabIndex = 10; @@ -610,7 +631,7 @@ // this.comboBox5.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox5.FormattingEnabled = true; - this.comboBox5.Location = new System.Drawing.Point(98, 40); + this.comboBox5.Location = new System.Drawing.Point(158, 40); this.comboBox5.Name = "comboBox5"; this.comboBox5.Size = new System.Drawing.Size(141, 21); this.comboBox5.TabIndex = 9; @@ -618,7 +639,7 @@ // // textBox5 // - this.textBox5.Location = new System.Drawing.Point(98, 17); + this.textBox5.Location = new System.Drawing.Point(158, 17); this.textBox5.Name = "textBox5"; this.textBox5.Size = new System.Drawing.Size(174, 20); this.textBox5.TabIndex = 8; @@ -626,7 +647,7 @@ // // label16 // - this.label16.Location = new System.Drawing.Point(3, 226); + this.label16.Location = new System.Drawing.Point(3, 249); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(90, 14); this.label16.TabIndex = 7; @@ -634,7 +655,7 @@ // // label15 // - this.label15.Location = new System.Drawing.Point(3, 180); + this.label15.Location = new System.Drawing.Point(3, 203); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(90, 14); this.label15.TabIndex = 6; @@ -642,7 +663,7 @@ // // label14 // - this.label14.Location = new System.Drawing.Point(3, 157); + this.label14.Location = new System.Drawing.Point(3, 180); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(90, 14); this.label14.TabIndex = 5; @@ -650,9 +671,9 @@ // // label13 // - this.label13.Location = new System.Drawing.Point(3, 109); + this.label13.Location = new System.Drawing.Point(3, 132); this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(90, 45); + this.label13.Size = new System.Drawing.Size(98, 45); this.label13.TabIndex = 4; this.label13.Text = "Objednaný počet kusov"; this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -692,7 +713,7 @@ // btnZobrazVykres // this.btnZobrazVykres.Enabled = false; - this.btnZobrazVykres.Location = new System.Drawing.Point(248, 273); + this.btnZobrazVykres.Location = new System.Drawing.Point(251, 297); this.btnZobrazVykres.Name = "btnZobrazVykres"; this.btnZobrazVykres.Size = new System.Drawing.Size(93, 23); this.btnZobrazVykres.TabIndex = 5; @@ -703,7 +724,7 @@ // btnAddOBJ // this.btnAddOBJ.Enabled = false; - this.btnAddOBJ.Location = new System.Drawing.Point(347, 273); + this.btnAddOBJ.Location = new System.Drawing.Point(378, 297); this.btnAddOBJ.Name = "btnAddOBJ"; this.btnAddOBJ.Size = new System.Drawing.Size(91, 23); this.btnAddOBJ.TabIndex = 6; @@ -713,7 +734,7 @@ // // button8 // - this.button8.Location = new System.Drawing.Point(444, 273); + this.button8.Location = new System.Drawing.Point(500, 297); this.button8.Name = "button8"; this.button8.Size = new System.Drawing.Size(83, 23); this.button8.TabIndex = 7; @@ -736,7 +757,7 @@ this.groupBox3.Enabled = false; this.groupBox3.Location = new System.Drawing.Point(1, 244); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Size = new System.Drawing.Size(247, 53); + this.groupBox3.Size = new System.Drawing.Size(247, 79); this.groupBox3.TabIndex = 9; this.groupBox3.TabStop = false; this.groupBox3.Text = "Rozmery výrobku"; @@ -745,7 +766,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(528, 297); + this.ClientSize = new System.Drawing.Size(585, 323); this.Controls.Add(this.groupBox3); this.Controls.Add(this.button8); this.Controls.Add(this.btnAddOBJ); @@ -835,5 +856,7 @@ private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.TextBox textBox4; private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.DateTimePicker dateTimePicker2; + private System.Windows.Forms.Label label25; } } \ No newline at end of file diff --git a/Mip/frmNewDopyt.cs b/Mip/frmNewDopyt.cs index 7283491..a3b3583 100644 --- a/Mip/frmNewDopyt.cs +++ b/Mip/frmNewDopyt.cs @@ -1,11 +1,6 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; using System.Data; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace Mip @@ -29,7 +24,7 @@ namespace Mip private void btnAddOBJ_Click(object sender, EventArgs e) { - DateTime dt; + DateTime dt; dt = DateTime.Now; string format = "yyyy-MM-dd"; @@ -37,16 +32,16 @@ namespace Mip string TypDopytu = "", StatusDopytu = "", PotvrdDatum = ""; string cmd; //if (rBdopyt.Checked == true){TypDopytu = "Cenová ponuka"; StatusDopytu = "Prijatá";} - if (rBObj.Checked == true){TypDopytu = "Objednávka"; StatusDopytu = "Prijatá";} + if (rBObj.Checked == true) { TypDopytu = "Objednávka"; StatusDopytu = "Prijatá"; } if (rBObjDoKontr.Checked == true) { TypDopytu = "Objednávka do kontraktu"; StatusDopytu = "Prijatá"; } - if (rBKontrakt.Checked == true) {TypDopytu = "Kontrakt"; StatusDopytu = "Prijatý";} - if (rBzKontraktu.Checked == true){ TypDopytu = "Call Off"; StatusDopytu = "Prijatý";} + if (rBKontrakt.Checked == true) { TypDopytu = "Kontrakt"; StatusDopytu = "Prijatý"; } + if (rBzKontraktu.Checked == true) { TypDopytu = "Call Off"; StatusDopytu = "Prijatý"; } //ak je pocet do vyroby 0, status sa nastavi na hodnotu "Na lapovni, vyminka je kontrakt ten sa nezmeni aj ked je 0" string strPocetDoVyroby = ""; strPocetDoVyroby = label22.Text.ToString(); - if ( Convert.ToInt32(strPocetDoVyroby) == 0 && - (rBzKontraktu.Checked == true||rBObj.Checked == true)) StatusDopytu = "Na lapovni"; + if (Convert.ToInt32(strPocetDoVyroby) == 0 && + (rBzKontraktu.Checked == true || rBObj.Checked == true)) StatusDopytu = "Na lapovni"; PotvrdDatum = dateTimePicker1.Value.ToString(format); @@ -56,7 +51,7 @@ namespace Mip cmd = "UPDATE `mip`.`tabvyrobok` SET `Status výrobku` = 'Výroba' WHERE `IDVyrobok` = " + idvyr + ";"; classSQL.SQL(cmd); - + string cmd2 = "SELECT IFNULL(MAX(ZakazkoveCislo),0) AS Cislo FROM `mip`.`tabdopyt` WHERE MONTH (`DatumPrijatiaOBJ`) = MONTH(NOW()) AND YEAR(`DatumPrijatiaOBJ`) = YEAR(NOW());"; // zisti najvacsie zakazkove cislo Int32 intZakCislo; @@ -73,7 +68,7 @@ namespace Mip int intNevytlacene = 1; if ((rBObj.Checked == true && Convert.ToInt32(label22.Text) > 0) || rBObjDoKontr.Checked == true) intNevytlacene = 0; else intNevytlacene = 1; - + string cmd3 = @"INSERT INTO `mip`.`tabdopyt` (`TypDopytu`, `StatusDopytu`, `ZakazkoveCislo`, @@ -94,18 +89,18 @@ namespace Mip `VytlacenyKL-PS`, `VytlacenyKL-ZS`, `IDUsers`) VALUES ('" - + TypDopytu + "', '" + + TypDopytu + "', '" + StatusDopytu + "', '" + intZakCislo.ToString() + "', '" + comboBox1.Text + "', '" + textBox5.Text.ToString() + "', '" + comboBox5.Text.ToString() + "', '" + comboBox4.Text.ToString() + "', " - + "DATE(NOW()), '" //+ DatumPrijatia + "', '" - + PotvrdDatum + "', '" - + comboBox2.Text.ToString () + "', " //zakaznik + + "DATE(NOW()), '" //+ DatumPrijatia + "', '" + + PotvrdDatum + "', '" + + comboBox2.Text.ToString() + "', " //zakaznik + idvyr + ", '" //IDvyrobok - + textBox8.Text.ToString () + "', " //poznamka + + textBox8.Text.ToString() + "', " //poznamka + textBox6.Text.ToString() + ", " //pocet kusov + strCena.Replace(",", ".") + ", " //cena + label22.Text.ToString() + ", " //pocet do vyroby @@ -113,13 +108,13 @@ namespace Mip + textBox1.Text.ToString() + ", " //Pociatocny stav odoslanych kusov + intNevytlacene.ToString() + ", " + intNevytlacene.ToString() + ", " - + classUser.ID + ")"; + + classUser.ID + ")"; //classSQL.commandSQL(cmd); //DataTable d1 = classSQL.commandSQL("SELECT last_insert_id()", 1); Int32 idLastDopyt = 0; classSQL.SQL(cmd3, out idLastDopyt); - + //ak je obycajna objednavka prida zaznam do tabvyroba s ID dopytu if ((rBObj.Checked == true && Convert.ToInt32(strPocetDoVyroby) != 0) || rBObjDoKontr.Checked == true) classSQL.SQL("INSERT INTO `mip`.`tabvyroba` (`IDDopyt`) VALUES (" + idLastDopyt.ToString() + ");"); //ak je cenova ponuka prida zaznam do tab-nacenovanie s ID dopytu @@ -129,7 +124,7 @@ namespace Mip if ((rBObj.Checked == true && numericUpDown1.Value != 0) || (rBzKontraktu.Checked == true)) { string strTypVydaja = "'Výdaj'"; - if (rBObj.Checked == true && Convert.ToInt32(label22.Text)!=0) strTypVydaja = "'Rezervovaný výdaj'"; + if (rBObj.Checked == true && Convert.ToInt32(label22.Text) != 0) strTypVydaja = "'Rezervovaný výdaj'"; if (rBzKontraktu.Checked == true) strTypVydaja = "'Výdaj'"; string strMatUMat; @@ -144,13 +139,13 @@ namespace Mip + strMatUMat + "', " + numericUpDown1.Value.ToString() + ", " + "DATE(NOW()) );"; - classSQL.SQL(cmd); + classSQL.SQL(cmd); } - + MessageBox.Show("Dopyt pridaný!"); this.Close(); - + } private void button6_Click(object sender, EventArgs e) @@ -189,7 +184,7 @@ namespace Mip private void textBox7_TextChanged(object sender, EventArgs e) { - + } @@ -197,7 +192,7 @@ namespace Mip { float floatResult; if (e.KeyChar == '.') e.KeyChar = ','; - if(!(float.TryParse(textBox7.Text + e.KeyChar, out floatResult)) && (int ) e.KeyChar !=8) e.KeyChar = '\0'; + if (!(float.TryParse(textBox7.Text + e.KeyChar, out floatResult)) && (int)e.KeyChar != 8) e.KeyChar = '\0'; } private void textBox7_TextChanged_1(object sender, EventArgs e) @@ -225,10 +220,10 @@ namespace Mip { Form Add = new frmAddPomUdaje(); Add.Text = "Pridať zákazníka"; - DialogResult dr= Add.ShowDialog(); + DialogResult dr = Add.ShowDialog(); if (dr == DialogResult.OK) { - classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať zákazníka",textBox3); + classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať zákazníka", textBox3); comboBox2.Text = classGlobal.strNovyPomocnyUdaj; } } @@ -237,7 +232,7 @@ namespace Mip { Form Add = new frmAddPomUdaje(); Add.Text = "Pridať materiál"; - DialogResult dr= Add.ShowDialog(); + DialogResult dr = Add.ShowDialog(); if (dr == DialogResult.OK) { classGlobal.FillCB(comboBox5, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať materiál"); @@ -249,7 +244,7 @@ namespace Mip { Form Add = new frmAddPomUdaje(); Add.Text = "Pridať úpravu materiálu"; - DialogResult dr= Add.ShowDialog(); + DialogResult dr = Add.ShowDialog(); if (dr == DialogResult.OK) { classGlobal.FillCB(comboBox4, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať úpravu materiálu"); @@ -259,16 +254,16 @@ namespace Mip private void button5_Click(object sender, EventArgs e) { - + } - private void frmNewEditOBJ_Shown(object sender, EventArgs e) + private void frmNewEditOBJ_Shown(object sender, EventArgs e) { - classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať zákazníka",textBox3); + classGlobal.FillCB(comboBox2, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať zákazníka", textBox3); classGlobal.FillCB(comboBox5, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať materiál"); classGlobal.FillCB(comboBox4, "tabpomocnychudajov", "Hodnota", "Kategoria", "Pridať úpravu materiálu"); - - + + } // vyber zakaznika @@ -277,24 +272,24 @@ namespace Mip { comboBox3.Items.Clear(); - comboBox5.SelectedIndex=-1; + comboBox5.SelectedIndex = -1; comboBox4.SelectedIndex = -1; EnableSelectedValueChange = false; comboBox7.DataSource = null; comboBox7.Items.Clear(); comboBox7.Text = ""; - lblAlias.Text=""; + lblAlias.Text = ""; string cmd; - cmd = "SELECT * FROM `mip`.`tabvyrobok` WHERE `Zakaznik` = '" + comboBox2.Text + cmd = "SELECT * FROM `mip`.`tabvyrobok` WHERE `Zakaznik` = '" + comboBox2.Text + "' AND INSTR(`NazovVyrobku`, '" + textBox4.Text + "')>0 ORDER BY `NazovVyrobku`;"; classSQL.SQL(cmd, out globFrmDtbl); - + foreach (DataRow row in globFrmDtbl.Rows) { comboBox3.Items.Add(row["NazovVyrobku"].ToString()); - + } @@ -313,7 +308,7 @@ namespace Mip textBox8.Text = ""; btnAddOBJ.Enabled = false; btnZobrazVykres.Enabled = false; - + } @@ -323,11 +318,11 @@ namespace Mip string cmd; cmd = "SELECT * FROM `mip`.`tabvyrobok` WHERE `Zakaznik` = '" //SELECT `NazovVyrobku`, `Alias` - + comboBox2.Text + + comboBox2.Text + "' AND INSTR(`NazovVyrobku`, '" + textBox4.Text + "')>0 ORDER BY `NazovVyrobku`;"; classSQL.SQL(cmd, out globFrmDtbl); - + DataRow dt; dt = globFrmDtbl.Rows[comboBox3.SelectedIndex]; @@ -338,7 +333,7 @@ namespace Mip if (rBdopyt.Checked || rBKontrakt.Checked || rBObj.Checked) { - + groupBox3.Enabled = true; groupBox4.Enabled = true; @@ -349,7 +344,7 @@ namespace Mip } if (comboBox3.Text != "") btnZobrazVykres.Enabled = true; - else btnZobrazVykres.Enabled = false ; + else btnZobrazVykres.Enabled = false; if (rBObj.Checked) checkBox1.Enabled = true; else checkBox1.Enabled = false; lblToolTip.Text = comboBox3.Text; @@ -360,7 +355,7 @@ namespace Mip ZistiPocetNaSklade(); ZistiPocetVoVyrobe(); } - + } private void button2_Click(object sender, EventArgs e) @@ -368,13 +363,13 @@ namespace Mip Form Add = new frmPridatVyrobok(comboBox2.Text.ToString()); Add.Text = "Pridať výrobok"; DialogResult dr = Add.ShowDialog(); - + if (dr == DialogResult.OK) { - classGlobal.FillCB(comboBox3, "tabvyrobok","NazovVyrobku","Zakaznik",comboBox2.Text);//**// + classGlobal.FillCB(comboBox3, "tabvyrobok", "NazovVyrobku", "Zakaznik", comboBox2.Text);//**// comboBox3.Text = classGlobal.strNovyPomocnyUdaj; } - + } private void textBox5_TextChanged(object sender, EventArgs e) @@ -446,12 +441,12 @@ namespace Mip string strPocetKusov = dtrw["PocetKusov"].ToString(); string strOdoslane; - classSQL.SQL("SELECT SUM(`PocetKusov`) FROM pohladdopyty WHERE `NazovKontraktu` = '" + strNazovKontraktu + + classSQL.SQL("SELECT SUM(`PocetKusov`) FROM pohladdopyty WHERE `NazovKontraktu` = '" + strNazovKontraktu + "' AND `TypDopytu` = 'Call Off' AND `StatusDopytu` = 'Odoslaný';", out strOdoslane); string strNeodoslane; classSQL.SQL("SELECT SUM(`PocetKusov`) FROM pohladdopyty WHERE `NazovKontraktu` = '" + strNazovKontraktu + "' AND `TypDopytu` = 'Call Off' AND `StatusDopytu` != 'Odoslaný';", out strNeodoslane); - + if (strOdoslane == "") strOdoslane = "0"; if (strNeodoslane == "") strNeodoslane = "0"; @@ -466,9 +461,9 @@ namespace Mip private void VisibilityFlow() // Kontroluje, vypina a zapina zobrazenia a povolenia prvkov formulara { - - - if(rBdopyt.Checked || rBObj.Checked || rBKontrakt.Checked) + + + if (rBdopyt.Checked || rBObj.Checked || rBKontrakt.Checked) { comboBox1.Visible = false; textBox2.Visible = false; @@ -507,7 +502,7 @@ namespace Mip textBox3.Text = ""; comboBox3.Items.Clear(); textBox4.Text = ""; - lblAlias.Text=""; + lblAlias.Text = ""; //button2.Enabled = true; label2.Enabled = true; label3.Text = ""; @@ -525,7 +520,7 @@ namespace Mip comboBox5.SelectedIndex = -1; this.Text = "Nový záznam"; textBox2.Text = ""; - + } private void comboBox5_SelectedValueChanged(object sender, EventArgs e) @@ -600,7 +595,7 @@ namespace Mip private void comboBox4_SelectedValueChanged(object sender, EventArgs e) { - if (comboBox5.Text != "") + if (comboBox5.Text != "") { ZistiPocetNaSklade(); ZistiPocetVoVyrobe(); @@ -612,7 +607,7 @@ namespace Mip string strMatUMat; if (comboBox4.Text.ToString() == "") strMatUMat = comboBox5.Text.ToString(); else strMatUMat = comboBox5.Text.ToString() + " + " + comboBox4.Text.ToString(); - string cmd = @"SELECT + string cmd = @"SELECT IFNULL((SELECT SUM(`tabskladvyrobkov`.Pocet) FROM `tabskladvyrobkov` WHERE (`tabskladvyrobkov`.SkladOperacia = 'Príjem' OR `tabskladvyrobkov`.SkladOperacia = 'Inventárny príjem') AND `tabskladvyrobkov`.StatusSkladOperacie = 'Vybavený' AND @@ -625,10 +620,10 @@ namespace Mip `tabskladvyrobkov`.MaterialSUpravouMat = '" + strMatUMat + @"' AND `tabskladvyrobkov`.IDvyr = " + IDvyrobokPrePocetNaSklade + @"),0) AS `TotalNaSklade`"; - string strTotalNaSklade; - classSQL.SQL(cmd, out strTotalNaSklade); - if (strTotalNaSklade != "") label17.Text = strTotalNaSklade; - else label17.Text = "0"; + string strTotalNaSklade; + classSQL.SQL(cmd, out strTotalNaSklade); + if (strTotalNaSklade != "") label17.Text = strTotalNaSklade; + else label17.Text = "0"; } @@ -650,15 +645,15 @@ namespace Mip `pohladpocetciastocneodoslanych`.IDVyrobok = " + IDvyrobokPrePocetNaSklade + @"),0) AS `TotalVoVyrobe`"; - /* DataTable TotalVoVyrobe = classSQL.commandSQL(cmd, 1); - if (TotalVoVyrobe.Rows[0][0].ToString() != "") label18.Text = TotalVoVyrobe.Rows[0][0].ToString(); - else label18.Text = "0";*/ + /* DataTable TotalVoVyrobe = classSQL.commandSQL(cmd, 1); + if (TotalVoVyrobe.Rows[0][0].ToString() != "") label18.Text = TotalVoVyrobe.Rows[0][0].ToString(); + else label18.Text = "0";*/ string strTotalVoVyrobe = ""; classSQL.SQL(cmd, out strTotalVoVyrobe); label18.Text = strTotalVoVyrobe; } - + private void ZistiPouziteCeny() { string strTypDopytu = "(`tabdopyt`.TypDopytu = 'Objednávka do kontraktu' OR `tabdopyt`.TypDopytu = 'Objednávka')"; @@ -675,9 +670,9 @@ namespace Mip comboBox7.ValueMember = "IDCPOBJ"; comboBox7.DisplayMember = "CenaDatum"; EnableSelectedValueChange = true; - + } - + private void checkBox2_CheckedChanged(object sender, EventArgs e) { @@ -732,7 +727,7 @@ namespace Mip private void comboBox3_MouseHover(object sender, EventArgs e) { - if(comboBox3.Text != "") InfoPanel(groupBox2, comboBox3, comboBox3.Text); + if (comboBox3.Text != "") InfoPanel(groupBox2, comboBox3, comboBox3.Text); } @@ -744,11 +739,11 @@ namespace Mip lblToolTip.Text = hodnota; lblToolTip.AutoSize = true; lblToolTip.BorderStyle = BorderStyle.FixedSingle; - lblToolTip.Location = new Point(grpB.Location.X+ctrl.Location.X + ctrl.Width + 3,grpB.Location.Y+ ctrl.Location.Y); + lblToolTip.Location = new Point(grpB.Location.X + ctrl.Location.X + ctrl.Width + 3, grpB.Location.Y + ctrl.Location.Y); lblToolTip.Visible = true; this.Controls.Add(lblToolTip); lblToolTip.BringToFront(); - + } private void comboBox3_MouseLeave(object sender, EventArgs e) @@ -785,7 +780,12 @@ namespace Mip { lblToolTip.Visible = false; } + + private void dateTimePicker1_ValueChanged(object sender, EventArgs e) + { + dateTimePicker2.MinDate = dateTimePicker1.Value; + } } - + }