DEM18
This commit is contained in:
commit
c20fb5ba1e
244
EER/Diagramm.sql
Normal file
244
EER/Diagramm.sql
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
-- MySQL dump 10.13 Distrib 8.0.36, for Win64 (x86_64)
|
||||||
|
--
|
||||||
|
-- Host: git.pgk.alspio.com Database: ISP41_Neshina_dem2
|
||||||
|
-- ------------------------------------------------------
|
||||||
|
-- Server version 5.7.44
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!50503 SET NAMES utf8 */;
|
||||||
|
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||||
|
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||||
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||||
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||||
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `Materials`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `Materials`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `Materials` (
|
||||||
|
`idMaterials` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`Type` int(11) DEFAULT NULL,
|
||||||
|
`Price` decimal(10,2) DEFAULT NULL,
|
||||||
|
`Quantity` int(11) DEFAULT NULL,
|
||||||
|
`MinQuantity` int(11) DEFAULT NULL,
|
||||||
|
`QuantityPack` int(11) DEFAULT NULL,
|
||||||
|
`Unit` int(11) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`idMaterials`),
|
||||||
|
KEY `fk_type_idx` (`Type`),
|
||||||
|
KEY `fk_unit_idx` (`Unit`),
|
||||||
|
CONSTRAINT `fk_type` FOREIGN KEY (`Type`) REFERENCES `TypeMaterial` (`idTypeMaterial`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
CONSTRAINT `fk_unit` FOREIGN KEY (`Unit`) REFERENCES `Unit` (`idUnit`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `Materials`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `Materials` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `Materials` DISABLE KEYS */;
|
||||||
|
INSERT INTO `Materials` VALUES (1,'Глина',1,15.29,1570,5500,30,1),(2,'Каолин',1,18.20,1030,3500,25,1),(3,'Гидрослюда',3,9999.00,2147,3500,25,1),(4,'Монтмориллонит',1,17.67,3000,3000,30,1),(5,'Перлит',2,13.99,150,1000,50,2),(6,'Стекло',2,2.40,3000,1500,500,1),(7,'Дегидратированная глина',2,21.95,3000,2500,20,1),(8,'Шамот',2,27.50,2300,1960,20,1),(9,'Техническая сода',3,54.55,1200,1500,25,1),(10,'Жидкое стекло',3,76.59,500,1500,15,1),(11,'Кварц',4,18.20,1500,2500,10,1),(12,'Полевой шпат',4,15.99,750,1500,100,1),(13,'Краска-раствор',5,200.90,1496,2500,5,2),(14,'Порошок цветной',5,84.39,511,1750,25,1),(15,'Кварцевый песок',2,4.29,3000,1600,50,1),(16,'Жильный кварц',3,18.60,2556,1600,25,1),(17,'Барий углекислый',4,303.64,340,1500,25,1),(18,'Бура техническая',4,125.99,165,1300,25,1),(19,'Углещелочной реагент',3,3.45,450,1100,25,1),(20,'Пирофосфат натрия',3,700.99,356,1200,25,1);
|
||||||
|
/*!40000 ALTER TABLE `Materials` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `NameSupplier`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `NameSupplier`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `NameSupplier` (
|
||||||
|
`idNameSupplier` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`Material` int(11) DEFAULT NULL,
|
||||||
|
`Supplier` int(11) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`idNameSupplier`),
|
||||||
|
KEY `fk_material_idx` (`Material`),
|
||||||
|
KEY `fk_pol_idx` (`Supplier`),
|
||||||
|
CONSTRAINT `fk_material` FOREIGN KEY (`Material`) REFERENCES `Materials` (`idMaterials`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
||||||
|
CONSTRAINT `fk_pol` FOREIGN KEY (`Supplier`) REFERENCES `Supplier` (`idSupplier`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=81 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `NameSupplier`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `NameSupplier` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `NameSupplier` DISABLE KEYS */;
|
||||||
|
INSERT INTO `NameSupplier` VALUES (1,13,19),(2,2,3),(3,2,9),(4,6,19),(5,15,1),(6,5,6),(7,1,4),(8,15,20),(9,7,9),(10,12,4),(11,1,1),(12,14,19),(13,16,17),(14,12,1),(15,3,9),(16,6,20),(17,12,12),(18,4,9),(19,11,11),(20,17,17),(21,10,12),(22,8,17),(23,1,6),(24,11,15),(25,3,3),(26,5,9),(27,8,19),(28,17,20),(29,18,20),(30,9,18),(31,20,20),(32,3,4),(33,16,15),(34,5,10),(35,15,15),(36,4,4),(37,13,12),(38,6,7),(39,14,12),(40,2,1),(41,10,18),(42,18,7),(43,7,11),(44,18,13),(45,4,3),(46,10,16),(47,10,7),(48,14,16),(49,14,8),(50,19,16),(51,11,14),(52,16,13),(53,13,16),(54,11,13),(55,7,2),(56,15,14),(57,17,7),(58,8,2),(59,7,7),(60,3,5),(61,20,7),(62,5,5),(63,9,7),(64,1,10),(65,9,16),(66,4,10),(67,19,12),(68,9,8),(69,18,2),(70,20,5),(71,16,10),(72,6,2),(73,19,8),(74,17,5),(75,20,8),(76,2,5),(77,8,11),(78,19,5),(79,13,8),(80,12,10);
|
||||||
|
/*!40000 ALTER TABLE `NameSupplier` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `Supplier`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `Supplier`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `Supplier` (
|
||||||
|
`idSupplier` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`Type` int(11) DEFAULT NULL,
|
||||||
|
`INN` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`Rating` int(11) DEFAULT NULL,
|
||||||
|
`Date` date DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`idSupplier`),
|
||||||
|
KEY `fk_types_idx` (`Type`),
|
||||||
|
CONSTRAINT `fk_types` FOREIGN KEY (`Type`) REFERENCES `TypeSupplier` (`idTypeSupplier`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `Supplier`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `Supplier` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `Supplier` DISABLE KEYS */;
|
||||||
|
INSERT INTO `Supplier` VALUES (1,'БрянскСтройресурс',1,'9432455179',8,'2015-12-20'),(2,'Стройкомплект',1,'7803888520',7,'2017-09-13'),(3,'Железногорская руда',2,'8430391035',7,'2016-12-23'),(4,'Белая гора',2,'4318170454',8,'2019-05-27'),(5,'Тульский обрабатывающий завод',2,'7687851800',7,'2015-06-16'),(6,'ГорТехРазработка',3,'6119144874',9,'2021-12-27'),(7,'Сапфир',4,'1122170258',3,'2022-04-10'),(8,'ХимБытСервис',3,'8355114917',5,'2022-03-13'),(9,'ВоронежРудоКомбинат',4,'3532367439',8,'2023-11-11'),(10,'Смоленский добывающий комбинат',4,'2362431140',3,'2018-11-23'),(11,'МосКарьер',3,'4159215346',2,'2012-07-07'),(12,'КурскРесурс',1,'9032455179',4,'2021-07-23'),(13,'Нижегородская разработка',4,'3776671267',9,'2016-05-23'),(14,'Речная долина',4,'7447864518',8,'2015-06-25'),(15,'Карелия добыча',3,'9037040523',6,'2017-03-09'),(16,'Московский ХимЗавод',3,'6221520857',4,'2015-05-07'),(17,'Горная компания',1,'2262431140',3,'2020-12-22'),(18,'Минерал Ресурс',2,'4155215346',7,'2015-05-22'),(19,'Арсенал',1,'3961234561',5,'2010-11-25'),(20,'КамчаткаСтройМинералы',1,'9600275878',7,'2016-12-20');
|
||||||
|
/*!40000 ALTER TABLE `Supplier` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `TypeMaterial`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `TypeMaterial`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `TypeMaterial` (
|
||||||
|
`idTypeMaterial` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`idTypeMaterial`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `TypeMaterial`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `TypeMaterial` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `TypeMaterial` DISABLE KEYS */;
|
||||||
|
INSERT INTO `TypeMaterial` VALUES (1,'Пластичные материалы'),(2,'Добавка'),(3,'Электролит'),(4,'Глазурь'),(5,'Пигмент');
|
||||||
|
/*!40000 ALTER TABLE `TypeMaterial` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `TypeProduction`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `TypeProduction`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `TypeProduction` (
|
||||||
|
`idTypeProduction` int(11) NOT NULL,
|
||||||
|
`Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`Coefficient` decimal(10,2) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`idTypeProduction`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `TypeProduction`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `TypeProduction` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `TypeProduction` DISABLE KEYS */;
|
||||||
|
INSERT INTO `TypeProduction` VALUES (1,'Тип продукции 1',1.20),(2,'Тип продукции 2',8.59),(3,'Тип продукции 3',3.45),(4,'Тип продукции 4',5.60);
|
||||||
|
/*!40000 ALTER TABLE `TypeProduction` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `TypeSupplier`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `TypeSupplier`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `TypeSupplier` (
|
||||||
|
`idTypeSupplier` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`idTypeSupplier`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `TypeSupplier`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `TypeSupplier` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `TypeSupplier` DISABLE KEYS */;
|
||||||
|
INSERT INTO `TypeSupplier` VALUES (1,'ЗАО'),(2,'ООО'),(3,'ПАО'),(4,'ОАО');
|
||||||
|
/*!40000 ALTER TABLE `TypeSupplier` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `TypeWithProcent`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `TypeWithProcent`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `TypeWithProcent` (
|
||||||
|
`idTypeWithProcent` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`Name` int(11) DEFAULT NULL,
|
||||||
|
`Procent` decimal(10,4) DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`idTypeWithProcent`),
|
||||||
|
KEY `fk_oioi_idx` (`Name`),
|
||||||
|
CONSTRAINT `fk_oioi` FOREIGN KEY (`Name`) REFERENCES `TypeMaterial` (`idTypeMaterial`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `TypeWithProcent`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `TypeWithProcent` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `TypeWithProcent` DISABLE KEYS */;
|
||||||
|
INSERT INTO `TypeWithProcent` VALUES (1,1,0.0012),(2,2,0.0020),(3,3,0.0015),(4,4,0.0030),(5,5,0.0025);
|
||||||
|
/*!40000 ALTER TABLE `TypeWithProcent` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `Unit`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `Unit`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!50503 SET character_set_client = utf8mb4 */;
|
||||||
|
CREATE TABLE `Unit` (
|
||||||
|
`idUnit` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`Name` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`idUnit`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `Unit`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `Unit` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `Unit` DISABLE KEYS */;
|
||||||
|
INSERT INTO `Unit` VALUES (1,'кг'),(2,'л');
|
||||||
|
/*!40000 ALTER TABLE `Unit` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||||
|
|
||||||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
|
-- Dump completed on 2025-11-18 17:18:24
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
NeshinaDem3/.vs/NeshinaDem3/v17/.suo
Normal file
BIN
NeshinaDem3/.vs/NeshinaDem3/v17/.suo
Normal file
Binary file not shown.
25
NeshinaDem3/NeshinaDem3.sln
Normal file
25
NeshinaDem3/NeshinaDem3.sln
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.8.34511.84
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeshinaDem3", "NeshinaDem3\NeshinaDem3.csproj", "{E6B40B3D-4197-489D-AD89-F7FDABAF4249}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{E6B40B3D-4197-489D-AD89-F7FDABAF4249}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{E6B40B3D-4197-489D-AD89-F7FDABAF4249}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{E6B40B3D-4197-489D-AD89-F7FDABAF4249}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{E6B40B3D-4197-489D-AD89-F7FDABAF4249}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {515958ED-882C-432E-980A-F00EFA219FAF}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
248
NeshinaDem3/NeshinaDem3/Add.Designer.cs
generated
Normal file
248
NeshinaDem3/NeshinaDem3/Add.Designer.cs
generated
Normal file
@ -0,0 +1,248 @@
|
|||||||
|
namespace NeshinaDem3
|
||||||
|
{
|
||||||
|
partial class Add
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.txtName = new System.Windows.Forms.TextBox();
|
||||||
|
this.cmbType = new System.Windows.Forms.ComboBox();
|
||||||
|
this.txtPrice = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtQuantity = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtMinQuantity = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtStockQuantity = new System.Windows.Forms.TextBox();
|
||||||
|
this.cmbUnit = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
|
this.label7 = new System.Windows.Forms.Label();
|
||||||
|
this.label8 = new System.Windows.Forms.Label();
|
||||||
|
this.btnSave = new System.Windows.Forms.Button();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// txtName
|
||||||
|
//
|
||||||
|
this.txtName.Location = new System.Drawing.Point(13, 85);
|
||||||
|
this.txtName.Name = "txtName";
|
||||||
|
this.txtName.Size = new System.Drawing.Size(318, 20);
|
||||||
|
this.txtName.TabIndex = 0;
|
||||||
|
//
|
||||||
|
// cmbType
|
||||||
|
//
|
||||||
|
this.cmbType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbType.FormattingEnabled = true;
|
||||||
|
this.cmbType.Location = new System.Drawing.Point(13, 131);
|
||||||
|
this.cmbType.Name = "cmbType";
|
||||||
|
this.cmbType.Size = new System.Drawing.Size(318, 21);
|
||||||
|
this.cmbType.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// txtPrice
|
||||||
|
//
|
||||||
|
this.txtPrice.Location = new System.Drawing.Point(13, 178);
|
||||||
|
this.txtPrice.Name = "txtPrice";
|
||||||
|
this.txtPrice.Size = new System.Drawing.Size(318, 20);
|
||||||
|
this.txtPrice.TabIndex = 2;
|
||||||
|
//
|
||||||
|
// txtQuantity
|
||||||
|
//
|
||||||
|
this.txtQuantity.Location = new System.Drawing.Point(13, 224);
|
||||||
|
this.txtQuantity.Name = "txtQuantity";
|
||||||
|
this.txtQuantity.Size = new System.Drawing.Size(318, 20);
|
||||||
|
this.txtQuantity.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// txtMinQuantity
|
||||||
|
//
|
||||||
|
this.txtMinQuantity.Location = new System.Drawing.Point(13, 276);
|
||||||
|
this.txtMinQuantity.Name = "txtMinQuantity";
|
||||||
|
this.txtMinQuantity.Size = new System.Drawing.Size(318, 20);
|
||||||
|
this.txtMinQuantity.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// txtStockQuantity
|
||||||
|
//
|
||||||
|
this.txtStockQuantity.Location = new System.Drawing.Point(13, 322);
|
||||||
|
this.txtStockQuantity.Name = "txtStockQuantity";
|
||||||
|
this.txtStockQuantity.Size = new System.Drawing.Size(318, 20);
|
||||||
|
this.txtStockQuantity.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// cmbUnit
|
||||||
|
//
|
||||||
|
this.cmbUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbUnit.FormattingEnabled = true;
|
||||||
|
this.cmbUnit.Location = new System.Drawing.Point(13, 373);
|
||||||
|
this.cmbUnit.Name = "cmbUnit";
|
||||||
|
this.cmbUnit.Size = new System.Drawing.Size(318, 21);
|
||||||
|
this.cmbUnit.TabIndex = 6;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||||
|
this.label1.Location = new System.Drawing.Point(94, 9);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(153, 33);
|
||||||
|
this.label1.TabIndex = 7;
|
||||||
|
this.label1.Text = "Добавить";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(10, 69);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(57, 13);
|
||||||
|
this.label2.TabIndex = 8;
|
||||||
|
this.label2.Text = "Название";
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(10, 115);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(26, 13);
|
||||||
|
this.label3.TabIndex = 9;
|
||||||
|
this.label3.Text = "Тип";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(10, 162);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(33, 13);
|
||||||
|
this.label4.TabIndex = 10;
|
||||||
|
this.label4.Text = "Цена";
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.Location = new System.Drawing.Point(10, 208);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(66, 13);
|
||||||
|
this.label5.TabIndex = 11;
|
||||||
|
this.label5.Text = "Количество";
|
||||||
|
//
|
||||||
|
// label6
|
||||||
|
//
|
||||||
|
this.label6.AutoSize = true;
|
||||||
|
this.label6.Location = new System.Drawing.Point(10, 260);
|
||||||
|
this.label6.Name = "label6";
|
||||||
|
this.label6.Size = new System.Drawing.Size(139, 13);
|
||||||
|
this.label6.TabIndex = 12;
|
||||||
|
this.label6.Text = "Минимальное количество";
|
||||||
|
//
|
||||||
|
// label7
|
||||||
|
//
|
||||||
|
this.label7.AutoSize = true;
|
||||||
|
this.label7.Location = new System.Drawing.Point(10, 306);
|
||||||
|
this.label7.Name = "label7";
|
||||||
|
this.label7.Size = new System.Drawing.Size(120, 13);
|
||||||
|
this.label7.TabIndex = 13;
|
||||||
|
this.label7.Text = "Количество на складе";
|
||||||
|
//
|
||||||
|
// label8
|
||||||
|
//
|
||||||
|
this.label8.AutoSize = true;
|
||||||
|
this.label8.Location = new System.Drawing.Point(10, 357);
|
||||||
|
this.label8.Name = "label8";
|
||||||
|
this.label8.Size = new System.Drawing.Size(109, 13);
|
||||||
|
this.label8.TabIndex = 14;
|
||||||
|
this.label8.Text = "Единица измерения";
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
this.btnSave.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(84)))), ((int)(((byte)(111)))), ((int)(((byte)(148)))));
|
||||||
|
this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||||
|
this.btnSave.Location = new System.Drawing.Point(83, 419);
|
||||||
|
this.btnSave.Name = "btnSave";
|
||||||
|
this.btnSave.Size = new System.Drawing.Size(184, 64);
|
||||||
|
this.btnSave.TabIndex = 25;
|
||||||
|
this.btnSave.Text = "Сохранить изменения";
|
||||||
|
this.btnSave.UseVisualStyleBackColor = false;
|
||||||
|
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Location = new System.Drawing.Point(13, 461);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(54, 23);
|
||||||
|
this.button1.TabIndex = 26;
|
||||||
|
this.button1.Text = "Назад";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// Add
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(207)))), ((int)(((byte)(206)))));
|
||||||
|
this.ClientSize = new System.Drawing.Size(343, 496);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Controls.Add(this.btnSave);
|
||||||
|
this.Controls.Add(this.label8);
|
||||||
|
this.Controls.Add(this.label7);
|
||||||
|
this.Controls.Add(this.label6);
|
||||||
|
this.Controls.Add(this.label5);
|
||||||
|
this.Controls.Add(this.label4);
|
||||||
|
this.Controls.Add(this.label3);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.cmbUnit);
|
||||||
|
this.Controls.Add(this.txtStockQuantity);
|
||||||
|
this.Controls.Add(this.txtMinQuantity);
|
||||||
|
this.Controls.Add(this.txtQuantity);
|
||||||
|
this.Controls.Add(this.txtPrice);
|
||||||
|
this.Controls.Add(this.cmbType);
|
||||||
|
this.Controls.Add(this.txtName);
|
||||||
|
this.Name = "Add";
|
||||||
|
this.Text = "Add";
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.TextBox txtName;
|
||||||
|
private System.Windows.Forms.ComboBox cmbType;
|
||||||
|
private System.Windows.Forms.TextBox txtPrice;
|
||||||
|
private System.Windows.Forms.TextBox txtQuantity;
|
||||||
|
private System.Windows.Forms.TextBox txtMinQuantity;
|
||||||
|
private System.Windows.Forms.TextBox txtStockQuantity;
|
||||||
|
private System.Windows.Forms.ComboBox cmbUnit;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
|
private System.Windows.Forms.Label label6;
|
||||||
|
private System.Windows.Forms.Label label7;
|
||||||
|
private System.Windows.Forms.Label label8;
|
||||||
|
private System.Windows.Forms.Button btnSave;
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
}
|
||||||
|
}
|
||||||
174
NeshinaDem3/NeshinaDem3/Add.cs
Normal file
174
NeshinaDem3/NeshinaDem3/Add.cs
Normal file
@ -0,0 +1,174 @@
|
|||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
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 NeshinaDem3
|
||||||
|
{
|
||||||
|
public partial class Add : Form
|
||||||
|
{
|
||||||
|
public Add()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
LoadTypes();
|
||||||
|
LoadUnits();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Проверка обязательных полей
|
||||||
|
if (string.IsNullOrWhiteSpace(txtName.Text))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите название материала.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtName.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmbType.SelectedItem == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Выберите тип материала.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
cmbType.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!decimal.TryParse(txtPrice.Text, out decimal price) || price < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите корректную цену (неотрицательное число).", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtPrice.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!int.TryParse(txtQuantity.Text, out int quantity) || quantity < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите корректное количество (неотрицательное целое число).", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtQuantity.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!int.TryParse(txtMinQuantity.Text, out int minQty) || minQty < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите корректное минимальное количество.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtMinQuantity.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!int.TryParse(txtStockQuantity.Text, out int stockQty) || stockQty < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите корректное количество на складе.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtStockQuantity.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmbUnit.SelectedItem == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Выберите единицу измерения.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
cmbUnit.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Получаем ID из выбранных элементов
|
||||||
|
var typeItem = (ComboItem)cmbType.SelectedItem;
|
||||||
|
var unitItem = (ComboItem)cmbUnit.SelectedItem;
|
||||||
|
|
||||||
|
// Вставляем в БД
|
||||||
|
string insertQuery = @"
|
||||||
|
INSERT INTO Materials (Name, Type, Price, Quantity, MinQuantity, QuantityPack, Unit)
|
||||||
|
VALUES (@name, @type, @price, @quantity, @minQty, @stockQty, @unit)";
|
||||||
|
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using (var cmd = new MySqlCommand(insertQuery, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.AddWithValue("@name", txtName.Text.Trim());
|
||||||
|
cmd.Parameters.AddWithValue("@type", typeItem.Id);
|
||||||
|
cmd.Parameters.AddWithValue("@price", price);
|
||||||
|
cmd.Parameters.AddWithValue("@quantity", quantity);
|
||||||
|
cmd.Parameters.AddWithValue("@minQty", minQty);
|
||||||
|
cmd.Parameters.AddWithValue("@stockQty", stockQty);
|
||||||
|
cmd.Parameters.AddWithValue("@unit", unitItem.Id);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
MessageBox.Show("Материал успешно добавлен!", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
this.DialogResult = DialogResult.OK;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Ошибка при добавлении: {ex.Message}", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadTypes()
|
||||||
|
{
|
||||||
|
string query = "SELECT idTypeMaterial, Name FROM TypeMaterial";
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using (var cmd = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
using (var reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
cmbType.Items.Add(new ComboItem
|
||||||
|
{
|
||||||
|
Id = reader.GetInt32("idTypeMaterial"),
|
||||||
|
Name = reader.GetString("Name")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadUnits()
|
||||||
|
{
|
||||||
|
string query = "SELECT idUnit, Name FROM Unit";
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using (var cmd = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
using (var reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
cmbUnit.Items.Add(new ComboItem
|
||||||
|
{
|
||||||
|
Id = reader.GetInt32("idUnit"),
|
||||||
|
Name = reader.GetString("Name")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ComboItem
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
NeshinaDem3/NeshinaDem3/Add.resx
Normal file
120
NeshinaDem3/NeshinaDem3/Add.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
6
NeshinaDem3/NeshinaDem3/App.config
Normal file
6
NeshinaDem3/NeshinaDem3/App.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
41
NeshinaDem3/NeshinaDem3/DB.cs
Normal file
41
NeshinaDem3/NeshinaDem3/DB.cs
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
|
||||||
|
namespace NeshinaDem3
|
||||||
|
{
|
||||||
|
internal class DB
|
||||||
|
{
|
||||||
|
private static DB instance;
|
||||||
|
private MySqlConnection connection;
|
||||||
|
|
||||||
|
private readonly string connectionString =
|
||||||
|
"server=192.168.201.207;port=3306;username=ISP41_Neshina;password=ISP41_Neshina;database=ISP41_Neshina_dem2;SslMode=none;Charset=utf8mb4";
|
||||||
|
|
||||||
|
private DB()
|
||||||
|
{
|
||||||
|
connection = new MySqlConnection(connectionString);
|
||||||
|
OpenConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DB GetInstance()
|
||||||
|
{
|
||||||
|
if (instance == null)
|
||||||
|
instance = new DB();
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OpenConnection()
|
||||||
|
{
|
||||||
|
if (connection.State == ConnectionState.Closed)
|
||||||
|
connection.Open();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MySqlConnection GetConnection() => connection;
|
||||||
|
}
|
||||||
|
}
|
||||||
249
NeshinaDem3/NeshinaDem3/Edit.Designer.cs
generated
Normal file
249
NeshinaDem3/NeshinaDem3/Edit.Designer.cs
generated
Normal file
@ -0,0 +1,249 @@
|
|||||||
|
namespace NeshinaDem3
|
||||||
|
{
|
||||||
|
partial class Edit
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.label2 = new System.Windows.Forms.Label();
|
||||||
|
this.label3 = new System.Windows.Forms.Label();
|
||||||
|
this.label4 = new System.Windows.Forms.Label();
|
||||||
|
this.label5 = new System.Windows.Forms.Label();
|
||||||
|
this.label6 = new System.Windows.Forms.Label();
|
||||||
|
this.label7 = new System.Windows.Forms.Label();
|
||||||
|
this.label8 = new System.Windows.Forms.Label();
|
||||||
|
this.txtName = new System.Windows.Forms.TextBox();
|
||||||
|
this.cmbType = new System.Windows.Forms.ComboBox();
|
||||||
|
this.txtPrice = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtQuantity = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtMinQuantity = new System.Windows.Forms.TextBox();
|
||||||
|
this.txtStockQuantity = new System.Windows.Forms.TextBox();
|
||||||
|
this.cmbUnit = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.btnSave = new System.Windows.Forms.Button();
|
||||||
|
this.button1 = new System.Windows.Forms.Button();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
this.label2.AutoSize = true;
|
||||||
|
this.label2.Location = new System.Drawing.Point(9, 64);
|
||||||
|
this.label2.Name = "label2";
|
||||||
|
this.label2.Size = new System.Drawing.Size(57, 13);
|
||||||
|
this.label2.TabIndex = 9;
|
||||||
|
this.label2.Text = "Название";
|
||||||
|
//
|
||||||
|
// label3
|
||||||
|
//
|
||||||
|
this.label3.AutoSize = true;
|
||||||
|
this.label3.Location = new System.Drawing.Point(9, 115);
|
||||||
|
this.label3.Name = "label3";
|
||||||
|
this.label3.Size = new System.Drawing.Size(26, 13);
|
||||||
|
this.label3.TabIndex = 10;
|
||||||
|
this.label3.Text = "Тип";
|
||||||
|
//
|
||||||
|
// label4
|
||||||
|
//
|
||||||
|
this.label4.AutoSize = true;
|
||||||
|
this.label4.Location = new System.Drawing.Point(9, 168);
|
||||||
|
this.label4.Name = "label4";
|
||||||
|
this.label4.Size = new System.Drawing.Size(33, 13);
|
||||||
|
this.label4.TabIndex = 11;
|
||||||
|
this.label4.Text = "Цена";
|
||||||
|
//
|
||||||
|
// label5
|
||||||
|
//
|
||||||
|
this.label5.AutoSize = true;
|
||||||
|
this.label5.Location = new System.Drawing.Point(9, 221);
|
||||||
|
this.label5.Name = "label5";
|
||||||
|
this.label5.Size = new System.Drawing.Size(66, 13);
|
||||||
|
this.label5.TabIndex = 12;
|
||||||
|
this.label5.Text = "Количество";
|
||||||
|
//
|
||||||
|
// label6
|
||||||
|
//
|
||||||
|
this.label6.AutoSize = true;
|
||||||
|
this.label6.Location = new System.Drawing.Point(9, 275);
|
||||||
|
this.label6.Name = "label6";
|
||||||
|
this.label6.Size = new System.Drawing.Size(139, 13);
|
||||||
|
this.label6.TabIndex = 13;
|
||||||
|
this.label6.Text = "Минимальное количество";
|
||||||
|
//
|
||||||
|
// label7
|
||||||
|
//
|
||||||
|
this.label7.AutoSize = true;
|
||||||
|
this.label7.Location = new System.Drawing.Point(9, 329);
|
||||||
|
this.label7.Name = "label7";
|
||||||
|
this.label7.Size = new System.Drawing.Size(120, 13);
|
||||||
|
this.label7.TabIndex = 14;
|
||||||
|
this.label7.Text = "Количество на складе";
|
||||||
|
//
|
||||||
|
// label8
|
||||||
|
//
|
||||||
|
this.label8.AutoSize = true;
|
||||||
|
this.label8.Location = new System.Drawing.Point(9, 382);
|
||||||
|
this.label8.Name = "label8";
|
||||||
|
this.label8.Size = new System.Drawing.Size(109, 13);
|
||||||
|
this.label8.TabIndex = 15;
|
||||||
|
this.label8.Text = "Единица измерения";
|
||||||
|
//
|
||||||
|
// txtName
|
||||||
|
//
|
||||||
|
this.txtName.Location = new System.Drawing.Point(12, 80);
|
||||||
|
this.txtName.Name = "txtName";
|
||||||
|
this.txtName.Size = new System.Drawing.Size(320, 20);
|
||||||
|
this.txtName.TabIndex = 16;
|
||||||
|
//
|
||||||
|
// cmbType
|
||||||
|
//
|
||||||
|
this.cmbType.FormattingEnabled = true;
|
||||||
|
this.cmbType.Location = new System.Drawing.Point(12, 131);
|
||||||
|
this.cmbType.Name = "cmbType";
|
||||||
|
this.cmbType.Size = new System.Drawing.Size(320, 21);
|
||||||
|
this.cmbType.TabIndex = 17;
|
||||||
|
//
|
||||||
|
// txtPrice
|
||||||
|
//
|
||||||
|
this.txtPrice.Location = new System.Drawing.Point(12, 184);
|
||||||
|
this.txtPrice.Name = "txtPrice";
|
||||||
|
this.txtPrice.Size = new System.Drawing.Size(320, 20);
|
||||||
|
this.txtPrice.TabIndex = 18;
|
||||||
|
//
|
||||||
|
// txtQuantity
|
||||||
|
//
|
||||||
|
this.txtQuantity.Location = new System.Drawing.Point(12, 238);
|
||||||
|
this.txtQuantity.Name = "txtQuantity";
|
||||||
|
this.txtQuantity.Size = new System.Drawing.Size(320, 20);
|
||||||
|
this.txtQuantity.TabIndex = 19;
|
||||||
|
//
|
||||||
|
// txtMinQuantity
|
||||||
|
//
|
||||||
|
this.txtMinQuantity.Location = new System.Drawing.Point(12, 292);
|
||||||
|
this.txtMinQuantity.Name = "txtMinQuantity";
|
||||||
|
this.txtMinQuantity.Size = new System.Drawing.Size(320, 20);
|
||||||
|
this.txtMinQuantity.TabIndex = 20;
|
||||||
|
//
|
||||||
|
// txtStockQuantity
|
||||||
|
//
|
||||||
|
this.txtStockQuantity.Location = new System.Drawing.Point(12, 345);
|
||||||
|
this.txtStockQuantity.Name = "txtStockQuantity";
|
||||||
|
this.txtStockQuantity.Size = new System.Drawing.Size(320, 20);
|
||||||
|
this.txtStockQuantity.TabIndex = 21;
|
||||||
|
//
|
||||||
|
// cmbUnit
|
||||||
|
//
|
||||||
|
this.cmbUnit.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cmbUnit.FormattingEnabled = true;
|
||||||
|
this.cmbUnit.Location = new System.Drawing.Point(12, 399);
|
||||||
|
this.cmbUnit.Name = "cmbUnit";
|
||||||
|
this.cmbUnit.Size = new System.Drawing.Size(320, 21);
|
||||||
|
this.cmbUnit.TabIndex = 22;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||||
|
this.label1.Location = new System.Drawing.Point(40, 9);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(267, 37);
|
||||||
|
this.label1.TabIndex = 23;
|
||||||
|
this.label1.Text = "Редактирование";
|
||||||
|
//
|
||||||
|
// btnSave
|
||||||
|
//
|
||||||
|
this.btnSave.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(84)))), ((int)(((byte)(111)))), ((int)(((byte)(148)))));
|
||||||
|
this.btnSave.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||||
|
this.btnSave.ForeColor = System.Drawing.SystemColors.ButtonHighlight;
|
||||||
|
this.btnSave.Location = new System.Drawing.Point(81, 447);
|
||||||
|
this.btnSave.Name = "btnSave";
|
||||||
|
this.btnSave.Size = new System.Drawing.Size(184, 64);
|
||||||
|
this.btnSave.TabIndex = 24;
|
||||||
|
this.btnSave.Text = "Сохранить изменения";
|
||||||
|
this.btnSave.UseVisualStyleBackColor = false;
|
||||||
|
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
this.button1.Location = new System.Drawing.Point(12, 488);
|
||||||
|
this.button1.Name = "button1";
|
||||||
|
this.button1.Size = new System.Drawing.Size(63, 23);
|
||||||
|
this.button1.TabIndex = 25;
|
||||||
|
this.button1.Text = "Назад";
|
||||||
|
this.button1.UseVisualStyleBackColor = true;
|
||||||
|
this.button1.Click += new System.EventHandler(this.button1_Click);
|
||||||
|
//
|
||||||
|
// Edit
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(207)))), ((int)(((byte)(206)))));
|
||||||
|
this.ClientSize = new System.Drawing.Size(344, 523);
|
||||||
|
this.Controls.Add(this.button1);
|
||||||
|
this.Controls.Add(this.btnSave);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.cmbUnit);
|
||||||
|
this.Controls.Add(this.txtStockQuantity);
|
||||||
|
this.Controls.Add(this.txtMinQuantity);
|
||||||
|
this.Controls.Add(this.txtQuantity);
|
||||||
|
this.Controls.Add(this.txtPrice);
|
||||||
|
this.Controls.Add(this.cmbType);
|
||||||
|
this.Controls.Add(this.txtName);
|
||||||
|
this.Controls.Add(this.label8);
|
||||||
|
this.Controls.Add(this.label7);
|
||||||
|
this.Controls.Add(this.label6);
|
||||||
|
this.Controls.Add(this.label5);
|
||||||
|
this.Controls.Add(this.label4);
|
||||||
|
this.Controls.Add(this.label3);
|
||||||
|
this.Controls.Add(this.label2);
|
||||||
|
this.Name = "Edit";
|
||||||
|
this.Text = "Edit";
|
||||||
|
this.Load += new System.EventHandler(this.Edit_Load_1);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.Label label2;
|
||||||
|
private System.Windows.Forms.Label label3;
|
||||||
|
private System.Windows.Forms.Label label4;
|
||||||
|
private System.Windows.Forms.Label label5;
|
||||||
|
private System.Windows.Forms.Label label6;
|
||||||
|
private System.Windows.Forms.Label label7;
|
||||||
|
private System.Windows.Forms.Label label8;
|
||||||
|
private System.Windows.Forms.TextBox txtName;
|
||||||
|
private System.Windows.Forms.ComboBox cmbType;
|
||||||
|
private System.Windows.Forms.TextBox txtPrice;
|
||||||
|
private System.Windows.Forms.TextBox txtMinQuantity;
|
||||||
|
private System.Windows.Forms.TextBox txtStockQuantity;
|
||||||
|
private System.Windows.Forms.ComboBox cmbUnit;
|
||||||
|
private System.Windows.Forms.Label label1;
|
||||||
|
private System.Windows.Forms.Button btnSave;
|
||||||
|
private System.Windows.Forms.TextBox txtQuantity;
|
||||||
|
private System.Windows.Forms.Button button1;
|
||||||
|
}
|
||||||
|
}
|
||||||
263
NeshinaDem3/NeshinaDem3/Edit.cs
Normal file
263
NeshinaDem3/NeshinaDem3/Edit.cs
Normal file
@ -0,0 +1,263 @@
|
|||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
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;
|
||||||
|
using static NeshinaDem3.Add;
|
||||||
|
|
||||||
|
namespace NeshinaDem3
|
||||||
|
{
|
||||||
|
public partial class Edit : Form
|
||||||
|
{
|
||||||
|
public Edit()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int MaterialId { get; set; }
|
||||||
|
private void btnSave_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(txtName.Text))
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите название материала.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtName.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmbType.SelectedItem == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Выберите тип материала.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
cmbType.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!decimal.TryParse(txtPrice.Text, out decimal price) || price < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите корректную цену (неотрицательное число).", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtPrice.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!int.TryParse(txtQuantity.Text, out int quantity) || quantity < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите корректное количество (неотрицательное целое число).", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtQuantity.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!int.TryParse(txtMinQuantity.Text, out int minQty) || minQty < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите корректное минимальное количество.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtMinQuantity.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!int.TryParse(txtStockQuantity.Text, out int stockQty) || stockQty < 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Введите корректное количество на складе.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
txtStockQuantity.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmbUnit.SelectedItem == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Выберите единицу измерения.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
cmbUnit.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var typeItem = (ComboItem)cmbType.SelectedItem;
|
||||||
|
var unitItem = (ComboItem)cmbUnit.SelectedItem;
|
||||||
|
|
||||||
|
string updateQuery = @"
|
||||||
|
UPDATE Materials
|
||||||
|
SET
|
||||||
|
Name = @name,
|
||||||
|
Type = @type,
|
||||||
|
Price = @price,
|
||||||
|
Quantity = @quantity,
|
||||||
|
MinQuantity = @minQty,
|
||||||
|
QuantityPack = @stockQty,
|
||||||
|
Unit = @unit
|
||||||
|
WHERE idMaterials = @id";
|
||||||
|
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using (var cmd = new MySqlCommand(updateQuery, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.AddWithValue("@name", txtName.Text.Trim());
|
||||||
|
cmd.Parameters.AddWithValue("@type", typeItem.Id);
|
||||||
|
cmd.Parameters.AddWithValue("@price", price);
|
||||||
|
cmd.Parameters.AddWithValue("@quantity", quantity);
|
||||||
|
cmd.Parameters.AddWithValue("@minQty", minQty);
|
||||||
|
cmd.Parameters.AddWithValue("@stockQty", stockQty);
|
||||||
|
cmd.Parameters.AddWithValue("@unit", unitItem.Id);
|
||||||
|
cmd.Parameters.AddWithValue("@id", MaterialId);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int rowsAffected = cmd.ExecuteNonQuery();
|
||||||
|
if (rowsAffected > 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Материал успешно обновлён!", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
this.DialogResult = DialogResult.OK;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось обновить материал. Возможно, он был удалён.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
this.DialogResult = DialogResult.Cancel;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Ошибка при обновлении: {ex.Message}", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadMaterialData()
|
||||||
|
{
|
||||||
|
if (MaterialId <= 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Некорректный ID материала.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
this.DialogResult = DialogResult.Cancel;
|
||||||
|
this.Close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LoadTypes();
|
||||||
|
LoadUnits();
|
||||||
|
|
||||||
|
string query = @"
|
||||||
|
SELECT
|
||||||
|
m.Name,
|
||||||
|
m.Type,
|
||||||
|
m.Price,
|
||||||
|
m.Quantity,
|
||||||
|
m.MinQuantity,
|
||||||
|
m.QuantityPack,
|
||||||
|
m.Unit
|
||||||
|
FROM Materials m
|
||||||
|
WHERE m.idMaterials = @id";
|
||||||
|
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using (var cmd = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.AddWithValue("@id", MaterialId);
|
||||||
|
|
||||||
|
using (var reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
if (reader.Read())
|
||||||
|
{
|
||||||
|
txtName.Text = reader.GetString("Name");
|
||||||
|
decimal price = reader.GetDecimal("Price");
|
||||||
|
txtPrice.Text = price.ToString();
|
||||||
|
|
||||||
|
int quantity = reader.GetInt32("Quantity");
|
||||||
|
txtQuantity.Text = quantity.ToString();
|
||||||
|
|
||||||
|
int minQty = reader.GetInt32("MinQuantity");
|
||||||
|
txtMinQuantity.Text = minQty.ToString();
|
||||||
|
|
||||||
|
int stockQty = reader.GetInt32("QuantityPack");
|
||||||
|
txtStockQuantity.Text = stockQty.ToString();
|
||||||
|
|
||||||
|
SelectComboBoxItem(cmbType, reader.GetInt32("Type"));
|
||||||
|
SelectComboBoxItem(cmbUnit, reader.GetInt32("Unit"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Материал не найден. Возможно, он был удалён.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
this.DialogResult = DialogResult.Cancel;
|
||||||
|
this.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SelectComboBoxItem(ComboBox comboBox, int id)
|
||||||
|
{
|
||||||
|
foreach (ComboItem item in comboBox.Items)
|
||||||
|
{
|
||||||
|
if (item.Id == id)
|
||||||
|
{
|
||||||
|
comboBox.SelectedItem = item;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadTypes()
|
||||||
|
{
|
||||||
|
string query = "SELECT idTypeMaterial, Name FROM TypeMaterial";
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using (var cmd = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
using (var reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
cmbType.Items.Add(new ComboItem
|
||||||
|
{
|
||||||
|
Id = reader.GetInt32("idTypeMaterial"),
|
||||||
|
Name = reader.GetString("Name")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadUnits()
|
||||||
|
{
|
||||||
|
string query = "SELECT idUnit, Name FROM Unit";
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using (var cmd = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
using (var reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
cmbUnit.Items.Add(new ComboItem
|
||||||
|
{
|
||||||
|
Id = reader.GetInt32("idUnit"),
|
||||||
|
Name = reader.GetString("Name")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Edit_Load_1(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
LoadMaterialData();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
this.Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
NeshinaDem3/NeshinaDem3/Edit.resx
Normal file
120
NeshinaDem3/NeshinaDem3/Edit.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
145
NeshinaDem3/NeshinaDem3/Form1.Designer.cs
generated
Normal file
145
NeshinaDem3/NeshinaDem3/Form1.Designer.cs
generated
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
namespace NeshinaDem3
|
||||||
|
{
|
||||||
|
partial class Form1
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Обязательная переменная конструктора.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Освободить все используемые ресурсы.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Код, автоматически созданный конструктором форм Windows
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||||
|
/// содержимое этого метода с помощью редактора кода.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||||
|
this.btnAdd = new System.Windows.Forms.Button();
|
||||||
|
this.btnEdit = new System.Windows.Forms.Button();
|
||||||
|
this.btnDelete = new System.Windows.Forms.Button();
|
||||||
|
this.btnSuppliers = new System.Windows.Forms.Button();
|
||||||
|
this.btnCalculate = new System.Windows.Forms.Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// dataGridView1
|
||||||
|
//
|
||||||
|
this.dataGridView1.AllowUserToAddRows = false;
|
||||||
|
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||||
|
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
|
||||||
|
this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||||
|
this.dataGridView1.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(207)))), ((int)(((byte)(206)))));
|
||||||
|
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||||
|
this.dataGridView1.Location = new System.Drawing.Point(13, 36);
|
||||||
|
this.dataGridView1.Name = "dataGridView1";
|
||||||
|
this.dataGridView1.ReadOnly = true;
|
||||||
|
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||||
|
this.dataGridView1.Size = new System.Drawing.Size(487, 281);
|
||||||
|
this.dataGridView1.TabIndex = 0;
|
||||||
|
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
|
||||||
|
//
|
||||||
|
// btnAdd
|
||||||
|
//
|
||||||
|
this.btnAdd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(84)))), ((int)(((byte)(111)))), ((int)(((byte)(148)))));
|
||||||
|
this.btnAdd.ForeColor = System.Drawing.SystemColors.ButtonFace;
|
||||||
|
this.btnAdd.Location = new System.Drawing.Point(525, 13);
|
||||||
|
this.btnAdd.Name = "btnAdd";
|
||||||
|
this.btnAdd.Size = new System.Drawing.Size(263, 23);
|
||||||
|
this.btnAdd.TabIndex = 1;
|
||||||
|
this.btnAdd.Text = "Добавить";
|
||||||
|
this.btnAdd.UseVisualStyleBackColor = false;
|
||||||
|
this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
|
||||||
|
//
|
||||||
|
// btnEdit
|
||||||
|
//
|
||||||
|
this.btnEdit.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(84)))), ((int)(((byte)(111)))), ((int)(((byte)(148)))));
|
||||||
|
this.btnEdit.ForeColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.btnEdit.Location = new System.Drawing.Point(525, 43);
|
||||||
|
this.btnEdit.Name = "btnEdit";
|
||||||
|
this.btnEdit.Size = new System.Drawing.Size(263, 23);
|
||||||
|
this.btnEdit.TabIndex = 2;
|
||||||
|
this.btnEdit.Text = "Редактировать";
|
||||||
|
this.btnEdit.UseVisualStyleBackColor = false;
|
||||||
|
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
|
||||||
|
//
|
||||||
|
// btnDelete
|
||||||
|
//
|
||||||
|
this.btnDelete.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(84)))), ((int)(((byte)(111)))), ((int)(((byte)(148)))));
|
||||||
|
this.btnDelete.ForeColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.btnDelete.Location = new System.Drawing.Point(525, 73);
|
||||||
|
this.btnDelete.Name = "btnDelete";
|
||||||
|
this.btnDelete.Size = new System.Drawing.Size(263, 23);
|
||||||
|
this.btnDelete.TabIndex = 3;
|
||||||
|
this.btnDelete.Text = "Удалить";
|
||||||
|
this.btnDelete.UseVisualStyleBackColor = false;
|
||||||
|
this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
|
||||||
|
//
|
||||||
|
// btnSuppliers
|
||||||
|
//
|
||||||
|
this.btnSuppliers.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(84)))), ((int)(((byte)(111)))), ((int)(((byte)(148)))));
|
||||||
|
this.btnSuppliers.ForeColor = System.Drawing.SystemColors.ButtonFace;
|
||||||
|
this.btnSuppliers.Location = new System.Drawing.Point(294, 323);
|
||||||
|
this.btnSuppliers.Name = "btnSuppliers";
|
||||||
|
this.btnSuppliers.Size = new System.Drawing.Size(206, 23);
|
||||||
|
this.btnSuppliers.TabIndex = 4;
|
||||||
|
this.btnSuppliers.Text = "Поставщики";
|
||||||
|
this.btnSuppliers.UseVisualStyleBackColor = false;
|
||||||
|
this.btnSuppliers.Click += new System.EventHandler(this.button4_Click);
|
||||||
|
//
|
||||||
|
// btnCalculate
|
||||||
|
//
|
||||||
|
this.btnCalculate.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(84)))), ((int)(((byte)(111)))), ((int)(((byte)(148)))));
|
||||||
|
this.btnCalculate.ForeColor = System.Drawing.SystemColors.Control;
|
||||||
|
this.btnCalculate.Location = new System.Drawing.Point(294, 353);
|
||||||
|
this.btnCalculate.Name = "btnCalculate";
|
||||||
|
this.btnCalculate.Size = new System.Drawing.Size(206, 23);
|
||||||
|
this.btnCalculate.TabIndex = 5;
|
||||||
|
this.btnCalculate.Text = "Можно произвести";
|
||||||
|
this.btnCalculate.UseVisualStyleBackColor = false;
|
||||||
|
this.btnCalculate.Click += new System.EventHandler(this.btnCalculate_Click);
|
||||||
|
//
|
||||||
|
// Form1
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.BackColor = System.Drawing.Color.White;
|
||||||
|
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||||
|
this.Controls.Add(this.btnCalculate);
|
||||||
|
this.Controls.Add(this.btnSuppliers);
|
||||||
|
this.Controls.Add(this.btnDelete);
|
||||||
|
this.Controls.Add(this.btnEdit);
|
||||||
|
this.Controls.Add(this.btnAdd);
|
||||||
|
this.Controls.Add(this.dataGridView1);
|
||||||
|
this.Name = "Form1";
|
||||||
|
this.Text = "Form1";
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private System.Windows.Forms.DataGridView dataGridView1;
|
||||||
|
private System.Windows.Forms.Button btnAdd;
|
||||||
|
private System.Windows.Forms.Button btnEdit;
|
||||||
|
private System.Windows.Forms.Button btnDelete;
|
||||||
|
private System.Windows.Forms.Button btnSuppliers;
|
||||||
|
private System.Windows.Forms.Button btnCalculate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
382
NeshinaDem3/NeshinaDem3/Form1.cs
Normal file
382
NeshinaDem3/NeshinaDem3/Form1.cs
Normal file
@ -0,0 +1,382 @@
|
|||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
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 NeshinaDem3
|
||||||
|
{
|
||||||
|
public partial class Form1 : Form
|
||||||
|
{
|
||||||
|
public int CalculateProductOutput(
|
||||||
|
int productTypeId,
|
||||||
|
int materialTypeId,
|
||||||
|
int rawMaterialAmount,
|
||||||
|
double param1,
|
||||||
|
double param2)
|
||||||
|
{
|
||||||
|
// 🔹 Проверка входных данных
|
||||||
|
if (productTypeId <= 0 ||
|
||||||
|
materialTypeId <= 0 ||
|
||||||
|
rawMaterialAmount <= 0 ||
|
||||||
|
param1 <= 0 ||
|
||||||
|
param2 <= 0)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
double productCoeff = 0;
|
||||||
|
double lossPercent = 0;
|
||||||
|
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
// 🔹 Получаем коэффициент типа продукции
|
||||||
|
string productQuery = "SELECT Coefficient FROM TypeProduction WHERE idTypeProduction = @productId";
|
||||||
|
using (var cmd = new MySqlCommand(productQuery, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.AddWithValue("@productId", productTypeId);
|
||||||
|
var result = cmd.ExecuteScalar();
|
||||||
|
if (result == null || result == DBNull.Value)
|
||||||
|
{
|
||||||
|
return -1; // Тип продукции не найден
|
||||||
|
}
|
||||||
|
productCoeff = Convert.ToDouble(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔹 Получаем процент потерь материала
|
||||||
|
string materialQuery = "SELECT Procent FROM TypeWithProcent WHERE idTypeWithProcent = @materialId";
|
||||||
|
using (var cmd = new MySqlCommand(materialQuery, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.AddWithValue("@materialId", materialTypeId);
|
||||||
|
var result = cmd.ExecuteScalar();
|
||||||
|
if (result == null || result == DBNull.Value)
|
||||||
|
{
|
||||||
|
return -1; // Тип материала не найден
|
||||||
|
}
|
||||||
|
lossPercent = Convert.ToDouble(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔹 Проверка логичности потерь
|
||||||
|
if (lossPercent < 0 || lossPercent >= 100)
|
||||||
|
{
|
||||||
|
return -1; // Невозможные потери
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔹 Расчёт базового количества сырья на 1 единицу продукции
|
||||||
|
double baseMaterialPerUnit = param1 * param2 * productCoeff;
|
||||||
|
|
||||||
|
if (baseMaterialPerUnit <= 0)
|
||||||
|
{
|
||||||
|
return -1; // Некорректный расчёт
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔹 Учёт потерь: сколько сырья реально нужно на 1 шт.
|
||||||
|
double effectiveMaterialPerUnit = baseMaterialPerUnit / (1.0 - lossPercent / 100.0);
|
||||||
|
|
||||||
|
// 🔹 Сколько единиц можно произвести
|
||||||
|
if (effectiveMaterialPerUnit > rawMaterialAmount)
|
||||||
|
{
|
||||||
|
return 0; // Сырья не хватает даже на 1 шт.
|
||||||
|
}
|
||||||
|
|
||||||
|
int maxUnits = (int)Math.Floor((double)rawMaterialAmount / effectiveMaterialPerUnit);
|
||||||
|
|
||||||
|
return Math.Max(0, maxUnits);
|
||||||
|
}
|
||||||
|
public Form1()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
LoadMaterials();
|
||||||
|
btnAdd.Visible = true;
|
||||||
|
btnEdit.Visible = true;
|
||||||
|
btnDelete.Visible = true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void LoadMaterials()
|
||||||
|
{
|
||||||
|
string query = @"
|
||||||
|
SELECT
|
||||||
|
m.idMaterials,
|
||||||
|
m.Name,
|
||||||
|
t.Name AS TypeName,
|
||||||
|
m.Price,
|
||||||
|
m.Quantity,
|
||||||
|
m.MinQuantity,
|
||||||
|
m.QuantityPack,
|
||||||
|
u.Name AS UnitName
|
||||||
|
FROM Materials m
|
||||||
|
LEFT JOIN TypeMaterial t ON m.Type = t.idTypeMaterial
|
||||||
|
LEFT JOIN Unit u ON m.Unit = u.idUnit";
|
||||||
|
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
DataTable dt;
|
||||||
|
using (var cmd = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
var adapter = new MySqlDataAdapter(cmd);
|
||||||
|
dt = new DataTable();
|
||||||
|
adapter.Fill(dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Привязываем данные
|
||||||
|
dataGridView1.DataSource = dt;
|
||||||
|
|
||||||
|
if (dataGridView1.Columns.Contains("idMaterials"))
|
||||||
|
dataGridView1.Columns["idMaterials"].Visible = false;
|
||||||
|
|
||||||
|
dataGridView1.Columns["Name"].HeaderText = "Наименование";
|
||||||
|
dataGridView1.Columns["TypeName"].HeaderText = "Тип";
|
||||||
|
dataGridView1.Columns["Price"].HeaderText = "Цена";
|
||||||
|
dataGridView1.Columns["Quantity"].HeaderText = "Кол-во на складе";
|
||||||
|
dataGridView1.Columns["MinQuantity"].HeaderText = "Мин. кол-во";
|
||||||
|
dataGridView1.Columns["QuantityPack"].HeaderText = "Кол-во в упаковке";
|
||||||
|
dataGridView1.Columns["UnitName"].HeaderText = "Ед. изм.";
|
||||||
|
|
||||||
|
// Удаляем старую колонку, если есть
|
||||||
|
if (dataGridView1.Columns.Contains("MinPartyCost"))
|
||||||
|
dataGridView1.Columns.Remove("MinPartyCost");
|
||||||
|
|
||||||
|
// Добавляем новую колонку
|
||||||
|
var minPartyCostCol = new DataGridViewTextBoxColumn
|
||||||
|
{
|
||||||
|
Name = "MinPartyCost",
|
||||||
|
HeaderText = "Стоимость минимальной партии",
|
||||||
|
ReadOnly = true,
|
||||||
|
DefaultCellStyle = { Format = "C2" }
|
||||||
|
};
|
||||||
|
dataGridView1.Columns.Add(minPartyCostCol);
|
||||||
|
|
||||||
|
foreach (DataGridViewRow row in dataGridView1.Rows)
|
||||||
|
{
|
||||||
|
if (row.IsNewRow) continue;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Проверяем, что значения не null
|
||||||
|
if (row.Cells["MinQuantity"].Value == null ||
|
||||||
|
row.Cells["Quantity"].Value == null ||
|
||||||
|
row.Cells["QuantityPack"].Value == null ||
|
||||||
|
row.Cells["Price"].Value == null)
|
||||||
|
{
|
||||||
|
row.Cells["MinPartyCost"].Value = 0m;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
int minQty = Convert.ToInt32(row.Cells["MinQuantity"].Value);
|
||||||
|
int stockQty = Convert.ToInt32(row.Cells["Quantity"].Value);
|
||||||
|
int packQty = Convert.ToInt32(row.Cells["QuantityPack"].Value);
|
||||||
|
decimal price = Convert.ToDecimal(row.Cells["Price"].Value);
|
||||||
|
|
||||||
|
decimal cost = 0m;
|
||||||
|
|
||||||
|
if (stockQty < minQty)
|
||||||
|
{
|
||||||
|
int deficit = minQty - stockQty;
|
||||||
|
if (packQty > 0) // Защита от деления на ноль
|
||||||
|
{
|
||||||
|
int packsNeeded = (int)Math.Ceiling((double)deficit / packQty);
|
||||||
|
int orderVolume = packsNeeded * packQty;
|
||||||
|
cost = orderVolume * price;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cost = Math.Max(0m, Math.Round(cost, 2));
|
||||||
|
row.Cells["MinPartyCost"].Value = cost;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
row.Cells["MinPartyCost"].Value = 0m;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadSuppliers()
|
||||||
|
{
|
||||||
|
string query = @"SELECT
|
||||||
|
m.Name,
|
||||||
|
y.Name,
|
||||||
|
m.INN,
|
||||||
|
m.Rating,
|
||||||
|
m.Date FROM Supplier m
|
||||||
|
left join TypeSupplier y on m.Type = y.idTypeSupplier";
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
using (var cmd = new MySqlCommand(query, conn))
|
||||||
|
{
|
||||||
|
var adapter = new MySqlDataAdapter(cmd);
|
||||||
|
var dt = new DataTable();
|
||||||
|
adapter.Fill(dt);
|
||||||
|
dataGridView1.DataSource = dt;
|
||||||
|
if (dataGridView1.Columns.Contains("TotalCost"))
|
||||||
|
dataGridView1.Columns.Remove("TotalCost");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private bool isShowingSuppliers = false;
|
||||||
|
private void button4_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (isShowingSuppliers)
|
||||||
|
{
|
||||||
|
LoadMaterials();
|
||||||
|
btnAdd.Visible = true;
|
||||||
|
btnEdit.Visible = true;
|
||||||
|
btnDelete.Visible = true;
|
||||||
|
btnSuppliers.Text = "Поставщики";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LoadSuppliers();
|
||||||
|
btnAdd.Visible = false;
|
||||||
|
btnEdit.Visible = false;
|
||||||
|
btnDelete.Visible = false;
|
||||||
|
btnSuppliers.Text = "Материалы";
|
||||||
|
}
|
||||||
|
isShowingSuppliers = !isShowingSuppliers;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnAdd_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var addForm = new Add();
|
||||||
|
if (addForm.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
// Обновляем данные после успешного добавления
|
||||||
|
LoadMaterials();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnEdit_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (dataGridView1.SelectedRows.Count == 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Выберите строку для редактирования.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectedRow = dataGridView1.SelectedRows[0];
|
||||||
|
if (selectedRow.Cells["idMaterials"].Value == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось получить ID материала.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int materialId = Convert.ToInt32(selectedRow.Cells["idMaterials"].Value);
|
||||||
|
|
||||||
|
// Создаём форму
|
||||||
|
var editForm = new Edit
|
||||||
|
{
|
||||||
|
MaterialId = materialId
|
||||||
|
};
|
||||||
|
|
||||||
|
// Открываем как диалоговое окно
|
||||||
|
if (editForm.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
// Форма уже закрыта и Disposed — но мы не обращаемся к ней
|
||||||
|
LoadMaterials(); // Обновляем данные
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void btnDelete_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Проверка: выбрана ли строка
|
||||||
|
if (dataGridView1.SelectedRows.Count == 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Выберите строку для удаления.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var selectedRow = dataGridView1.SelectedRows[0];
|
||||||
|
|
||||||
|
// Получаем ID и название материала
|
||||||
|
if (selectedRow.Cells["idMaterials"].Value == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось получить ID материала.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int materialId = Convert.ToInt32(selectedRow.Cells["idMaterials"].Value);
|
||||||
|
string materialName = selectedRow.Cells["Name"].Value?.ToString() ?? "неизвестный";
|
||||||
|
|
||||||
|
// Подтверждение удаления
|
||||||
|
var result = MessageBox.Show(
|
||||||
|
$"Вы уверены, что хотите удалить материал:\n\n«{materialName}»?\n\nЭто действие нельзя отменить.",
|
||||||
|
"Подтверждение удаления",
|
||||||
|
MessageBoxButtons.YesNo,
|
||||||
|
MessageBoxIcon.Warning
|
||||||
|
);
|
||||||
|
|
||||||
|
if (result == DialogResult.No)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Удаляем из БД
|
||||||
|
string deleteQuery = "DELETE FROM Materials WHERE idMaterials = @id";
|
||||||
|
|
||||||
|
var conn = DB.GetInstance().GetConnection();
|
||||||
|
if (conn.State == ConnectionState.Closed)
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using (var cmd = new MySqlCommand(deleteQuery, conn))
|
||||||
|
{
|
||||||
|
cmd.Parameters.AddWithValue("@id", materialId);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int rowsAffected = cmd.ExecuteNonQuery();
|
||||||
|
if (rowsAffected > 0)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Материал успешно удалён!", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
LoadMaterials(); // Обновляем таблицу
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось удалить материал. Возможно, он уже был удалён.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Ошибка при удалении: {ex.Message}", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void btnCalculate_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
int output = CalculateProductOutput(
|
||||||
|
productTypeId: 1,
|
||||||
|
materialTypeId: 2,
|
||||||
|
rawMaterialAmount: 1000,
|
||||||
|
param1: 1.5,
|
||||||
|
param2: 2.0
|
||||||
|
);
|
||||||
|
|
||||||
|
if (output == -1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Ошибка: неверные параметры или типы не найдены.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Можно произвести: {output} единиц продукции.", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
120
NeshinaDem3/NeshinaDem3/Form1.resx
Normal file
120
NeshinaDem3/NeshinaDem3/Form1.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
105
NeshinaDem3/NeshinaDem3/NeshinaDem3.csproj
Normal file
105
NeshinaDem3/NeshinaDem3/NeshinaDem3.csproj
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{E6B40B3D-4197-489D-AD89-F7FDABAF4249}</ProjectGuid>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<RootNamespace>NeshinaDem3</RootNamespace>
|
||||||
|
<AssemblyName>NeshinaDem3</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="MySql.Data">
|
||||||
|
<HintPath>..\..\..\Users\Student\Desktop\MySql.Data.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Deployment" />
|
||||||
|
<Reference Include="System.Drawing" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Windows.Forms" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Add.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Add.Designer.cs">
|
||||||
|
<DependentUpon>Add.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DB.cs" />
|
||||||
|
<Compile Include="Edit.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Edit.Designer.cs">
|
||||||
|
<DependentUpon>Edit.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Form1.cs">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Form1.Designer.cs">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<EmbeddedResource Include="Add.resx">
|
||||||
|
<DependentUpon>Add.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Edit.resx">
|
||||||
|
<DependentUpon>Edit.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Form1.resx">
|
||||||
|
<DependentUpon>Form1.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<Compile Include="Properties\Resources.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<None Include="Properties\Settings.settings">
|
||||||
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
|
</None>
|
||||||
|
<Compile Include="Properties\Settings.Designer.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DependentUpon>Settings.settings</DependentUpon>
|
||||||
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
</Compile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
||||||
22
NeshinaDem3/NeshinaDem3/Program.cs
Normal file
22
NeshinaDem3/NeshinaDem3/Program.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace NeshinaDem3
|
||||||
|
{
|
||||||
|
internal static class Program
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Главная точка входа для приложения.
|
||||||
|
/// </summary>
|
||||||
|
[STAThread]
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Application.EnableVisualStyles();
|
||||||
|
Application.SetCompatibleTextRenderingDefault(false);
|
||||||
|
Application.Run(new Form1());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
36
NeshinaDem3/NeshinaDem3/Properties/AssemblyInfo.cs
Normal file
36
NeshinaDem3/NeshinaDem3/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// Общие сведения об этой сборке предоставляются следующим набором
|
||||||
|
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
|
||||||
|
// связанных со сборкой.
|
||||||
|
[assembly: AssemblyTitle("NeshinaDem3")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("NeshinaDem3")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2025")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
|
||||||
|
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
|
||||||
|
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
|
||||||
|
[assembly: Guid("e6b40b3d-4197-489d-ad89-f7fdabaf4249")]
|
||||||
|
|
||||||
|
// Сведения о версии сборки состоят из указанных ниже четырех значений:
|
||||||
|
//
|
||||||
|
// Основной номер версии
|
||||||
|
// Дополнительный номер версии
|
||||||
|
// Номер сборки
|
||||||
|
// Редакция
|
||||||
|
//
|
||||||
|
// Можно задать все значения или принять номера сборки и редакции по умолчанию
|
||||||
|
// используя "*", как показано ниже:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
71
NeshinaDem3/NeshinaDem3/Properties/Resources.Designer.cs
generated
Normal file
71
NeshinaDem3/NeshinaDem3/Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Этот код создан программным средством.
|
||||||
|
// Версия среды выполнения: 4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
|
||||||
|
// код создан повторно.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace NeshinaDem3.Properties
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
|
||||||
|
/// </summary>
|
||||||
|
// Этот класс был автоматически создан при помощи 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()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
|
||||||
|
/// </summary>
|
||||||
|
[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("NeshinaDem3.Properties.Resources", typeof(Resources).Assembly);
|
||||||
|
resourceMan = temp;
|
||||||
|
}
|
||||||
|
return resourceMan;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Переопределяет свойство CurrentUICulture текущего потока для всех
|
||||||
|
/// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
|
internal static global::System.Globalization.CultureInfo Culture
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return resourceCulture;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
resourceCulture = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
117
NeshinaDem3/NeshinaDem3/Properties/Resources.resx
Normal file
117
NeshinaDem3/NeshinaDem3/Properties/Resources.resx
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
||||||
30
NeshinaDem3/NeshinaDem3/Properties/Settings.Designer.cs
generated
Normal file
30
NeshinaDem3/NeshinaDem3/Properties/Settings.Designer.cs
generated
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// 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.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace NeshinaDem3.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
7
NeshinaDem3/NeshinaDem3/Properties/Settings.settings
Normal file
7
NeshinaDem3/NeshinaDem3/Properties/Settings.settings
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||||
|
<Profiles>
|
||||||
|
<Profile Name="(Default)" />
|
||||||
|
</Profiles>
|
||||||
|
<Settings />
|
||||||
|
</SettingsFile>
|
||||||
BIN
NeshinaDem3/NeshinaDem3/bin/Debug/MySql.Data.dll
Normal file
BIN
NeshinaDem3/NeshinaDem3/bin/Debug/MySql.Data.dll
Normal file
Binary file not shown.
BIN
NeshinaDem3/NeshinaDem3/bin/Debug/NeshinaDem3.exe
Normal file
BIN
NeshinaDem3/NeshinaDem3/bin/Debug/NeshinaDem3.exe
Normal file
Binary file not shown.
6
NeshinaDem3/NeshinaDem3/bin/Debug/NeshinaDem3.exe.config
Normal file
6
NeshinaDem3/NeshinaDem3/bin/Debug/NeshinaDem3.exe.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||||
|
</startup>
|
||||||
|
</configuration>
|
||||||
BIN
NeshinaDem3/NeshinaDem3/bin/Debug/NeshinaDem3.pdb
Normal file
BIN
NeshinaDem3/NeshinaDem3/bin/Debug/NeshinaDem3.pdb
Normal file
Binary file not shown.
@ -0,0 +1,4 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
|
||||||
Binary file not shown.
Binary file not shown.
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.Add.resources
Normal file
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.Add.resources
Normal file
Binary file not shown.
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.Edit.resources
Normal file
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.Edit.resources
Normal file
Binary file not shown.
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.Form1.resources
Normal file
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.Form1.resources
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
3f3753805659d5e3f4f462a21c160f768bd7c1b35d22533c3498c7898b7c3c1d
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\bin\Debug\NeshinaDem3.exe.config
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\bin\Debug\NeshinaDem3.exe
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\bin\Debug\NeshinaDem3.pdb
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\bin\Debug\MySql.Data.dll
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.csproj.AssemblyReference.cache
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.Add.resources
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.Edit.resources
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.Form1.resources
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.Properties.Resources.resources
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.csproj.GenerateResource.cache
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.csproj.CoreCompileInputs.cache
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.csproj.CopyComplete
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.exe
|
||||||
|
C:\NeshinaPolina1811\NeshinaDem3\NeshinaDem3\obj\Debug\NeshinaDem3.pdb
|
||||||
Binary file not shown.
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.exe
Normal file
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.exe
Normal file
Binary file not shown.
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.pdb
Normal file
BIN
NeshinaDem3/NeshinaDem3/obj/Debug/NeshinaDem3.pdb
Normal file
Binary file not shown.
BIN
PDF/EER.pdf
Normal file
BIN
PDF/EER.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user