diff --git a/ПРСТ.sln b/ПРСТ.sln new file mode 100644 index 0000000..ca3e5d3 --- /dev/null +++ b/ПРСТ.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35521.163 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ПРСТ", "ПРСТ\ПРСТ.csproj", "{E77B81B5-CCE4-4B35-B7F6-E793C11E81FB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E77B81B5-CCE4-4B35-B7F6-E793C11E81FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E77B81B5-CCE4-4B35-B7F6-E793C11E81FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E77B81B5-CCE4-4B35-B7F6-E793C11E81FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E77B81B5-CCE4-4B35-B7F6-E793C11E81FB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ПРСТ/App.config b/ПРСТ/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/ПРСТ/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ПРСТ/Form1.Designer.cs b/ПРСТ/Form1.Designer.cs new file mode 100644 index 0000000..4ee57ce --- /dev/null +++ b/ПРСТ/Form1.Designer.cs @@ -0,0 +1,358 @@ +namespace ПРСТ +{ + partial class Form1 + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором форм Windows + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.checkBox3 = new System.Windows.Forms.CheckBox(); + this.textBox7 = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.textBox6 = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.textBox5 = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.textBox4 = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox9 = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.buttonClear = new System.Windows.Forms.Button(); + this.textBox8 = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.textBox8); + this.groupBox1.Controls.Add(this.label8); + this.groupBox1.Controls.Add(this.checkBox3); + this.groupBox1.Controls.Add(this.textBox7); + this.groupBox1.Controls.Add(this.label7); + this.groupBox1.Controls.Add(this.checkBox2); + this.groupBox1.Controls.Add(this.textBox6); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.checkBox1); + this.groupBox1.Controls.Add(this.textBox5); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.textBox4); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.textBox3); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.textBox2); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.textBox1); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.groupBox1.Location = new System.Drawing.Point(12, 12); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(325, 389); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Параметры"; + // + // checkBox3 + // + this.checkBox3.AutoSize = true; + this.checkBox3.Checked = true; + this.checkBox3.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.checkBox3.Location = new System.Drawing.Point(112, 349); + this.checkBox3.Name = "checkBox3"; + this.checkBox3.Size = new System.Drawing.Size(124, 17); + this.checkBox3.TabIndex = 16; + this.checkBox3.Text = "По умолчанию \"30\""; + this.checkBox3.UseVisualStyleBackColor = true; + this.checkBox3.CheckedChanged += new System.EventHandler(this.checkBox3_CheckedChanged); + // + // textBox7 + // + this.textBox7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox7.Location = new System.Drawing.Point(6, 347); + this.textBox7.Name = "textBox7"; + this.textBox7.Size = new System.Drawing.Size(100, 20); + this.textBox7.TabIndex = 15; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label7.Location = new System.Drawing.Point(3, 331); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(78, 13); + this.label7.TabIndex = 14; + this.label7.Text = "Приёмка ПВЗ"; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Checked = true; + this.checkBox2.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.checkBox2.Location = new System.Drawing.Point(112, 260); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(139, 17); + this.checkBox2.TabIndex = 13; + this.checkBox2.Text = "По умолчанию \"23,05\""; + this.checkBox2.UseVisualStyleBackColor = true; + this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBox2_CheckedChanged); + // + // textBox6 + // + this.textBox6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox6.Location = new System.Drawing.Point(6, 258); + this.textBox6.Name = "textBox6"; + this.textBox6.Size = new System.Drawing.Size(100, 20); + this.textBox6.TabIndex = 12; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label6.Location = new System.Drawing.Point(3, 242); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(50, 13); + this.label6.TabIndex = 11; + this.label6.Text = "Коробка"; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Checked = true; + this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.checkBox1.Location = new System.Drawing.Point(112, 174); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(130, 17); + this.checkBox1.TabIndex = 10; + this.checkBox1.Text = "По умолчанию \"100\""; + this.checkBox1.UseVisualStyleBackColor = true; + this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); + // + // textBox5 + // + this.textBox5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox5.Location = new System.Drawing.Point(6, 215); + this.textBox5.Name = "textBox5"; + this.textBox5.Size = new System.Drawing.Size(100, 20); + this.textBox5.TabIndex = 9; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label5.Location = new System.Drawing.Point(3, 199); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(58, 13); + this.label5.TabIndex = 8; + this.label5.Text = "Время РП"; + // + // textBox4 + // + this.textBox4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox4.Location = new System.Drawing.Point(6, 172); + this.textBox4.Name = "textBox4"; + this.textBox4.Size = new System.Drawing.Size(100, 20); + this.textBox4.TabIndex = 7; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label4.Location = new System.Drawing.Point(3, 156); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(90, 13); + this.label4.TabIndex = 6; + this.label4.Text = "Стоимость РП/ч"; + // + // textBox3 + // + this.textBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox3.Location = new System.Drawing.Point(6, 130); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(100, 20); + this.textBox3.TabIndex = 5; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label3.Location = new System.Drawing.Point(3, 114); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(67, 13); + this.label3.TabIndex = 4; + this.label3.Text = "Вес модели"; + // + // textBox2 + // + this.textBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox2.Location = new System.Drawing.Point(6, 87); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(100, 20); + this.textBox2.TabIndex = 3; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label2.Location = new System.Drawing.Point(3, 71); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(95, 13); + this.label2.TabIndex = 2; + this.label2.Text = "Грамм в катушке"; + // + // textBox1 + // + this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox1.Location = new System.Drawing.Point(6, 45); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(100, 20); + this.textBox1.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label1.Location = new System.Drawing.Point(3, 29); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(78, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Цена катушки"; + // + // textBox9 + // + this.textBox9.Location = new System.Drawing.Point(185, 400); + this.textBox9.Name = "textBox9"; + this.textBox9.Size = new System.Drawing.Size(152, 20); + this.textBox9.TabIndex = 1; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label9.Location = new System.Drawing.Point(9, 404); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(170, 16); + this.label9.TabIndex = 2; + this.label9.Text = "Финальная стоимость"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(12, 432); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 3; + this.button1.Text = "Расчитать"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // buttonClear + // + this.buttonClear.Location = new System.Drawing.Point(262, 432); + this.buttonClear.Name = "buttonClear"; + this.buttonClear.Size = new System.Drawing.Size(75, 23); + this.buttonClear.TabIndex = 4; + this.buttonClear.Text = "Очистить"; + this.buttonClear.UseVisualStyleBackColor = true; + this.buttonClear.Click += new System.EventHandler(this.buttonClear_Click); + // + // textBox8 + // + this.textBox8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.textBox8.Location = new System.Drawing.Point(6, 303); + this.textBox8.Name = "textBox8"; + this.textBox8.Size = new System.Drawing.Size(100, 20); + this.textBox8.TabIndex = 18; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label8.Location = new System.Drawing.Point(3, 287); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(44, 13); + this.label8.TabIndex = 17; + this.label8.Text = "Бумага"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(349, 519); + this.Controls.Add(this.buttonClear); + this.Controls.Add(this.button1); + this.Controls.Add(this.label9); + this.Controls.Add(this.textBox9); + this.Controls.Add(this.groupBox1); + this.Name = "Form1"; + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox textBox4; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.CheckBox checkBox3; + private System.Windows.Forms.TextBox textBox7; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.TextBox textBox6; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox checkBox1; + private System.Windows.Forms.TextBox textBox5; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox textBox9; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button buttonClear; + private System.Windows.Forms.TextBox textBox8; + private System.Windows.Forms.Label label8; + } +} + diff --git a/ПРСТ/Form1.cs b/ПРСТ/Form1.cs new file mode 100644 index 0000000..be99a4f --- /dev/null +++ b/ПРСТ/Form1.cs @@ -0,0 +1,209 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + +namespace ПРСТ +{ + public partial class Form1 : Form + { + double marketplacePercent = 0; + + public Form1() + { + InitializeComponent(); + } + + // Обработчик для формы загрузки + private void Form1_Load(object sender, EventArgs e) + { + // Проверяем состояние чекбоксов при запуске программы + if (checkBox1.Checked) + { + textBox4.Text = "100"; + textBox4.ReadOnly = true; + } + else + { + textBox4.ReadOnly = false; + } + + if (checkBox2.Checked) + { + textBox6.Text = "23.05"; + textBox6.ReadOnly = true; + } + else + { + textBox6.ReadOnly = false; + } + + if (checkBox3.Checked) + { + textBox7.Text = "30"; + textBox7.ReadOnly = true; + } + else + { + textBox7.ReadOnly = false; + } + } + + // Обработчик изменений состояния чекбоксов + private void checkBox1_CheckedChanged(object sender, EventArgs e) + { + if (checkBox1.Checked) + { + textBox4.Text = "100"; + textBox4.ReadOnly = true; + } + else + { + textBox4.ReadOnly = false; + } + } + + private void checkBox2_CheckedChanged(object sender, EventArgs e) + { + if (checkBox2.Checked) + { + textBox6.Text = "23.05"; + textBox6.ReadOnly = true; + } + else + { + textBox6.ReadOnly = false; + } + } + + private void checkBox3_CheckedChanged(object sender, EventArgs e) + { + if (checkBox3.Checked) + { + textBox7.Text = "30"; + textBox7.ReadOnly = true; + } + else + { + textBox7.ReadOnly = false; + } + } + + + private void button1_Click(object sender, EventArgs e) + { + double pricePerSpool, weightPerSpool, modelWeight, printTime, printCostPerHour, boxCost, pickupCost, tissueCost; + + // Преобразуем запятую в точку, если это необходимо, и затем пытаемся преобразовать строку в число + pricePerSpool = TryParseWithComma(textBox1.Text); + weightPerSpool = TryParseWithComma(textBox2.Text); + modelWeight = TryParseWithComma(textBox3.Text); + printTime = TryParseWithComma(textBox5.Text); + printCostPerHour = TryParseWithComma(textBox4.Text); + boxCost = TryParseWithComma(textBox6.Text); + pickupCost = TryParseWithComma(textBox7.Text); + tissueCost = TryParseWithComma(textBox8.Text); // Добавляем обработку для бумаги тишью + + // Проверяем, удалось ли успешно преобразовать все значения + if (pricePerSpool == -1 || weightPerSpool == -1 || modelWeight == -1 || printTime == -1 || + printCostPerHour == -1 || boxCost == -1 || pickupCost == -1 || tissueCost == -1) + { + MessageBox.Show("Введите корректные числовые значения в поля."); + return; + } + + // Чекбоксы: если они активированы, устанавливаем значения по умолчанию + if (checkBox1.Checked) + printCostPerHour = 100; // Значение по умолчанию для стоимости работы принтера + if (checkBox2.Checked) + boxCost = 23.05; // Значение по умолчанию для коробки + if (checkBox3.Checked) + pickupCost = 30; // Значение по умолчанию для приемки + + // Расчет стоимости пластика для модели + double plasticCost = (pricePerSpool / weightPerSpool) * modelWeight; + + // Расчет стоимости работы принтера + double printCost = printCostPerHour * printTime; + + // Расчет общей стоимости (пластик + принтер + коробка + приемка + бумага тишью) + double totalCost = plasticCost + printCost + boxCost + pickupCost + tissueCost; + + // Расчет процента маркетплейса + marketplacePercent = (plasticCost + printCost) * 0.5; + + // Расчет финальной стоимости с учетом процента маркетплейса + double finalCost = totalCost + plasticCost + marketplacePercent; // добавляем стоимость пластика еще раз + + // Отображаем финальную стоимость в textBox9 + textBox9.Text = finalCost.ToString("F2", CultureInfo.InvariantCulture); + + // Сбрасываем переменную marketplacePercent + marketplacePercent = 0; + } + + + // Метод для преобразования текста в число, учитывая возможную запятую + private double TryParseWithComma(string input) + { + input = input.Replace(',', '.'); // Заменяем запятую на точку, если она есть + double result; + if (Double.TryParse(input, NumberStyles.Any, CultureInfo.InvariantCulture, out result)) + { + return result; + } + return -1; // Если не удалось преобразовать, возвращаем -1 + } + + private void buttonClear_Click(object sender, EventArgs e) + { + ClearFields(); // Очистить поля для нового расчета + } + + + private void ClearFields() + { + // Сбрасываем переменную marketplacePercent + marketplacePercent = 0; + + // Проверяем каждый чекбокс и очищаем соответствующие текстовые поля + if (!checkBox1.Checked) + { + textBox4.Clear(); // Очистить поле для стоимости работы принтера + } + + if (!checkBox2.Checked) + { + textBox6.Clear(); // Очистить поле для стоимости коробки + } + + if (!checkBox3.Checked) + { + textBox7.Clear(); // Очистить поле для приемки + } + + // Очистка остальных полей + textBox1.Clear(); // Очистить поле для цены катушки + textBox2.Clear(); // Очистить поле для граммов в катушке + textBox3.Clear(); // Очистить поле для веса модели + textBox5.Clear(); // Очистить поле для времени работы принтера + textBox8.Clear(); // Очистить поле для бумаги тишью + + // Очистить поле для финальной стоимости + textBox9.Clear(); + } + + + + + + } +} + diff --git a/ПРСТ/Form1.resx b/ПРСТ/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ПРСТ/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ПРСТ/Program.cs b/ПРСТ/Program.cs new file mode 100644 index 0000000..4bac3e5 --- /dev/null +++ b/ПРСТ/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace ПРСТ +{ + internal static class Program + { + /// + /// Главная точка входа для приложения. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/ПРСТ/Properties/AssemblyInfo.cs b/ПРСТ/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5c8c924 --- /dev/null +++ b/ПРСТ/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанных со сборкой. +[assembly: AssemblyTitle("ПРСТ")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ПРСТ")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, следует установить атрибут ComVisible в TRUE для этого типа. +[assembly: ComVisible(false)] + +// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +[assembly: Guid("e77b81b5-cce4-4b35-b7f6-e793c11e81fb")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ПРСТ/Properties/Resources.Designer.cs b/ПРСТ/Properties/Resources.Designer.cs new file mode 100644 index 0000000..ad01231 --- /dev/null +++ b/ПРСТ/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программным средством. +// Версия среды выполнения: 4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если +// код создан повторно. +// +//------------------------------------------------------------------------------ + +namespace ПРСТ.Properties +{ + + + /// + /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. + /// + // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder + // класс с помощью таких средств, как ResGen или Visual Studio. + // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen + // с параметром /str или заново постройте свой VS-проект. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ПРСТ.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Переопределяет свойство CurrentUICulture текущего потока для всех + /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/ПРСТ/Properties/Resources.resx b/ПРСТ/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/ПРСТ/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ПРСТ/Properties/Settings.Designer.cs b/ПРСТ/Properties/Settings.Designer.cs new file mode 100644 index 0000000..878cd78 --- /dev/null +++ b/ПРСТ/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ПРСТ.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/ПРСТ/Properties/Settings.settings b/ПРСТ/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/ПРСТ/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ПРСТ/ПРСТ.csproj b/ПРСТ/ПРСТ.csproj new file mode 100644 index 0000000..7fd4e8a --- /dev/null +++ b/ПРСТ/ПРСТ.csproj @@ -0,0 +1,83 @@ + + + + + Debug + AnyCPU + {E77B81B5-CCE4-4B35-B7F6-E793C11E81FB} + WinExe + ПРСТ + ПРСТ + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file