commit cbbb53134e6cc2452510b416309485f0ac5cf704 Author: Professional Date: Thu Mar 27 02:27:14 2025 +0700 Добавьте файлы проекта. diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9491a2f --- /dev/null +++ b/.gitignore @@ -0,0 +1,363 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd \ No newline at end of file diff --git a/ПХД.sln b/ПХД.sln new file mode 100644 index 0000000..8fa533d --- /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", "{21A8CB65-6CB7-4662-8875-056A22D995D6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {21A8CB65-6CB7-4662-8875-056A22D995D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {21A8CB65-6CB7-4662-8875-056A22D995D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {21A8CB65-6CB7-4662-8875-056A22D995D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {21A8CB65-6CB7-4662-8875-056A22D995D6}.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..47a026b --- /dev/null +++ b/ПХД/App.config @@ -0,0 +1,44 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ПХД/Engines.db b/ПХД/Engines.db new file mode 100644 index 0000000..e69de29 diff --git a/ПХД/Form1.Designer.cs b/ПХД/Form1.Designer.cs new file mode 100644 index 0000000..f206125 --- /dev/null +++ b/ПХД/Form1.Designer.cs @@ -0,0 +1,553 @@ +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.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.файлToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.экспортToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.импортToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.помощьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.datePickerRegistration = new System.Windows.Forms.DateTimePicker(); + this.cmbEngineType = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.txtPower = new System.Windows.Forms.ComboBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.cmbRPM = new System.Windows.Forms.ComboBox(); + this.label4 = new System.Windows.Forms.Label(); + this.cmbMountingType = new System.Windows.Forms.ComboBox(); + this.label5 = new System.Windows.Forms.Label(); + this.txtUniqueNumber = new System.Windows.Forms.TextBox(); + this.txtFactoryNumber = new System.Windows.Forms.TextBox(); + this.txtPartNumber = new System.Windows.Forms.TextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label9 = new System.Windows.Forms.Label(); + this.txtInstallationSite = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.label10 = new System.Windows.Forms.Label(); + this.datePickerOutOfOrder = new System.Windows.Forms.DateTimePicker(); + this.txtReason = new System.Windows.Forms.TextBox(); + this.chkOutOfOrder = new System.Windows.Forms.CheckBox(); + this.btnSave = new System.Windows.Forms.Button(); + this.btnClear = new System.Windows.Forms.Button(); + this.btnDelete = new System.Windows.Forms.Button(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.btnSearch = new System.Windows.Forms.Button(); + this.label11 = new System.Windows.Forms.Label(); + this.datePickerVerification = new System.Windows.Forms.DateTimePicker(); + this.label12 = new System.Windows.Forms.Label(); + this.txtNotification = new System.Windows.Forms.RichTextBox(); + this.menuStrip1.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.файлToolStripMenuItem, + this.помощьToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(1142, 24); + this.menuStrip1.TabIndex = 1; + this.menuStrip1.Text = "menuStrip1"; + // + // файлToolStripMenuItem + // + this.файлToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.экспортToolStripMenuItem, + this.импортToolStripMenuItem}); + this.файлToolStripMenuItem.Name = "файлToolStripMenuItem"; + this.файлToolStripMenuItem.Size = new System.Drawing.Size(48, 20); + this.файлToolStripMenuItem.Text = "Файл"; + // + // экспортToolStripMenuItem + // + this.экспортToolStripMenuItem.Name = "экспортToolStripMenuItem"; + this.экспортToolStripMenuItem.Size = new System.Drawing.Size(119, 22); + this.экспортToolStripMenuItem.Text = "Экспорт"; + this.экспортToolStripMenuItem.Click += new System.EventHandler(this.экспортToolStripMenuItem_Click); + // + // импортToolStripMenuItem + // + this.импортToolStripMenuItem.Name = "импортToolStripMenuItem"; + this.импортToolStripMenuItem.Size = new System.Drawing.Size(119, 22); + this.импортToolStripMenuItem.Text = "Импорт"; + this.импортToolStripMenuItem.Click += new System.EventHandler(this.импортToolStripMenuItem_Click); + // + // помощьToolStripMenuItem + // + this.помощьToolStripMenuItem.Name = "помощьToolStripMenuItem"; + this.помощьToolStripMenuItem.Size = new System.Drawing.Size(68, 20); + this.помощьToolStripMenuItem.Text = "Помощь"; + // + // datePickerRegistration + // + this.datePickerRegistration.Location = new System.Drawing.Point(12, 47); + this.datePickerRegistration.Name = "datePickerRegistration"; + this.datePickerRegistration.Size = new System.Drawing.Size(200, 20); + this.datePickerRegistration.TabIndex = 2; + // + // cmbEngineType + // + this.cmbEngineType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.cmbEngineType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.cmbEngineType.FormattingEnabled = true; + this.cmbEngineType.Items.AddRange(new object[] { + "АИР80S4", + "АИР90S6", + "АДМ112М8", + "АИР315М8"}); + this.cmbEngineType.Location = new System.Drawing.Point(17, 38); + this.cmbEngineType.Name = "cmbEngineType"; + this.cmbEngineType.Size = new System.Drawing.Size(121, 21); + this.cmbEngineType.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label1.Location = new System.Drawing.Point(12, 22); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(94, 13); + this.label1.TabIndex = 4; + this.label1.Text = "Тип двигателя"; + // + // txtPower + // + this.txtPower.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.txtPower.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.txtPower.FormattingEnabled = true; + this.txtPower.Items.AddRange(new object[] { + "1,5", + "2", + "4", + "160"}); + this.txtPower.Location = new System.Drawing.Point(198, 38); + this.txtPower.Name = "txtPower"; + this.txtPower.Size = new System.Drawing.Size(121, 21); + this.txtPower.TabIndex = 5; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label2.Location = new System.Drawing.Point(197, 22); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(68, 13); + this.label2.TabIndex = 6; + this.label2.Text = "Мощность"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label3.Location = new System.Drawing.Point(319, 43); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(33, 16); + this.label3.TabIndex = 7; + this.label3.Text = "кВт"; + // + // cmbRPM + // + this.cmbRPM.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.cmbRPM.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.cmbRPM.FormattingEnabled = true; + this.cmbRPM.Items.AddRange(new object[] { + "1500", + "1000", + "740"}); + this.cmbRPM.Location = new System.Drawing.Point(404, 38); + this.cmbRPM.Name = "cmbRPM"; + this.cmbRPM.Size = new System.Drawing.Size(121, 21); + this.cmbRPM.TabIndex = 8; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label4.Location = new System.Drawing.Point(404, 22); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(59, 13); + this.label4.TabIndex = 9; + this.label4.Text = "Обороты"; + // + // cmbMountingType + // + this.cmbMountingType.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.cmbMountingType.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.cmbMountingType.FormattingEnabled = true; + this.cmbMountingType.Items.AddRange(new object[] { + "1001", + "2081", + "3021", + "1021"}); + this.cmbMountingType.Location = new System.Drawing.Point(604, 38); + this.cmbMountingType.Name = "cmbMountingType"; + this.cmbMountingType.Size = new System.Drawing.Size(165, 21); + this.cmbMountingType.TabIndex = 10; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label5.Location = new System.Drawing.Point(601, 22); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(148, 13); + this.label5.TabIndex = 11; + this.label5.Text = "Монтажное исполнение"; + // + // txtUniqueNumber + // + this.txtUniqueNumber.Location = new System.Drawing.Point(18, 39); + this.txtUniqueNumber.Name = "txtUniqueNumber"; + this.txtUniqueNumber.Size = new System.Drawing.Size(144, 20); + this.txtUniqueNumber.TabIndex = 12; + // + // txtFactoryNumber + // + this.txtFactoryNumber.Location = new System.Drawing.Point(200, 39); + this.txtFactoryNumber.Name = "txtFactoryNumber"; + this.txtFactoryNumber.Size = new System.Drawing.Size(152, 20); + this.txtFactoryNumber.TabIndex = 13; + // + // txtPartNumber + // + this.txtPartNumber.Location = new System.Drawing.Point(404, 39); + this.txtPartNumber.Name = "txtPartNumber"; + this.txtPartNumber.Size = new System.Drawing.Size(149, 20); + this.txtPartNumber.TabIndex = 14; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.cmbEngineType); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.txtPower); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.cmbMountingType); + this.groupBox1.Controls.Add(this.cmbRPM); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Location = new System.Drawing.Point(12, 73); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(811, 72); + this.groupBox1.TabIndex = 15; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Статичные данные"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.label9); + this.groupBox2.Controls.Add(this.txtInstallationSite); + this.groupBox2.Controls.Add(this.label8); + this.groupBox2.Controls.Add(this.label7); + this.groupBox2.Controls.Add(this.label6); + this.groupBox2.Controls.Add(this.txtPartNumber); + this.groupBox2.Controls.Add(this.txtUniqueNumber); + this.groupBox2.Controls.Add(this.txtFactoryNumber); + this.groupBox2.Location = new System.Drawing.Point(12, 151); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(570, 126); + this.groupBox2.TabIndex = 16; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Динамические данные"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label9.Location = new System.Drawing.Point(14, 73); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(109, 13); + this.label9.TabIndex = 19; + this.label9.Text = "Место установки"; + // + // txtInstallationSite + // + this.txtInstallationSite.Location = new System.Drawing.Point(17, 89); + this.txtInstallationSite.Name = "txtInstallationSite"; + this.txtInstallationSite.Size = new System.Drawing.Size(536, 20); + this.txtInstallationSite.TabIndex = 18; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label8.Location = new System.Drawing.Point(401, 23); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(136, 13); + this.label8.TabIndex = 17; + this.label8.Text = "Номер номенклатуры"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label7.Location = new System.Drawing.Point(197, 23); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(112, 13); + this.label7.TabIndex = 16; + this.label7.Text = "Заводской номер"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label6.Location = new System.Drawing.Point(15, 23); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(122, 13); + this.label6.TabIndex = 15; + this.label6.Text = "Уникальный номер"; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.label10); + this.groupBox3.Controls.Add(this.datePickerOutOfOrder); + this.groupBox3.Controls.Add(this.txtReason); + this.groupBox3.Controls.Add(this.chkOutOfOrder); + this.groupBox3.Location = new System.Drawing.Point(605, 151); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(218, 126); + this.groupBox3.TabIndex = 17; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Неисправность"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label10.Location = new System.Drawing.Point(3, 84); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(140, 13); + this.label10.TabIndex = 3; + this.label10.Text = "Дата выхода из строя"; + // + // datePickerOutOfOrder + // + this.datePickerOutOfOrder.Location = new System.Drawing.Point(6, 100); + this.datePickerOutOfOrder.Name = "datePickerOutOfOrder"; + this.datePickerOutOfOrder.Size = new System.Drawing.Size(200, 20); + this.datePickerOutOfOrder.TabIndex = 2; + // + // txtReason + // + this.txtReason.Location = new System.Drawing.Point(6, 49); + this.txtReason.Name = "txtReason"; + this.txtReason.Size = new System.Drawing.Size(188, 20); + this.txtReason.TabIndex = 1; + this.txtReason.Text = "Причина"; + // + // chkOutOfOrder + // + this.chkOutOfOrder.AutoSize = true; + this.chkOutOfOrder.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.chkOutOfOrder.Location = new System.Drawing.Point(12, 26); + this.chkOutOfOrder.Name = "chkOutOfOrder"; + this.chkOutOfOrder.Size = new System.Drawing.Size(122, 17); + this.chkOutOfOrder.TabIndex = 0; + this.chkOutOfOrder.Text = "Вышел из строя"; + this.chkOutOfOrder.UseVisualStyleBackColor = true; + this.chkOutOfOrder.CheckedChanged += new System.EventHandler(this.chkOutOfOrder_CheckedChanged); + // + // btnSave + // + this.btnSave.Location = new System.Drawing.Point(12, 283); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(75, 23); + this.btnSave.TabIndex = 18; + this.btnSave.Text = "Сохранить"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // btnClear + // + this.btnClear.Location = new System.Drawing.Point(93, 283); + this.btnClear.Name = "btnClear"; + this.btnClear.Size = new System.Drawing.Size(75, 23); + this.btnClear.TabIndex = 19; + this.btnClear.Text = "Очистить"; + this.btnClear.UseVisualStyleBackColor = true; + this.btnClear.Click += new System.EventHandler(this.btnClear_Click); + // + // btnDelete + // + this.btnDelete.Location = new System.Drawing.Point(174, 283); + this.btnDelete.Name = "btnDelete"; + this.btnDelete.Size = new System.Drawing.Size(75, 23); + this.btnDelete.TabIndex = 20; + this.btnDelete.Text = "Удалить"; + this.btnDelete.UseVisualStyleBackColor = true; + this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click); + // + // dataGridView1 + // + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AllowUserToDeleteRows = false; + this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Location = new System.Drawing.Point(12, 312); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + this.dataGridView1.Size = new System.Drawing.Size(1118, 328); + this.dataGridView1.TabIndex = 21; + this.dataGridView1.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.dataGridView1_CellFormatting); + // + // btnSearch + // + this.btnSearch.Location = new System.Drawing.Point(256, 283); + this.btnSearch.Name = "btnSearch"; + this.btnSearch.Size = new System.Drawing.Size(75, 23); + this.btnSearch.TabIndex = 22; + this.btnSearch.Text = "Поиск"; + this.btnSearch.UseVisualStyleBackColor = true; + this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click); + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label11.Location = new System.Drawing.Point(9, 31); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(157, 13); + this.label11.TabIndex = 23; + this.label11.Text = "Дата постановки на учет"; + // + // datePickerVerification + // + this.datePickerVerification.Location = new System.Drawing.Point(218, 47); + this.datePickerVerification.Name = "datePickerVerification"; + this.datePickerVerification.Size = new System.Drawing.Size(200, 20); + this.datePickerVerification.TabIndex = 24; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label12.Location = new System.Drawing.Point(215, 31); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(90, 13); + this.label12.TabIndex = 25; + this.label12.Text = "Дата поверки"; + // + // txtNotification + // + this.txtNotification.Location = new System.Drawing.Point(829, 79); + this.txtNotification.Name = "txtNotification"; + this.txtNotification.Size = new System.Drawing.Size(301, 198); + this.txtNotification.TabIndex = 26; + this.txtNotification.Text = ""; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1142, 652); + this.Controls.Add(this.txtNotification); + this.Controls.Add(this.label12); + this.Controls.Add(this.datePickerVerification); + this.Controls.Add(this.label11); + this.Controls.Add(this.btnSearch); + this.Controls.Add(this.dataGridView1); + this.Controls.Add(this.btnDelete); + this.Controls.Add(this.btnClear); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.datePickerRegistration); + this.Controls.Add(this.menuStrip1); + this.MainMenuStrip = this.menuStrip1; + this.Name = "Form1"; + this.Text = "Form1"; + this.Load += new System.EventHandler(this.Form1_Load); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem файлToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem помощьToolStripMenuItem; + private System.Windows.Forms.DateTimePicker datePickerRegistration; + private System.Windows.Forms.ComboBox cmbEngineType; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.ComboBox txtPower; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox cmbRPM; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox cmbMountingType; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox txtUniqueNumber; + private System.Windows.Forms.TextBox txtFactoryNumber; + private System.Windows.Forms.TextBox txtPartNumber; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox txtInstallationSite; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.DateTimePicker datePickerOutOfOrder; + private System.Windows.Forms.TextBox txtReason; + private System.Windows.Forms.CheckBox chkOutOfOrder; + private System.Windows.Forms.Button btnSave; + private System.Windows.Forms.Button btnClear; + private System.Windows.Forms.Button btnDelete; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.Button btnSearch; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.ToolStripMenuItem экспортToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem импортToolStripMenuItem; + private System.Windows.Forms.DateTimePicker datePickerVerification; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.RichTextBox txtNotification; + } +} + diff --git a/ПХД/Form1.cs b/ПХД/Form1.cs new file mode 100644 index 0000000..023e332 --- /dev/null +++ b/ПХД/Form1.cs @@ -0,0 +1,1012 @@ +using System; +using System.Data; +using System.Windows.Forms; +using System.Data.SQLite; +using System.IO; +using OfficeOpenXml; +using System.Collections.Generic; +using System.Threading; +using System.Management; +using System.Linq; + +namespace ПХД +{ + public partial class Form1 : Form + { + private DatabaseManager dbManager; + private bool isUnlocked = false; + private string requiredKeyContent = "ключь доступа"; + private Thread usbMonitorThread; + private bool monitoringActive = true; + + public Form1() + { + InitializeComponent(); + dbManager = new DatabaseManager(); + SetupDataGridView(); + + // Запускаем мониторинг сразу + StartUsbMonitoring(); + + // Проверяем ключ + CheckForUsbKey(); + } + + private void Form1_Load(object sender, EventArgs e) + { + // Проверяем ключ при загрузке формы + if (!isUnlocked) + { + LockApplication("Вставьте USB-ключ для доступа к программе"); + } + else + { + dbManager.InitializeDatabase(); + LoadEngines(); + txtReason.Enabled = false; + datePickerOutOfOrder.Enabled = false; + } + } + + private void LockApplication(string message) + { + // Создаем или используем существующую панель блокировки + Panel lockPanel = Controls.Find("lockPanel", false).Length > 0 ? + (Panel)Controls.Find("lockPanel", false)[0] : new Panel(); + + if (lockPanel.Name != "lockPanel") + { + lockPanel.Name = "lockPanel"; + lockPanel.Dock = DockStyle.Fill; + lockPanel.BackColor = System.Drawing.Color.FromArgb(240, 240, 240); + + Label lockMessage = new Label(); + lockMessage.Name = "lockMessage"; + lockMessage.Text = message; + lockMessage.AutoSize = false; + lockMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + lockMessage.Dock = DockStyle.None; + lockMessage.Size = new System.Drawing.Size(600, 80); // Увеличены размеры для размещения длинного текста + lockMessage.Font = new System.Drawing.Font("Arial", 16, System.Drawing.FontStyle.Bold); + // Размещаем по центру + lockMessage.Location = new System.Drawing.Point( + (this.ClientSize.Width - lockMessage.Width) / 2, + (this.ClientSize.Height - lockMessage.Height) / 2 - 50); + + Button retryButton = new Button(); + retryButton.Name = "retryButton"; + retryButton.Text = "Проверить наличие ключа вручную"; + retryButton.Size = new System.Drawing.Size(250, 40); + retryButton.Location = new System.Drawing.Point( + (this.ClientSize.Width - retryButton.Width) / 2, + lockMessage.Bottom + 20); + retryButton.Font = new System.Drawing.Font("Arial", 11, System.Drawing.FontStyle.Regular); + retryButton.Click += (s, e) => { + CheckForUsbKey(); + // Если ключ найден, разблокируем приложение + if (isUnlocked) + { + UnlockApplication(); + // Инициализируем приложение + dbManager.InitializeDatabase(); + LoadEngines(); + txtReason.Enabled = false; + datePickerOutOfOrder.Enabled = false; + } + else + { + // Обновляем сообщение, если ключ не найден + Label msg = lockPanel.Controls["lockMessage"] as Label; + if (msg != null) + { + msg.Text = "Ключ не найден. Программа будет разблокирована автоматически при обнаружении ключа."; + } + } + }; + + Label autoCheckLabel = new Label(); + autoCheckLabel.Name = "autoCheckLabel"; + autoCheckLabel.Text = "Программа автоматически проверяет наличие ключа..."; + autoCheckLabel.AutoSize = false; + autoCheckLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + autoCheckLabel.Size = new System.Drawing.Size(500, 30); // Увеличен размер + autoCheckLabel.Font = new System.Drawing.Font("Arial", 9, System.Drawing.FontStyle.Italic); + autoCheckLabel.Location = new System.Drawing.Point( + (this.ClientSize.Width - autoCheckLabel.Width) / 2, + retryButton.Bottom + 10); + + lockPanel.Controls.Add(lockMessage); + lockPanel.Controls.Add(retryButton); + lockPanel.Controls.Add(autoCheckLabel); + + // Добавляем панель блокировки на форму + this.Controls.Add(lockPanel); + lockPanel.BringToFront(); + } + else + { + // Если панель уже существует, обновляем сообщение и убеждаемся, что размер достаточен + Label msg = lockPanel.Controls.OfType