Добавьте файлы проекта.
This commit is contained in:
commit
7a1a987b5c
63
.gitattributes
vendored
Normal file
63
.gitattributes
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
363
.gitignore
vendored
Normal file
363
.gitignore
vendored
Normal file
@ -0,0 +1,363 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
19
1202.cs
Normal file
19
1202.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace samusev_42
|
||||
{
|
||||
public partial class Product
|
||||
{
|
||||
[NotMapped]
|
||||
public string CountUnit
|
||||
{
|
||||
/// Объединение колонок "Количечество и Штук", чтобы выглядело красиво
|
||||
get { return Count + " " + Unit.ToString(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
111
AuthForm.Designer.cs
generated
Normal file
111
AuthForm.Designer.cs
generated
Normal file
@ -0,0 +1,111 @@
|
||||
namespace samusev_42
|
||||
{
|
||||
partial class AuthForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
textBoxLogin = new TextBox();
|
||||
textBoxPassword = new TextBox();
|
||||
buttonLogin = new Button();
|
||||
label1 = new Label();
|
||||
label2 = new Label();
|
||||
SuspendLayout();
|
||||
//
|
||||
// textBoxLogin
|
||||
//
|
||||
textBoxLogin.Font = new Font("Segoe UI Semibold", 14.25F, FontStyle.Bold);
|
||||
textBoxLogin.Location = new Point(28, 66);
|
||||
textBoxLogin.Name = "textBoxLogin";
|
||||
textBoxLogin.Size = new Size(230, 33);
|
||||
textBoxLogin.TabIndex = 0;
|
||||
//
|
||||
// textBoxPassword
|
||||
//
|
||||
textBoxPassword.Font = new Font("Segoe UI Semibold", 14.25F, FontStyle.Bold);
|
||||
textBoxPassword.Location = new Point(28, 165);
|
||||
textBoxPassword.Name = "textBoxPassword";
|
||||
textBoxPassword.Size = new Size(230, 33);
|
||||
textBoxPassword.TabIndex = 1;
|
||||
//
|
||||
// buttonLogin
|
||||
//
|
||||
buttonLogin.BackColor = Color.MistyRose;
|
||||
buttonLogin.Font = new Font("Segoe UI Semibold", 14.25F, FontStyle.Bold);
|
||||
buttonLogin.Location = new Point(75, 233);
|
||||
buttonLogin.Name = "buttonLogin";
|
||||
buttonLogin.Size = new Size(148, 42);
|
||||
buttonLogin.TabIndex = 2;
|
||||
buttonLogin.Text = "Войти";
|
||||
buttonLogin.UseVisualStyleBackColor = false;
|
||||
buttonLogin.Click += buttonLogin_Click;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
label1.AutoSize = true;
|
||||
label1.Font = new Font("Segoe UI Semibold", 14.25F, FontStyle.Bold);
|
||||
label1.Location = new Point(111, 28);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new Size(71, 25);
|
||||
label1.TabIndex = 3;
|
||||
label1.Text = "Логин:";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI Semibold", 14.25F, FontStyle.Bold);
|
||||
label2.Location = new Point(98, 128);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(84, 25);
|
||||
label2.TabIndex = 4;
|
||||
label2.Text = "Пароль:";
|
||||
//
|
||||
// AuthForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.PeachPuff;
|
||||
ClientSize = new Size(286, 308);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(buttonLogin);
|
||||
Controls.Add(textBoxPassword);
|
||||
Controls.Add(textBoxLogin);
|
||||
Name = "AuthForm";
|
||||
Text = "AuthForm";
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private TextBox textBoxLogin;
|
||||
private TextBox textBoxPassword;
|
||||
private Button buttonLogin;
|
||||
private Label label1;
|
||||
private Label label2;
|
||||
}
|
||||
}
|
||||
65
AuthForm.cs
Normal file
65
AuthForm.cs
Normal file
@ -0,0 +1,65 @@
|
||||
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 samusev_42
|
||||
{
|
||||
public partial class AuthForm : Form
|
||||
{
|
||||
Ispr2522SamusevOvLazarev2Context context = new Ispr2522SamusevOvLazarev2Context();
|
||||
|
||||
public AuthForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void buttonLogin_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string inputLogin = textBoxLogin.Text.Trim();
|
||||
string inputPassword = textBoxPassword.Text.Trim();
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(inputLogin) || string.IsNullOrEmpty(inputPassword))
|
||||
{
|
||||
MessageBox.Show("Введите логин и пароль!", "Внимание", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var user = context.Users.FirstOrDefault(x => x.Login == inputLogin && x.Password == inputPassword);
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
|
||||
this.Hide();
|
||||
|
||||
Form1 mainForm = new Form1();
|
||||
mainForm.ShowDialog();
|
||||
|
||||
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
MessageBox.Show("Пользователь не найден! Проверьте правильность данных.",
|
||||
"Ошибка авторизации", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
MessageBox.Show($"Ошибка подключения: {ex.Message}", "Критическая ошибка");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
120
AuthForm.resx
Normal file
120
AuthForm.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>
|
||||
101
CardForm.Designer.cs
generated
Normal file
101
CardForm.Designer.cs
generated
Normal file
@ -0,0 +1,101 @@
|
||||
namespace samusev_42
|
||||
{
|
||||
partial class CardForm
|
||||
{
|
||||
/// <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 Код, автоматически созданный конструктором компонентов
|
||||
|
||||
/// <summary>
|
||||
/// Требуемый метод для поддержки конструктора — не изменяйте
|
||||
/// содержимое этого метода с помощью редактора кода.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
labelName = new Label();
|
||||
labelPrice = new Label();
|
||||
pictureBoxProduct = new PictureBox();
|
||||
labelDescription = new Label();
|
||||
((System.ComponentModel.ISupportInitialize)pictureBoxProduct).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// labelName
|
||||
//
|
||||
labelName.AutoSize = true;
|
||||
labelName.Font = new Font("Segoe UI", 9.75F, FontStyle.Bold);
|
||||
labelName.Location = new Point(220, 30);
|
||||
labelName.Name = "labelName";
|
||||
labelName.Size = new Size(45, 17);
|
||||
labelName.TabIndex = 0;
|
||||
labelName.Text = "label1";
|
||||
//
|
||||
// labelPrice
|
||||
//
|
||||
labelPrice.AutoSize = true;
|
||||
labelPrice.Font = new Font("Segoe UI", 9.75F, FontStyle.Bold);
|
||||
labelPrice.Location = new Point(220, 61);
|
||||
labelPrice.Name = "labelPrice";
|
||||
labelPrice.Size = new Size(45, 17);
|
||||
labelPrice.TabIndex = 1;
|
||||
labelPrice.Text = "label2";
|
||||
//
|
||||
// pictureBoxProduct
|
||||
//
|
||||
pictureBoxProduct.BackColor = Color.White;
|
||||
pictureBoxProduct.Location = new Point(16, 12);
|
||||
pictureBoxProduct.Name = "pictureBoxProduct";
|
||||
pictureBoxProduct.Size = new Size(181, 118);
|
||||
pictureBoxProduct.TabIndex = 2;
|
||||
pictureBoxProduct.TabStop = false;
|
||||
//
|
||||
// labelDescription
|
||||
//
|
||||
labelDescription.AutoSize = true;
|
||||
labelDescription.Font = new Font("Segoe UI", 9.75F, FontStyle.Bold);
|
||||
labelDescription.Location = new Point(220, 87);
|
||||
labelDescription.Name = "labelDescription";
|
||||
labelDescription.Size = new Size(45, 17);
|
||||
labelDescription.TabIndex = 3;
|
||||
labelDescription.Text = "label1";
|
||||
//
|
||||
// CardForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.Bisque;
|
||||
Controls.Add(labelDescription);
|
||||
Controls.Add(pictureBoxProduct);
|
||||
Controls.Add(labelPrice);
|
||||
Controls.Add(labelName);
|
||||
Name = "CardForm";
|
||||
Size = new Size(708, 149);
|
||||
Load += CardForm_Load;
|
||||
((System.ComponentModel.ISupportInitialize)pictureBoxProduct).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private Label labelName;
|
||||
private Label labelPrice;
|
||||
private PictureBox pictureBoxProduct;
|
||||
private Label labelDescription;
|
||||
}
|
||||
}
|
||||
42
CardForm.cs
Normal file
42
CardForm.cs
Normal file
@ -0,0 +1,42 @@
|
||||
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 samusev_42
|
||||
{
|
||||
public partial class CardForm : UserControl
|
||||
{
|
||||
public CardForm(Product product)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
labelName.Text = product.IdProductNameNavigation?.ProductName1 ?? "Название отсутствует";
|
||||
|
||||
labelPrice.Text = $"{product.Price:C2}";
|
||||
|
||||
labelDescription.Text = product.Description;
|
||||
|
||||
if (!string.IsNullOrEmpty(product.Photo))
|
||||
{
|
||||
try
|
||||
{
|
||||
pictureBoxProduct.ImageLocation = product.Photo;
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CardForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
120
CardForm.resx
Normal file
120
CardForm.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>
|
||||
13
Category.cs
Normal file
13
Category.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Category
|
||||
{
|
||||
public int IdCategory { get; set; }
|
||||
|
||||
public string CategoryName { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
|
||||
}
|
||||
29
Delivery.cs
Normal file
29
Delivery.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Delivery
|
||||
{
|
||||
public int IdDelivery { get; set; }
|
||||
|
||||
public DateTime DateOrder { get; set; }
|
||||
|
||||
public DateTime DateDelivery { get; set; }
|
||||
|
||||
public int IdPickUpPoint { get; set; }
|
||||
|
||||
public int IdUser { get; set; }
|
||||
|
||||
public int Code { get; set; }
|
||||
|
||||
public int IdStatus { get; set; }
|
||||
|
||||
public virtual PickUpPoint IdPickUpPointNavigation { get; set; } = null!;
|
||||
|
||||
public virtual Status IdStatusNavigation { get; set; } = null!;
|
||||
|
||||
public virtual User IdUserNavigation { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<OrdersProduct> OrdersProducts { get; set; } = new List<OrdersProduct>();
|
||||
}
|
||||
343
EditForm.Designer.cs
generated
Normal file
343
EditForm.Designer.cs
generated
Normal file
@ -0,0 +1,343 @@
|
||||
namespace samusev_42
|
||||
{
|
||||
partial class EditForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
productBindingSource = new BindingSource(components);
|
||||
textBox2 = new TextBox();
|
||||
textBox4 = new TextBox();
|
||||
textBox5 = new TextBox();
|
||||
textBox8 = new TextBox();
|
||||
textBox10 = new TextBox();
|
||||
label2 = new Label();
|
||||
label3 = new Label();
|
||||
label4 = new Label();
|
||||
label5 = new Label();
|
||||
label6 = new Label();
|
||||
label7 = new Label();
|
||||
label8 = new Label();
|
||||
label9 = new Label();
|
||||
label10 = new Label();
|
||||
comboBox1 = new ComboBox();
|
||||
productNameBindingSource = new BindingSource(components);
|
||||
comboBox2 = new ComboBox();
|
||||
supplierBindingSource = new BindingSource(components);
|
||||
comboBox3 = new ComboBox();
|
||||
manufacturerBindingSource = new BindingSource(components);
|
||||
comboBox4 = new ComboBox();
|
||||
categoryBindingSource = new BindingSource(components);
|
||||
SaveEditButton = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)productBindingSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)productNameBindingSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)supplierBindingSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)manufacturerBindingSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)categoryBindingSource).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// productBindingSource
|
||||
//
|
||||
productBindingSource.DataSource = typeof(Product);
|
||||
//
|
||||
// textBox2
|
||||
//
|
||||
textBox2.DataBindings.Add(new Binding("DataContext", productBindingSource, "Article", true));
|
||||
textBox2.DataBindings.Add(new Binding("Text", productBindingSource, "Article", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||
textBox2.Location = new Point(152, 32);
|
||||
textBox2.Name = "textBox2";
|
||||
textBox2.Size = new Size(148, 23);
|
||||
textBox2.TabIndex = 1;
|
||||
//
|
||||
// textBox4
|
||||
//
|
||||
textBox4.DataBindings.Add(new Binding("DataContext", productBindingSource, "Count", true));
|
||||
textBox4.DataBindings.Add(new Binding("Text", productBindingSource, "Count", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||
textBox4.Location = new Point(152, 119);
|
||||
textBox4.Name = "textBox4";
|
||||
textBox4.Size = new Size(148, 23);
|
||||
textBox4.TabIndex = 3;
|
||||
//
|
||||
// textBox5
|
||||
//
|
||||
textBox5.DataBindings.Add(new Binding("DataContext", productBindingSource, "Price", true));
|
||||
textBox5.DataBindings.Add(new Binding("Text", productBindingSource, "Price", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||
textBox5.Location = new Point(152, 162);
|
||||
textBox5.Name = "textBox5";
|
||||
textBox5.Size = new Size(148, 23);
|
||||
textBox5.TabIndex = 4;
|
||||
//
|
||||
// textBox8
|
||||
//
|
||||
textBox8.DataBindings.Add(new Binding("DataContext", productBindingSource, "Discount", true));
|
||||
textBox8.DataBindings.Add(new Binding("Text", productBindingSource, "Discount", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||
textBox8.Location = new Point(152, 300);
|
||||
textBox8.Name = "textBox8";
|
||||
textBox8.Size = new Size(148, 23);
|
||||
textBox8.TabIndex = 7;
|
||||
//
|
||||
// textBox10
|
||||
//
|
||||
textBox10.DataBindings.Add(new Binding("DataContext", productBindingSource, "Description", true));
|
||||
textBox10.DataBindings.Add(new Binding("Text", productBindingSource, "Description", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||
textBox10.Location = new Point(152, 389);
|
||||
textBox10.Name = "textBox10";
|
||||
textBox10.Size = new Size(148, 23);
|
||||
textBox10.TabIndex = 9;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
label2.AutoSize = true;
|
||||
label2.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label2.Location = new Point(44, 32);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new Size(80, 20);
|
||||
label2.TabIndex = 12;
|
||||
label2.Text = "Артикул:";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.AutoSize = true;
|
||||
label3.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label3.Location = new Point(41, 75);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new Size(86, 20);
|
||||
label3.TabIndex = 13;
|
||||
label3.Text = "Название:";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
label4.AutoSize = true;
|
||||
label4.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label4.Location = new Point(50, 118);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new Size(69, 20);
|
||||
label4.TabIndex = 14;
|
||||
label4.Text = "Кол-во\u001e:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
label5.AutoSize = true;
|
||||
label5.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label5.Location = new Point(50, 161);
|
||||
label5.Name = "label5";
|
||||
label5.Size = new Size(52, 20);
|
||||
label5.TabIndex = 15;
|
||||
label5.Text = "Цена:";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
label6.AutoSize = true;
|
||||
label6.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label6.Location = new Point(38, 211);
|
||||
label6.Name = "label6";
|
||||
label6.Size = new Size(100, 20);
|
||||
label6.TabIndex = 16;
|
||||
label6.Text = "Поставщик:";
|
||||
//
|
||||
// label7
|
||||
//
|
||||
label7.AutoSize = true;
|
||||
label7.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label7.Location = new Point(12, 252);
|
||||
label7.Name = "label7";
|
||||
label7.Size = new Size(137, 20);
|
||||
label7.TabIndex = 17;
|
||||
label7.Text = "Производитель:";
|
||||
label7.Click += label7_Click;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
label8.AutoSize = true;
|
||||
label8.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label8.Location = new Point(41, 300);
|
||||
label8.Name = "label8";
|
||||
label8.Size = new Size(69, 20);
|
||||
label8.TabIndex = 18;
|
||||
label8.Text = "Скидка:";
|
||||
//
|
||||
// label9
|
||||
//
|
||||
label9.AutoSize = true;
|
||||
label9.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label9.Location = new Point(31, 348);
|
||||
label9.Name = "label9";
|
||||
label9.Size = new Size(92, 20);
|
||||
label9.TabIndex = 19;
|
||||
label9.Text = "Категория:";
|
||||
//
|
||||
// label10
|
||||
//
|
||||
label10.AutoSize = true;
|
||||
label10.Font = new Font("Segoe UI Black", 11.25F, FontStyle.Bold);
|
||||
label10.Location = new Point(37, 389);
|
||||
label10.Name = "label10";
|
||||
label10.Size = new Size(86, 20);
|
||||
label10.TabIndex = 20;
|
||||
label10.Text = "Описание:";
|
||||
//
|
||||
// comboBox1
|
||||
//
|
||||
comboBox1.DataBindings.Add(new Binding("SelectedValue", productBindingSource, "IdProductName", true, DataSourceUpdateMode.OnPropertyChanged));
|
||||
comboBox1.DataSource = productNameBindingSource;
|
||||
comboBox1.DisplayMember = "ProductName1";
|
||||
comboBox1.FormattingEnabled = true;
|
||||
comboBox1.Location = new Point(152, 75);
|
||||
comboBox1.Name = "comboBox1";
|
||||
comboBox1.Size = new Size(148, 23);
|
||||
comboBox1.TabIndex = 23;
|
||||
comboBox1.ValueMember = "IdProductName";
|
||||
//
|
||||
// productNameBindingSource
|
||||
//
|
||||
productNameBindingSource.DataSource = typeof(ProductName);
|
||||
//
|
||||
// comboBox2
|
||||
//
|
||||
comboBox2.DataBindings.Add(new Binding("SelectedValue", productBindingSource, "IdSupplier", true));
|
||||
comboBox2.DataSource = supplierBindingSource;
|
||||
comboBox2.DisplayMember = "SupplierName";
|
||||
comboBox2.FormattingEnabled = true;
|
||||
comboBox2.Location = new Point(152, 208);
|
||||
comboBox2.Name = "comboBox2";
|
||||
comboBox2.Size = new Size(148, 23);
|
||||
comboBox2.TabIndex = 24;
|
||||
comboBox2.ValueMember = "IdSupplier";
|
||||
//
|
||||
// supplierBindingSource
|
||||
//
|
||||
supplierBindingSource.DataSource = typeof(Supplier);
|
||||
//
|
||||
// comboBox3
|
||||
//
|
||||
comboBox3.DataBindings.Add(new Binding("SelectedValue", productBindingSource, "IdManufacturer", true));
|
||||
comboBox3.DataSource = manufacturerBindingSource;
|
||||
comboBox3.DisplayMember = "ManufacturerName";
|
||||
comboBox3.FormattingEnabled = true;
|
||||
comboBox3.Location = new Point(152, 252);
|
||||
comboBox3.Name = "comboBox3";
|
||||
comboBox3.Size = new Size(148, 23);
|
||||
comboBox3.TabIndex = 25;
|
||||
comboBox3.ValueMember = "IdManufacturer";
|
||||
//
|
||||
// manufacturerBindingSource
|
||||
//
|
||||
manufacturerBindingSource.DataSource = typeof(Manufacturer);
|
||||
//
|
||||
// comboBox4
|
||||
//
|
||||
comboBox4.DataBindings.Add(new Binding("SelectedValue", productBindingSource, "IdCategory", true));
|
||||
comboBox4.DataSource = categoryBindingSource;
|
||||
comboBox4.DisplayMember = "CategoryName";
|
||||
comboBox4.FormattingEnabled = true;
|
||||
comboBox4.Location = new Point(152, 345);
|
||||
comboBox4.Name = "comboBox4";
|
||||
comboBox4.Size = new Size(148, 23);
|
||||
comboBox4.TabIndex = 26;
|
||||
comboBox4.ValueMember = "IdCategory";
|
||||
//
|
||||
// categoryBindingSource
|
||||
//
|
||||
categoryBindingSource.DataSource = typeof(Category);
|
||||
//
|
||||
// SaveEditButton
|
||||
//
|
||||
SaveEditButton.BackColor = Color.MistyRose;
|
||||
SaveEditButton.DialogResult = DialogResult.OK;
|
||||
SaveEditButton.Font = new Font("Segoe UI Black", 14.25F, FontStyle.Bold, GraphicsUnit.Point, 204);
|
||||
SaveEditButton.Location = new Point(85, 445);
|
||||
SaveEditButton.Name = "SaveEditButton";
|
||||
SaveEditButton.Size = new Size(160, 46);
|
||||
SaveEditButton.TabIndex = 27;
|
||||
SaveEditButton.Text = "Сохранить";
|
||||
SaveEditButton.UseVisualStyleBackColor = false;
|
||||
SaveEditButton.Click += SaveEditButton_Click;
|
||||
//
|
||||
// EditForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.PeachPuff;
|
||||
ClientSize = new Size(324, 503);
|
||||
Controls.Add(SaveEditButton);
|
||||
Controls.Add(comboBox4);
|
||||
Controls.Add(comboBox3);
|
||||
Controls.Add(comboBox2);
|
||||
Controls.Add(comboBox1);
|
||||
Controls.Add(label10);
|
||||
Controls.Add(label9);
|
||||
Controls.Add(label8);
|
||||
Controls.Add(label7);
|
||||
Controls.Add(label6);
|
||||
Controls.Add(label5);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(textBox10);
|
||||
Controls.Add(textBox8);
|
||||
Controls.Add(textBox5);
|
||||
Controls.Add(textBox4);
|
||||
Controls.Add(textBox2);
|
||||
Name = "EditForm";
|
||||
Text = "EditForm";
|
||||
Load += EditForm_Load;
|
||||
((System.ComponentModel.ISupportInitialize)productBindingSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)productNameBindingSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)supplierBindingSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)manufacturerBindingSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)categoryBindingSource).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
private Label label2;
|
||||
private Label label3;
|
||||
private Label label4;
|
||||
private Label label5;
|
||||
private Label label6;
|
||||
private Label label7;
|
||||
private Label label8;
|
||||
private Label label9;
|
||||
private Label label10;
|
||||
public TextBox textBox2;
|
||||
public TextBox textBox4;
|
||||
public TextBox textBox5;
|
||||
public TextBox textBox8;
|
||||
public TextBox textBox10;
|
||||
public BindingSource productBindingSource;
|
||||
public ComboBox comboBox1;
|
||||
public ComboBox comboBox2;
|
||||
public ComboBox comboBox3;
|
||||
public ComboBox comboBox4;
|
||||
public BindingSource productNameBindingSource;
|
||||
public BindingSource supplierBindingSource;
|
||||
public BindingSource manufacturerBindingSource;
|
||||
public BindingSource categoryBindingSource;
|
||||
public Button SaveEditButton;
|
||||
}
|
||||
}
|
||||
57
EditForm.cs
Normal file
57
EditForm.cs
Normal file
@ -0,0 +1,57 @@
|
||||
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 samusev_42
|
||||
{
|
||||
public partial class EditForm : Form
|
||||
{
|
||||
/// валидация
|
||||
public EditForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
||||
this.textBox5.Validating += textBoxPrice_Validating;
|
||||
}
|
||||
|
||||
private void textBoxPrice_Validating(object sender, CancelEventArgs e)
|
||||
{
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(textBox5.Text) && !decimal.TryParse(textBox5.Text, out _))
|
||||
{
|
||||
MessageBox.Show("В поле 'Цена' можно вводить только числа!", "Ошибка формата",
|
||||
MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
|
||||
textBox5.SelectAll();
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveEditButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void label10_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void EditForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void label7_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
150
EditForm.resx
Normal file
150
EditForm.resx
Normal file
@ -0,0 +1,150 @@
|
||||
<?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>
|
||||
<metadata name="productBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="productNameBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>190, 17</value>
|
||||
</metadata>
|
||||
<metadata name="productNameBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>190, 17</value>
|
||||
</metadata>
|
||||
<metadata name="supplierBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>395, 17</value>
|
||||
</metadata>
|
||||
<metadata name="supplierBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>395, 17</value>
|
||||
</metadata>
|
||||
<metadata name="manufacturerBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>568, 17</value>
|
||||
</metadata>
|
||||
<metadata name="manufacturerBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>568, 17</value>
|
||||
</metadata>
|
||||
<metadata name="categoryBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>771, 17</value>
|
||||
</metadata>
|
||||
<metadata name="categoryBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>771, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>31</value>
|
||||
</metadata>
|
||||
</root>
|
||||
293
Form1.Designer.cs
generated
Normal file
293
Form1.Designer.cs
generated
Normal file
@ -0,0 +1,293 @@
|
||||
namespace samusev_42
|
||||
{
|
||||
partial class Form1
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
bindingSource1 = new BindingSource(components);
|
||||
button1 = new Button();
|
||||
categorySource = new BindingSource(components);
|
||||
dataGridView1 = new DataGridView();
|
||||
idProductDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
|
||||
articleDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
|
||||
idProductNameDataGridViewTextBoxColumn = new DataGridViewComboBoxColumn();
|
||||
product_nameSource = new BindingSource(components);
|
||||
Column2 = new DataGridViewTextBoxColumn();
|
||||
countDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
|
||||
unitDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
|
||||
priceDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
|
||||
idSupplierDataGridViewTextBoxColumn = new DataGridViewComboBoxColumn();
|
||||
SupplierSource = new BindingSource(components);
|
||||
idManufacturerDataGridViewTextBoxColumn = new DataGridViewComboBoxColumn();
|
||||
manufacturerSource = new BindingSource(components);
|
||||
discountDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
|
||||
idCategoryDataGridViewTextBoxColumn = new DataGridViewComboBoxColumn();
|
||||
descriptionDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
|
||||
photoDataGridViewTextBoxColumn = new DataGridViewTextBoxColumn();
|
||||
button2 = new Button();
|
||||
buttonDelete = new Button();
|
||||
buttonAdd = new Button();
|
||||
((System.ComponentModel.ISupportInitialize)bindingSource1).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)categorySource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)product_nameSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)SupplierSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)manufacturerSource).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// bindingSource1
|
||||
//
|
||||
bindingSource1.DataSource = typeof(Product);
|
||||
//
|
||||
// button1
|
||||
//
|
||||
button1.BackColor = Color.MistyRose;
|
||||
button1.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
button1.Location = new Point(128, 810);
|
||||
button1.Name = "button1";
|
||||
button1.Size = new Size(161, 38);
|
||||
button1.TabIndex = 1;
|
||||
button1.Text = "Сохранить";
|
||||
button1.UseVisualStyleBackColor = false;
|
||||
button1.Click += button1_Click;
|
||||
//
|
||||
// categorySource
|
||||
//
|
||||
categorySource.DataSource = typeof(Category);
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
dataGridView1.AutoGenerateColumns = false;
|
||||
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridView1.Columns.AddRange(new DataGridViewColumn[] { idProductDataGridViewTextBoxColumn, articleDataGridViewTextBoxColumn, idProductNameDataGridViewTextBoxColumn, Column2, countDataGridViewTextBoxColumn, unitDataGridViewTextBoxColumn, priceDataGridViewTextBoxColumn, idSupplierDataGridViewTextBoxColumn, idManufacturerDataGridViewTextBoxColumn, discountDataGridViewTextBoxColumn, idCategoryDataGridViewTextBoxColumn, descriptionDataGridViewTextBoxColumn, photoDataGridViewTextBoxColumn });
|
||||
dataGridView1.DataSource = bindingSource1;
|
||||
dataGridView1.Location = new Point(12, 12);
|
||||
dataGridView1.Name = "dataGridView1";
|
||||
dataGridView1.Size = new Size(1055, 779);
|
||||
dataGridView1.TabIndex = 2;
|
||||
//
|
||||
// idProductDataGridViewTextBoxColumn
|
||||
//
|
||||
idProductDataGridViewTextBoxColumn.DataPropertyName = "IdProduct";
|
||||
idProductDataGridViewTextBoxColumn.HeaderText = "№ Товара";
|
||||
idProductDataGridViewTextBoxColumn.Name = "idProductDataGridViewTextBoxColumn";
|
||||
//
|
||||
// articleDataGridViewTextBoxColumn
|
||||
//
|
||||
articleDataGridViewTextBoxColumn.DataPropertyName = "Article";
|
||||
articleDataGridViewTextBoxColumn.HeaderText = "Артикул Товара";
|
||||
articleDataGridViewTextBoxColumn.Name = "articleDataGridViewTextBoxColumn";
|
||||
//
|
||||
// idProductNameDataGridViewTextBoxColumn
|
||||
//
|
||||
idProductNameDataGridViewTextBoxColumn.DataPropertyName = "IdProductName";
|
||||
idProductNameDataGridViewTextBoxColumn.DataSource = product_nameSource;
|
||||
idProductNameDataGridViewTextBoxColumn.DisplayMember = "ProductName1";
|
||||
idProductNameDataGridViewTextBoxColumn.HeaderText = "Название";
|
||||
idProductNameDataGridViewTextBoxColumn.Name = "idProductNameDataGridViewTextBoxColumn";
|
||||
idProductNameDataGridViewTextBoxColumn.Resizable = DataGridViewTriState.True;
|
||||
idProductNameDataGridViewTextBoxColumn.SortMode = DataGridViewColumnSortMode.Automatic;
|
||||
idProductNameDataGridViewTextBoxColumn.ValueMember = "IdProductName";
|
||||
//
|
||||
// product_nameSource
|
||||
//
|
||||
product_nameSource.DataSource = typeof(ProductName);
|
||||
//
|
||||
// Column2
|
||||
//
|
||||
Column2.DataPropertyName = "CountUnit";
|
||||
Column2.HeaderText = "Количество";
|
||||
Column2.Name = "Column2";
|
||||
Column2.ReadOnly = true;
|
||||
//
|
||||
// countDataGridViewTextBoxColumn
|
||||
//
|
||||
countDataGridViewTextBoxColumn.DataPropertyName = "Count";
|
||||
countDataGridViewTextBoxColumn.HeaderText = "Кол-Во";
|
||||
countDataGridViewTextBoxColumn.Name = "countDataGridViewTextBoxColumn";
|
||||
countDataGridViewTextBoxColumn.Visible = false;
|
||||
//
|
||||
// unitDataGridViewTextBoxColumn
|
||||
//
|
||||
unitDataGridViewTextBoxColumn.DataPropertyName = "Unit";
|
||||
unitDataGridViewTextBoxColumn.HeaderText = "Штук";
|
||||
unitDataGridViewTextBoxColumn.Name = "unitDataGridViewTextBoxColumn";
|
||||
unitDataGridViewTextBoxColumn.Visible = false;
|
||||
//
|
||||
// priceDataGridViewTextBoxColumn
|
||||
//
|
||||
priceDataGridViewTextBoxColumn.DataPropertyName = "Price";
|
||||
priceDataGridViewTextBoxColumn.HeaderText = "Цена";
|
||||
priceDataGridViewTextBoxColumn.Name = "priceDataGridViewTextBoxColumn";
|
||||
//
|
||||
// idSupplierDataGridViewTextBoxColumn
|
||||
//
|
||||
idSupplierDataGridViewTextBoxColumn.DataPropertyName = "IdSupplier";
|
||||
idSupplierDataGridViewTextBoxColumn.DataSource = SupplierSource;
|
||||
idSupplierDataGridViewTextBoxColumn.DisplayMember = "SupplierName";
|
||||
idSupplierDataGridViewTextBoxColumn.HeaderText = "Поставщик";
|
||||
idSupplierDataGridViewTextBoxColumn.Name = "idSupplierDataGridViewTextBoxColumn";
|
||||
idSupplierDataGridViewTextBoxColumn.Resizable = DataGridViewTriState.True;
|
||||
idSupplierDataGridViewTextBoxColumn.SortMode = DataGridViewColumnSortMode.Automatic;
|
||||
idSupplierDataGridViewTextBoxColumn.ValueMember = "IdSupplier";
|
||||
//
|
||||
// SupplierSource
|
||||
//
|
||||
SupplierSource.DataSource = typeof(Supplier);
|
||||
//
|
||||
// idManufacturerDataGridViewTextBoxColumn
|
||||
//
|
||||
idManufacturerDataGridViewTextBoxColumn.DataPropertyName = "IdManufacturer";
|
||||
idManufacturerDataGridViewTextBoxColumn.DataSource = manufacturerSource;
|
||||
idManufacturerDataGridViewTextBoxColumn.DisplayMember = "ManufacturerName";
|
||||
idManufacturerDataGridViewTextBoxColumn.HeaderText = "Производитель";
|
||||
idManufacturerDataGridViewTextBoxColumn.Name = "idManufacturerDataGridViewTextBoxColumn";
|
||||
idManufacturerDataGridViewTextBoxColumn.Resizable = DataGridViewTriState.True;
|
||||
idManufacturerDataGridViewTextBoxColumn.SortMode = DataGridViewColumnSortMode.Automatic;
|
||||
idManufacturerDataGridViewTextBoxColumn.ValueMember = "IdManufacturer";
|
||||
//
|
||||
// manufacturerSource
|
||||
//
|
||||
manufacturerSource.DataSource = typeof(Manufacturer);
|
||||
//
|
||||
// discountDataGridViewTextBoxColumn
|
||||
//
|
||||
discountDataGridViewTextBoxColumn.DataPropertyName = "Discount";
|
||||
discountDataGridViewTextBoxColumn.HeaderText = "Скидка (%)";
|
||||
discountDataGridViewTextBoxColumn.Name = "discountDataGridViewTextBoxColumn";
|
||||
//
|
||||
// idCategoryDataGridViewTextBoxColumn
|
||||
//
|
||||
idCategoryDataGridViewTextBoxColumn.DataPropertyName = "IdCategory";
|
||||
idCategoryDataGridViewTextBoxColumn.DataSource = categorySource;
|
||||
idCategoryDataGridViewTextBoxColumn.DisplayMember = "CategoryName";
|
||||
idCategoryDataGridViewTextBoxColumn.HeaderText = "Категория";
|
||||
idCategoryDataGridViewTextBoxColumn.Name = "idCategoryDataGridViewTextBoxColumn";
|
||||
idCategoryDataGridViewTextBoxColumn.Resizable = DataGridViewTriState.True;
|
||||
idCategoryDataGridViewTextBoxColumn.SortMode = DataGridViewColumnSortMode.Automatic;
|
||||
idCategoryDataGridViewTextBoxColumn.ValueMember = "IdCategory";
|
||||
//
|
||||
// descriptionDataGridViewTextBoxColumn
|
||||
//
|
||||
descriptionDataGridViewTextBoxColumn.DataPropertyName = "Description";
|
||||
descriptionDataGridViewTextBoxColumn.HeaderText = "Описание";
|
||||
descriptionDataGridViewTextBoxColumn.Name = "descriptionDataGridViewTextBoxColumn";
|
||||
//
|
||||
// photoDataGridViewTextBoxColumn
|
||||
//
|
||||
photoDataGridViewTextBoxColumn.DataPropertyName = "Photo";
|
||||
photoDataGridViewTextBoxColumn.HeaderText = "Фото";
|
||||
photoDataGridViewTextBoxColumn.Name = "photoDataGridViewTextBoxColumn";
|
||||
photoDataGridViewTextBoxColumn.Visible = false;
|
||||
//
|
||||
// button2
|
||||
//
|
||||
button2.BackColor = Color.MistyRose;
|
||||
button2.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
button2.Location = new Point(360, 810);
|
||||
button2.Name = "button2";
|
||||
button2.Size = new Size(149, 38);
|
||||
button2.TabIndex = 3;
|
||||
button2.Text = "Редактировать";
|
||||
button2.UseVisualStyleBackColor = false;
|
||||
button2.Click += button2_Click;
|
||||
//
|
||||
// buttonDelete
|
||||
//
|
||||
buttonDelete.BackColor = Color.MistyRose;
|
||||
buttonDelete.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
buttonDelete.Location = new Point(588, 810);
|
||||
buttonDelete.Name = "buttonDelete";
|
||||
buttonDelete.Size = new Size(139, 38);
|
||||
buttonDelete.TabIndex = 5;
|
||||
buttonDelete.Text = "Удалить";
|
||||
buttonDelete.UseVisualStyleBackColor = false;
|
||||
buttonDelete.Click += buttonDelete_Click;
|
||||
//
|
||||
// buttonAdd
|
||||
//
|
||||
buttonAdd.BackColor = Color.MistyRose;
|
||||
buttonAdd.DialogResult = DialogResult.OK;
|
||||
buttonAdd.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
buttonAdd.Location = new Point(807, 810);
|
||||
buttonAdd.Name = "buttonAdd";
|
||||
buttonAdd.Size = new Size(131, 39);
|
||||
buttonAdd.TabIndex = 6;
|
||||
buttonAdd.Text = "Добавить";
|
||||
buttonAdd.UseVisualStyleBackColor = false;
|
||||
buttonAdd.Click += buttonAdd_Click_1;
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.PeachPuff;
|
||||
ClientSize = new Size(1099, 861);
|
||||
Controls.Add(buttonAdd);
|
||||
Controls.Add(buttonDelete);
|
||||
Controls.Add(button2);
|
||||
Controls.Add(dataGridView1);
|
||||
Controls.Add(button1);
|
||||
Name = "Form1";
|
||||
Text = "Самусев ИСП-42 №3,4.5";
|
||||
((System.ComponentModel.ISupportInitialize)bindingSource1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)categorySource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)product_nameSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)SupplierSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)manufacturerSource).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private BindingSource bindingSource1;
|
||||
private BindingSource categorySource;
|
||||
private DataGridView dataGridView1;
|
||||
private BindingSource manufacturerSource;
|
||||
private BindingSource product_nameSource;
|
||||
private BindingSource SupplierSource;
|
||||
private DataGridViewTextBoxColumn idProductDataGridViewTextBoxColumn;
|
||||
private DataGridViewTextBoxColumn articleDataGridViewTextBoxColumn;
|
||||
private DataGridViewComboBoxColumn idProductNameDataGridViewTextBoxColumn;
|
||||
private DataGridViewTextBoxColumn Column2;
|
||||
private DataGridViewTextBoxColumn countDataGridViewTextBoxColumn;
|
||||
private DataGridViewTextBoxColumn unitDataGridViewTextBoxColumn;
|
||||
private DataGridViewTextBoxColumn priceDataGridViewTextBoxColumn;
|
||||
private DataGridViewComboBoxColumn idSupplierDataGridViewTextBoxColumn;
|
||||
private DataGridViewComboBoxColumn idManufacturerDataGridViewTextBoxColumn;
|
||||
private DataGridViewTextBoxColumn discountDataGridViewTextBoxColumn;
|
||||
private DataGridViewComboBoxColumn idCategoryDataGridViewTextBoxColumn;
|
||||
private DataGridViewTextBoxColumn descriptionDataGridViewTextBoxColumn;
|
||||
private DataGridViewTextBoxColumn photoDataGridViewTextBoxColumn;
|
||||
public Button button2;
|
||||
public Button button1;
|
||||
private Button buttonDelete;
|
||||
public Button buttonAdd;
|
||||
}
|
||||
}
|
||||
124
Form1.cs
Normal file
124
Form1.cs
Normal file
@ -0,0 +1,124 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
namespace samusev_42
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
Ispr2522SamusevOvLazarev2Context context;
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
/// ïðè ñîçäàíèè çàïèñè - îíà íå íà÷èíàåòñÿ ñ 0 è íå ëîìàåòñÿ
|
||||
dataGridView1.AllowUserToAddRows = false;
|
||||
|
||||
dataGridView1.DataError += (s, e) => {
|
||||
MessageBox.Show("Îøèáêà ôîðìàòà äàííûõ! Ïðîâåðüòå, ÷òî â ÷èñëîâûå ïîëÿ íå ââåäåíû áóêâû.",
|
||||
"Îøèáêà ââîäà", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
e.ThrowException = false;
|
||||
};
|
||||
|
||||
dataGridView1.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
}
|
||||
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
context = new Ispr2522SamusevOvLazarev2Context();
|
||||
context.Products.Include(x => x.IdCategoryNavigation).Load();
|
||||
context.Products.Include(x => x.IdManufacturerNavigation).Load();
|
||||
context.Products.Include(x => x.IdProductNameNavigation).Load();
|
||||
context.Products.Include(x => x.IdSupplierNavigation).Load();
|
||||
context.Categories.Load();
|
||||
context.Manufacturers.Load();
|
||||
context.Database.EnsureCreated();
|
||||
bindingSource1.DataSource = context.Products.Local.ToBindingList();
|
||||
categorySource.DataSource = context.Categories.Local.ToBindingList();
|
||||
manufacturerSource.DataSource = context.Manufacturers.Local.ToBindingList();
|
||||
product_nameSource.DataSource = context.ProductNames.Local.ToBindingList();
|
||||
SupplierSource.DataSource = context.Suppliers.Local.ToBindingList();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
context.SaveChanges();
|
||||
dataGridView1.Refresh();
|
||||
}
|
||||
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (bindingSource1.Current == null) return;
|
||||
var form = new EditForm();
|
||||
form.categoryBindingSource.DataSource = categorySource.DataSource;
|
||||
form.manufacturerBindingSource.DataSource = manufacturerSource.DataSource;
|
||||
form.productNameBindingSource.DataSource = product_nameSource.DataSource;
|
||||
form.supplierBindingSource.DataSource = SupplierSource.DataSource;
|
||||
form.productBindingSource.DataSource = bindingSource1.Current;
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
bindingSource1.EndEdit();
|
||||
context.SaveChanges();
|
||||
dataGridView1.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveEditButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
context.SaveChanges();
|
||||
dataGridView1.Refresh();
|
||||
}
|
||||
|
||||
private void buttonDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
bindingSource1.RemoveCurrent();
|
||||
context.SaveChanges();
|
||||
dataGridView1.Refresh();
|
||||
}
|
||||
/// âàëèäàöèÿ + çàïîëíåíèå êîìáîáîêñîâ è òåêñòáîêñîâ ÷òîáû íå áûëî îøèáêè null
|
||||
private void buttonAdd_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
var newProduct = new Product();
|
||||
newProduct.Article = "";
|
||||
newProduct.Unit = "øò.";
|
||||
newProduct.Description = "-";
|
||||
newProduct.Photo = "";
|
||||
newProduct.Price = 0;
|
||||
newProduct.Count = 0;
|
||||
newProduct.Discount = 0;
|
||||
|
||||
var form = new EditForm();
|
||||
form.categoryBindingSource.DataSource = categorySource;
|
||||
form.manufacturerBindingSource.DataSource = manufacturerSource;
|
||||
form.productNameBindingSource.DataSource = product_nameSource;
|
||||
form.supplierBindingSource.DataSource = SupplierSource;
|
||||
form.productBindingSource.DataSource = newProduct;
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (newProduct.IdProductName <= 0)
|
||||
throw new System.ComponentModel.DataAnnotations.ValidationException("Âûáåðèòå íàçâàíèå òîâàðà!");
|
||||
if (string.IsNullOrWhiteSpace(newProduct.Article))
|
||||
throw new System.ComponentModel.DataAnnotations.ValidationException("Àðòèêóë íå ìîæåò áûòü ïóñòûì!");
|
||||
if (newProduct.Price < 0)
|
||||
throw new System.ComponentModel.DataAnnotations.ValidationException("Öåíà íå ìîæåò áûòü îòðèöàòåëüíîé!");
|
||||
|
||||
context.Products.Add(newProduct);
|
||||
context.SaveChanges();
|
||||
bindingSource1.DataSource = context.Products.Local.ToBindingList();
|
||||
dataGridView1.Refresh();
|
||||
MessageBox.Show("Äàííûå óñïåøíî ñîõðàíåíû â áàçó!");
|
||||
}
|
||||
catch (System.ComponentModel.DataAnnotations.ValidationException valEx)
|
||||
{
|
||||
MessageBox.Show(valEx.Message, "Âíèìàíèå", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string inner = ex.InnerException?.Message ?? ex.Message;
|
||||
MessageBox.Show($"Îøèáêà ÁÄ: {inner}");
|
||||
context.Entry(newProduct).State = EntityState.Detached;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
141
Form1.resx
Normal file
141
Form1.resx
Normal file
@ -0,0 +1,141 @@
|
||||
<?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>
|
||||
<metadata name="bindingSource1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="categorySource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>154, 17</value>
|
||||
</metadata>
|
||||
<metadata name="product_nameSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>452, 17</value>
|
||||
</metadata>
|
||||
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="SupplierSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>619, 17</value>
|
||||
</metadata>
|
||||
<metadata name="manufacturerSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>290, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>94</value>
|
||||
</metadata>
|
||||
</root>
|
||||
311
Ispr2522SamusevOvLazarev2Context.cs
Normal file
311
Ispr2522SamusevOvLazarev2Context.cs
Normal file
@ -0,0 +1,311 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pomelo.EntityFrameworkCore.MySql.Scaffolding.Internal;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Ispr2522SamusevOvLazarev2Context : DbContext
|
||||
{
|
||||
public Ispr2522SamusevOvLazarev2Context()
|
||||
{
|
||||
}
|
||||
|
||||
public Ispr2522SamusevOvLazarev2Context(DbContextOptions<Ispr2522SamusevOvLazarev2Context> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<Category> Categories { get; set; }
|
||||
|
||||
public virtual DbSet<Delivery> Deliveries { get; set; }
|
||||
|
||||
public virtual DbSet<Manufacturer> Manufacturers { get; set; }
|
||||
|
||||
public virtual DbSet<Name> Names { get; set; }
|
||||
|
||||
public virtual DbSet<OrdersProduct> OrdersProducts { get; set; }
|
||||
|
||||
public virtual DbSet<PickUpPoint> PickUpPoints { get; set; }
|
||||
|
||||
public virtual DbSet<Product> Products { get; set; }
|
||||
|
||||
public virtual DbSet<ProductName> ProductNames { get; set; }
|
||||
|
||||
public virtual DbSet<Role> Roles { get; set; }
|
||||
|
||||
public virtual DbSet<Status> Statuses { get; set; }
|
||||
|
||||
public virtual DbSet<Supplier> Suppliers { get; set; }
|
||||
|
||||
public virtual DbSet<User> Users { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263.
|
||||
=> optionsBuilder.UseMySql("server=cfif31.ru;username=ISPr25-22_SamusevOV;password=ISPr25-22_SamusevOV;database=ISPr25-22_SamusevOV_Lazarev2", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.45-mysql"));
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder
|
||||
.UseCollation("utf8mb4_0900_ai_ci")
|
||||
.HasCharSet("utf8mb4");
|
||||
|
||||
modelBuilder.Entity<Category>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdCategory).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("category");
|
||||
|
||||
entity.Property(e => e.IdCategory).HasColumnName("id_category");
|
||||
entity.Property(e => e.CategoryName)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("category_name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Delivery>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdDelivery).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("delivery");
|
||||
|
||||
entity.HasIndex(e => e.IdPickUpPoint, "fk_delivery_pick-up point_idx");
|
||||
|
||||
entity.HasIndex(e => e.IdStatus, "fk_delivery_status_idx");
|
||||
|
||||
entity.HasIndex(e => e.IdUser, "fk_delivery_user_idx");
|
||||
|
||||
entity.Property(e => e.IdDelivery).HasColumnName("id_delivery");
|
||||
entity.Property(e => e.Code).HasColumnName("code");
|
||||
entity.Property(e => e.DateDelivery)
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("date_delivery");
|
||||
entity.Property(e => e.DateOrder)
|
||||
.HasColumnType("datetime")
|
||||
.HasColumnName("date_order");
|
||||
entity.Property(e => e.IdPickUpPoint).HasColumnName("id_pick-up point");
|
||||
entity.Property(e => e.IdStatus).HasColumnName("id_status");
|
||||
entity.Property(e => e.IdUser).HasColumnName("id_user");
|
||||
|
||||
entity.HasOne(d => d.IdPickUpPointNavigation).WithMany(p => p.Deliveries)
|
||||
.HasForeignKey(d => d.IdPickUpPoint)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_delivery_pick-up point");
|
||||
|
||||
entity.HasOne(d => d.IdStatusNavigation).WithMany(p => p.Deliveries)
|
||||
.HasForeignKey(d => d.IdStatus)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_delivery_status");
|
||||
|
||||
entity.HasOne(d => d.IdUserNavigation).WithMany(p => p.Deliveries)
|
||||
.HasForeignKey(d => d.IdUser)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_delivery_user");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Manufacturer>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdManufacturer).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("manufacturer");
|
||||
|
||||
entity.Property(e => e.IdManufacturer).HasColumnName("id_manufacturer");
|
||||
entity.Property(e => e.ManufacturerName)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("manufacturer_name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Name>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdName).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("name");
|
||||
|
||||
entity.HasIndex(e => e.IdUser, "id_name_user_idx");
|
||||
|
||||
entity.Property(e => e.IdName).HasColumnName("id_name");
|
||||
entity.Property(e => e.IdUser).HasColumnName("id_user");
|
||||
entity.Property(e => e.NameFio)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("name_fio");
|
||||
|
||||
entity.HasOne(d => d.IdUserNavigation).WithMany(p => p.Names)
|
||||
.HasForeignKey(d => d.IdUser)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("id_name_user");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<OrdersProduct>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdOrdersProducts).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("orders_products");
|
||||
|
||||
entity.HasIndex(e => e.IdDelivery, "fk_order_products_delivery_idx");
|
||||
|
||||
entity.HasIndex(e => e.IdProduct, "fk_order_products_product_idx");
|
||||
|
||||
entity.Property(e => e.IdOrdersProducts).HasColumnName("id_orders_products");
|
||||
entity.Property(e => e.Count).HasColumnName("count");
|
||||
entity.Property(e => e.IdDelivery).HasColumnName("id_delivery");
|
||||
entity.Property(e => e.IdProduct).HasColumnName("id_product");
|
||||
|
||||
entity.HasOne(d => d.IdDeliveryNavigation).WithMany(p => p.OrdersProducts)
|
||||
.HasForeignKey(d => d.IdDelivery)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_order_products_delivery");
|
||||
|
||||
entity.HasOne(d => d.IdProductNavigation).WithMany(p => p.OrdersProducts)
|
||||
.HasForeignKey(d => d.IdProduct)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_order_products_product");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<PickUpPoint>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdPickUpPoint).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("pick-up point");
|
||||
|
||||
entity.Property(e => e.IdPickUpPoint).HasColumnName("id_pick-up point");
|
||||
entity.Property(e => e.Adress)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("adress");
|
||||
entity.Property(e => e.Index)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("index");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Product>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdProduct).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("product");
|
||||
|
||||
entity.HasIndex(e => e.IdCategory, "fk_product_category_idx");
|
||||
|
||||
entity.HasIndex(e => e.IdManufacturer, "fk_product_manufacturer_idx");
|
||||
|
||||
entity.HasIndex(e => e.IdProductName, "fk_product_product_name_idx");
|
||||
|
||||
entity.HasIndex(e => e.IdSupplier, "fk_product_supplier_idx");
|
||||
|
||||
entity.Property(e => e.IdProduct).HasColumnName("id_product");
|
||||
entity.Property(e => e.Article)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("article");
|
||||
entity.Property(e => e.Count).HasColumnName("count");
|
||||
entity.Property(e => e.Description)
|
||||
.HasColumnType("text")
|
||||
.HasColumnName("description");
|
||||
entity.Property(e => e.Discount).HasColumnName("discount");
|
||||
entity.Property(e => e.IdCategory).HasColumnName("id_category");
|
||||
entity.Property(e => e.IdManufacturer).HasColumnName("id_manufacturer");
|
||||
entity.Property(e => e.IdProductName).HasColumnName("id_product name");
|
||||
entity.Property(e => e.IdSupplier).HasColumnName("id_supplier");
|
||||
entity.Property(e => e.Photo)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("photo");
|
||||
entity.Property(e => e.Price)
|
||||
.HasPrecision(5)
|
||||
.HasColumnName("price");
|
||||
entity.Property(e => e.Unit)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("unit");
|
||||
|
||||
entity.HasOne(d => d.IdCategoryNavigation).WithMany(p => p.Products)
|
||||
.HasForeignKey(d => d.IdCategory)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_product_category");
|
||||
|
||||
entity.HasOne(d => d.IdManufacturerNavigation).WithMany(p => p.Products)
|
||||
.HasForeignKey(d => d.IdManufacturer)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_product_manufacturer");
|
||||
|
||||
entity.HasOne(d => d.IdProductNameNavigation).WithMany(p => p.Products)
|
||||
.HasForeignKey(d => d.IdProductName)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_product_product_name");
|
||||
|
||||
entity.HasOne(d => d.IdSupplierNavigation).WithMany(p => p.Products)
|
||||
.HasForeignKey(d => d.IdSupplier)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_product_supplier");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<ProductName>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdProductName).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("product name");
|
||||
|
||||
entity.Property(e => e.IdProductName).HasColumnName("id_product name");
|
||||
entity.Property(e => e.ProductName1)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("product name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Role>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdRole).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("role");
|
||||
|
||||
entity.Property(e => e.IdRole).HasColumnName("id_role");
|
||||
entity.Property(e => e.RoleName)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("role_name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Status>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdStatus).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("status");
|
||||
|
||||
entity.Property(e => e.IdStatus).HasColumnName("id_status");
|
||||
entity.Property(e => e.StatusName)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("status_name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Supplier>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdSupplier).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("supplier");
|
||||
|
||||
entity.Property(e => e.IdSupplier).HasColumnName("id_supplier");
|
||||
entity.Property(e => e.SupplierName)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("supplier_name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<User>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.IdUser).HasName("PRIMARY");
|
||||
|
||||
entity.ToTable("user");
|
||||
|
||||
entity.HasIndex(e => e.IdRole, "fk_user_role_idx");
|
||||
|
||||
entity.Property(e => e.IdUser).HasColumnName("id_user");
|
||||
entity.Property(e => e.IdRole).HasColumnName("id_role");
|
||||
entity.Property(e => e.Login)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("login");
|
||||
entity.Property(e => e.Password)
|
||||
.HasMaxLength(45)
|
||||
.HasColumnName("password");
|
||||
|
||||
entity.HasOne(d => d.IdRoleNavigation).WithMany(p => p.Users)
|
||||
.HasForeignKey(d => d.IdRole)
|
||||
.OnDelete(DeleteBehavior.ClientSetNull)
|
||||
.HasConstraintName("fk_user_role");
|
||||
});
|
||||
|
||||
OnModelCreatingPartial(modelBuilder);
|
||||
}
|
||||
|
||||
partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
|
||||
}
|
||||
161
MainCardForm.Designer.cs
generated
Normal file
161
MainCardForm.Designer.cs
generated
Normal file
@ -0,0 +1,161 @@
|
||||
namespace samusev_42
|
||||
{
|
||||
partial class MainCardForm
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
components = new System.ComponentModel.Container();
|
||||
flowLayoutPanel1 = new FlowLayoutPanel();
|
||||
SaveCardButton = new Button();
|
||||
CardEditButton = new Button();
|
||||
CardDeleteButton = new Button();
|
||||
CardAddButton = new Button();
|
||||
productBindingSource = new BindingSource(components);
|
||||
categorySource = new BindingSource(components);
|
||||
manufacturerSource = new BindingSource(components);
|
||||
product_nameSource = new BindingSource(components);
|
||||
SupplierSource = new BindingSource(components);
|
||||
((System.ComponentModel.ISupportInitialize)productBindingSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)categorySource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)manufacturerSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)product_nameSource).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)SupplierSource).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// flowLayoutPanel1
|
||||
//
|
||||
flowLayoutPanel1.AutoScroll = true;
|
||||
flowLayoutPanel1.FlowDirection = FlowDirection.TopDown;
|
||||
flowLayoutPanel1.Location = new Point(33, 106);
|
||||
flowLayoutPanel1.Name = "flowLayoutPanel1";
|
||||
flowLayoutPanel1.Size = new Size(726, 608);
|
||||
flowLayoutPanel1.TabIndex = 0;
|
||||
flowLayoutPanel1.WrapContents = false;
|
||||
//
|
||||
// SaveCardButton
|
||||
//
|
||||
SaveCardButton.BackColor = Color.Cornsilk;
|
||||
SaveCardButton.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
SaveCardButton.Location = new Point(69, 25);
|
||||
SaveCardButton.Name = "SaveCardButton";
|
||||
SaveCardButton.Size = new Size(114, 36);
|
||||
SaveCardButton.TabIndex = 1;
|
||||
SaveCardButton.Text = "Сохранить";
|
||||
SaveCardButton.UseVisualStyleBackColor = false;
|
||||
SaveCardButton.Click += SaveCardButton_Click;
|
||||
//
|
||||
// CardEditButton
|
||||
//
|
||||
CardEditButton.BackColor = Color.Cornsilk;
|
||||
CardEditButton.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
CardEditButton.Location = new Point(242, 25);
|
||||
CardEditButton.Name = "CardEditButton";
|
||||
CardEditButton.Size = new Size(143, 36);
|
||||
CardEditButton.TabIndex = 2;
|
||||
CardEditButton.Text = "Редактировать";
|
||||
CardEditButton.UseVisualStyleBackColor = false;
|
||||
CardEditButton.Click += CardEditButton_Click_1;
|
||||
//
|
||||
// CardDeleteButton
|
||||
//
|
||||
CardDeleteButton.BackColor = Color.Cornsilk;
|
||||
CardDeleteButton.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
CardDeleteButton.Location = new Point(437, 25);
|
||||
CardDeleteButton.Name = "CardDeleteButton";
|
||||
CardDeleteButton.Size = new Size(119, 36);
|
||||
CardDeleteButton.TabIndex = 3;
|
||||
CardDeleteButton.Text = "Удалить";
|
||||
CardDeleteButton.UseVisualStyleBackColor = false;
|
||||
CardDeleteButton.Click += CardDeleteButton_Click_1;
|
||||
//
|
||||
// CardAddButton
|
||||
//
|
||||
CardAddButton.BackColor = Color.Cornsilk;
|
||||
CardAddButton.Font = new Font("Segoe UI", 12F, FontStyle.Bold);
|
||||
CardAddButton.Location = new Point(603, 25);
|
||||
CardAddButton.Name = "CardAddButton";
|
||||
CardAddButton.Size = new Size(123, 36);
|
||||
CardAddButton.TabIndex = 4;
|
||||
CardAddButton.Text = "Добавить";
|
||||
CardAddButton.UseVisualStyleBackColor = false;
|
||||
CardAddButton.Click += CardAddButton_Click_1;
|
||||
//
|
||||
// productBindingSource
|
||||
//
|
||||
productBindingSource.DataSource = typeof(Product);
|
||||
//
|
||||
// categorySource
|
||||
//
|
||||
categorySource.DataSource = typeof(Category);
|
||||
//
|
||||
// manufacturerSource
|
||||
//
|
||||
manufacturerSource.DataSource = typeof(Manufacturer);
|
||||
//
|
||||
// product_nameSource
|
||||
//
|
||||
product_nameSource.DataSource = typeof(ProductName);
|
||||
//
|
||||
// SupplierSource
|
||||
//
|
||||
SupplierSource.DataSource = typeof(Supplier);
|
||||
//
|
||||
// MainCardForm
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
BackColor = Color.MistyRose;
|
||||
ClientSize = new Size(800, 748);
|
||||
Controls.Add(CardAddButton);
|
||||
Controls.Add(CardDeleteButton);
|
||||
Controls.Add(CardEditButton);
|
||||
Controls.Add(SaveCardButton);
|
||||
Controls.Add(flowLayoutPanel1);
|
||||
Name = "MainCardForm";
|
||||
Text = "Форма-Карточка";
|
||||
((System.ComponentModel.ISupportInitialize)productBindingSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)categorySource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)manufacturerSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)product_nameSource).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)SupplierSource).EndInit();
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private FlowLayoutPanel flowLayoutPanel1;
|
||||
public BindingSource productBindingSource;
|
||||
public Button SaveCardButton;
|
||||
public Button CardEditButton;
|
||||
public Button CardDeleteButton;
|
||||
public Button CardAddButton;
|
||||
public BindingSource categorySource;
|
||||
public BindingSource manufacturerSource;
|
||||
public BindingSource product_nameSource;
|
||||
public BindingSource SupplierSource;
|
||||
}
|
||||
}
|
||||
131
MainCardForm.cs
Normal file
131
MainCardForm.cs
Normal file
@ -0,0 +1,131 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace samusev_42
|
||||
{
|
||||
public partial class MainCardForm : Form
|
||||
{
|
||||
Ispr2522SamusevOvLazarev2Context context;
|
||||
|
||||
public MainCardForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnLoad(EventArgs e)
|
||||
{
|
||||
base.OnLoad(e);
|
||||
context = new Ispr2522SamusevOvLazarev2Context();
|
||||
|
||||
context.Products.Include(x => x.IdCategoryNavigation).Load();
|
||||
context.Products.Include(x => x.IdManufacturerNavigation).Load();
|
||||
context.Products.Include(x => x.IdProductNameNavigation).Load();
|
||||
context.Products.Include(x => x.IdSupplierNavigation).Load();
|
||||
context.Categories.Load();
|
||||
context.Manufacturers.Load();
|
||||
context.ProductNames.Load();
|
||||
context.Suppliers.Load();
|
||||
|
||||
productBindingSource.DataSource = context.Products.Local.ToBindingList();
|
||||
categorySource.DataSource = context.Categories.Local.ToBindingList();
|
||||
manufacturerSource.DataSource = context.Manufacturers.Local.ToBindingList();
|
||||
product_nameSource.DataSource = context.ProductNames.Local.ToBindingList();
|
||||
SupplierSource.DataSource = context.Suppliers.Local.ToBindingList();
|
||||
|
||||
Populate();
|
||||
}
|
||||
|
||||
public void Populate()
|
||||
{
|
||||
flowLayoutPanel1.Controls.Clear();
|
||||
foreach (var item in productBindingSource)
|
||||
{
|
||||
if (item is Product p)
|
||||
{
|
||||
CardForm card = new CardForm(p);
|
||||
card.Click += (s, ev) => { productBindingSource.Position = productBindingSource.IndexOf(p); };
|
||||
flowLayoutPanel1.Controls.Add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SaveCardButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void CardEditButton_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
if (productBindingSource.Current == null) return;
|
||||
|
||||
var form = new EditForm();
|
||||
form.categoryBindingSource.DataSource = categorySource.DataSource;
|
||||
form.manufacturerBindingSource.DataSource = manufacturerSource.DataSource;
|
||||
form.productNameBindingSource.DataSource = product_nameSource.DataSource;
|
||||
form.supplierBindingSource.DataSource = SupplierSource.DataSource;
|
||||
form.productBindingSource.DataSource = productBindingSource.Current;
|
||||
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
productBindingSource.EndEdit();
|
||||
context.SaveChanges();
|
||||
Populate();
|
||||
}
|
||||
}
|
||||
|
||||
private void CardDeleteButton_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
if (productBindingSource.Current == null) return;
|
||||
|
||||
var result = MessageBox.Show("Удалить этот товар?", "Подтверждение", MessageBoxButtons.YesNo);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
productBindingSource.RemoveCurrent();
|
||||
context.SaveChanges();
|
||||
Populate();
|
||||
}
|
||||
}
|
||||
|
||||
private void CardAddButton_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
var newProduct = new Product();
|
||||
newProduct.Article = "";
|
||||
newProduct.Unit = "шт.";
|
||||
newProduct.Description = "-";
|
||||
newProduct.Photo = "";
|
||||
newProduct.Price = 0;
|
||||
newProduct.Count = 0;
|
||||
newProduct.Discount = 0;
|
||||
|
||||
var form = new EditForm();
|
||||
form.categoryBindingSource.DataSource = categorySource;
|
||||
form.manufacturerBindingSource.DataSource = manufacturerSource;
|
||||
form.productNameBindingSource.DataSource = product_nameSource;
|
||||
form.supplierBindingSource.DataSource = SupplierSource;
|
||||
form.productBindingSource.DataSource = newProduct;
|
||||
|
||||
if (form.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (newProduct.IdProductName <= 0)
|
||||
throw new System.ComponentModel.DataAnnotations.ValidationException("Выберите название товара!");
|
||||
|
||||
context.Products.Add(newProduct);
|
||||
context.SaveChanges();
|
||||
|
||||
Populate();
|
||||
MessageBox.Show("Товар добавлен!");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.Message);
|
||||
context.Entry(newProduct).State = EntityState.Detached;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
135
MainCardForm.resx
Normal file
135
MainCardForm.resx
Normal file
@ -0,0 +1,135 @@
|
||||
<?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>
|
||||
<metadata name="productBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="categorySource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>190, 17</value>
|
||||
</metadata>
|
||||
<metadata name="manufacturerSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>315, 20</value>
|
||||
</metadata>
|
||||
<metadata name="product_nameSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>459, 18</value>
|
||||
</metadata>
|
||||
<metadata name="SupplierSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>618, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
13
Manufacturer.cs
Normal file
13
Manufacturer.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Manufacturer
|
||||
{
|
||||
public int IdManufacturer { get; set; }
|
||||
|
||||
public string ManufacturerName { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
|
||||
}
|
||||
15
Name.cs
Normal file
15
Name.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Name
|
||||
{
|
||||
public int IdName { get; set; }
|
||||
|
||||
public string NameFio { get; set; } = null!;
|
||||
|
||||
public int IdUser { get; set; }
|
||||
|
||||
public virtual User IdUserNavigation { get; set; } = null!;
|
||||
}
|
||||
19
OrdersProduct.cs
Normal file
19
OrdersProduct.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class OrdersProduct
|
||||
{
|
||||
public int IdOrdersProducts { get; set; }
|
||||
|
||||
public int IdDelivery { get; set; }
|
||||
|
||||
public int IdProduct { get; set; }
|
||||
|
||||
public int Count { get; set; }
|
||||
|
||||
public virtual Delivery IdDeliveryNavigation { get; set; } = null!;
|
||||
|
||||
public virtual Product IdProductNavigation { get; set; } = null!;
|
||||
}
|
||||
15
PickUpPoint.cs
Normal file
15
PickUpPoint.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class PickUpPoint
|
||||
{
|
||||
public int IdPickUpPoint { get; set; }
|
||||
|
||||
public string? Adress { get; set; }
|
||||
|
||||
public string Index { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Delivery> Deliveries { get; set; } = new List<Delivery>();
|
||||
}
|
||||
73
Product.cs
Normal file
73
Product.cs
Normal file
@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Product : IEditableObject
|
||||
{
|
||||
private Ispr2522SamusevOvLazarev2Context context;
|
||||
|
||||
public int IdProduct { get; set; }
|
||||
public string Article { get; set; } = null!;
|
||||
public int IdProductName { get; set; }
|
||||
public string Unit { get; set; } = null!;
|
||||
public decimal Price { get; set; }
|
||||
public int IdSupplier { get; set; }
|
||||
public int IdManufacturer { get; set; }
|
||||
public int IdCategory { get; set; }
|
||||
public int Discount { get; set; }
|
||||
public int Count { get; set; }
|
||||
public string Description { get; set; } = null!;
|
||||
public string Photo { get; set; } = null!;
|
||||
|
||||
public virtual Category IdCategoryNavigation { get; set; } = null!;
|
||||
public virtual Manufacturer IdManufacturerNavigation { get; set; } = null!;
|
||||
public virtual ProductName IdProductNameNavigation { get; set; } = null!;
|
||||
public virtual Supplier IdSupplierNavigation { get; set; } = null!;
|
||||
public virtual ICollection<OrdersProduct> OrdersProducts { get; set; } = new List<OrdersProduct>();
|
||||
|
||||
// Реализация валидации IEditableObject
|
||||
|
||||
public void BeginEdit()
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
context = new Ispr2522SamusevOvLazarev2Context();
|
||||
context.Products.Attach(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void CancelEdit()
|
||||
{
|
||||
if (context != null)
|
||||
{
|
||||
var entry = context.Entry(this);
|
||||
if (entry.State == EntityState.Modified)
|
||||
{
|
||||
entry.Reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void EndEdit()
|
||||
{
|
||||
// ВАЛИДАЦИЯ
|
||||
if (string.IsNullOrWhiteSpace(this.Article))
|
||||
{
|
||||
throw new ValidationException("Артикул не может быть пустым!");
|
||||
}
|
||||
|
||||
if (this.Price < 0)
|
||||
{
|
||||
throw new ValidationException("Цена не может быть отрицательной!");
|
||||
}
|
||||
|
||||
if (context != null)
|
||||
{
|
||||
context.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
13
ProductName.cs
Normal file
13
ProductName.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class ProductName
|
||||
{
|
||||
public int IdProductName { get; set; }
|
||||
|
||||
public string ProductName1 { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
|
||||
}
|
||||
17
Program.cs
Normal file
17
Program.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace samusev_42
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new MainCardForm());
|
||||
}
|
||||
}
|
||||
}
|
||||
10
Properties/DataSources/Category.datasource
Normal file
10
Properties/DataSources/Category.datasource
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="Category" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>samusev_42.Category, samusev-42, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
10
Properties/DataSources/Manufacturer.datasource
Normal file
10
Properties/DataSources/Manufacturer.datasource
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="Manufacturer" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>samusev_42.Manufacturer, samusev-42, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
10
Properties/DataSources/OrdersProduct.datasource
Normal file
10
Properties/DataSources/OrdersProduct.datasource
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="OrdersProduct" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>samusev_42.OrdersProduct, samusev-42, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
10
Properties/DataSources/Product.datasource
Normal file
10
Properties/DataSources/Product.datasource
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="Product" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>samusev_42.Product, samusev-42, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
10
Properties/DataSources/ProductName.datasource
Normal file
10
Properties/DataSources/ProductName.datasource
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="ProductName" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>samusev_42.ProductName, samusev-42, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
10
Properties/DataSources/Supplier.datasource
Normal file
10
Properties/DataSources/Supplier.datasource
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
This file is automatically generated by Visual Studio. It is
|
||||
used to store generic object data source configuration information.
|
||||
Renaming the file extension or editing the content of this file may
|
||||
cause the file to be unrecognizable by the program.
|
||||
-->
|
||||
<GenericObjectDataSource DisplayName="Supplier" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
|
||||
<TypeInfo>samusev_42.Supplier, samusev-42, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
|
||||
</GenericObjectDataSource>
|
||||
63
Properties/Resources.Designer.cs
generated
Normal file
63
Properties/Resources.Designer.cs
generated
Normal file
@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace samusev_42.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||
/// </summary>
|
||||
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||
// с помощью такого средства, как ResGen или Visual Studio.
|
||||
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||
// с параметром /str или перестройте свой проект VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.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 (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("samusev_42.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
Properties/Resources.resx
Normal file
120
Properties/Resources.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>
|
||||
13
Role.cs
Normal file
13
Role.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Role
|
||||
{
|
||||
public int IdRole { get; set; }
|
||||
|
||||
public string RoleName { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<User> Users { get; set; } = new List<User>();
|
||||
}
|
||||
13
Status.cs
Normal file
13
Status.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Status
|
||||
{
|
||||
public int IdStatus { get; set; }
|
||||
|
||||
public string StatusName { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Delivery> Deliveries { get; set; } = new List<Delivery>();
|
||||
}
|
||||
13
Supplier.cs
Normal file
13
Supplier.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class Supplier
|
||||
{
|
||||
public int IdSupplier { get; set; }
|
||||
|
||||
public string SupplierName { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Product> Products { get; set; } = new List<Product>();
|
||||
}
|
||||
21
User.cs
Normal file
21
User.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace samusev_42;
|
||||
|
||||
public partial class User
|
||||
{
|
||||
public int IdUser { get; set; }
|
||||
|
||||
public string Login { get; set; } = null!;
|
||||
|
||||
public string Password { get; set; } = null!;
|
||||
|
||||
public int IdRole { get; set; }
|
||||
|
||||
public virtual ICollection<Delivery> Deliveries { get; set; } = new List<Delivery>();
|
||||
|
||||
public virtual Role IdRoleNavigation { get; set; } = null!;
|
||||
|
||||
public virtual ICollection<Name> Names { get; set; } = new List<Name>();
|
||||
}
|
||||
39
samusev-42.csproj
Normal file
39
samusev-42.csproj
Normal file
@ -0,0 +1,39 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<RootNamespace>samusev_42</RootNamespace>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
25
samusev-42.sln
Normal file
25
samusev-42.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.13.35931.197 d17.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "samusev-42", "samusev-42.csproj", "{ED29084E-1A2F-43BE-ADD8-A4AE71F92783}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{ED29084E-1A2F-43BE-ADD8-A4AE71F92783}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{ED29084E-1A2F-43BE-ADD8-A4AE71F92783}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{ED29084E-1A2F-43BE-ADD8-A4AE71F92783}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{ED29084E-1A2F-43BE-ADD8-A4AE71F92783}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {2743F97A-92F1-4906-80DB-89C4A8873133}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Loading…
Reference in New Issue
Block a user