Compare commits

..

No commits in common. "Lab1" and "main" have entirely different histories.
Lab1 ... main

65 changed files with 77 additions and 4609 deletions

View File

@ -1,36 +0,0 @@
using RealEstateTransactions.Entities.Enums;
namespace RealEstateTransactions.Entities
{
public class Apartment
{
public int Id { get; private set; }
public AgencyType AgencyId { get; private set; }
public FormFactorType FormFactorId { get; private set; }
public float Area { get; private set; }
public float PricePerSM { get; private set; }
public float BasePrice { get; private set; }
public float DesiredPrice { get; private set; }
public static Apartment CreateApartment(int id, AgencyType agencyId, FormFactorType formFactorId, float area,
float pricePerSM, float basePrice, float desiredPrice)
{
return new Apartment
{
Id = id,
AgencyId = agencyId,
FormFactorId = formFactorId,
Area = area,
PricePerSM = pricePerSM,
BasePrice = basePrice,
DesiredPrice = desiredPrice
};
}
}
}

View File

@ -1,24 +0,0 @@
namespace RealEstateTransactions.Entities
{
public class Buyer
{
public int Id { get; private set; }
public string FullName { get; private set; } = string.Empty;
public int PassportSeries { get; private set; }
public int PassportNumber { get; private set; }
public static Buyer CreateBuyer(int id, string fullName, int passportSeries, int passportNumber)
{
return new Buyer
{
Id = id,
FullName = fullName,
PassportSeries = passportSeries,
PassportNumber = passportNumber
};
}
}
}

View File

@ -1,31 +0,0 @@
namespace RealEstateTransactions.Entities
{
public class Deal
{
public int Id { get; private set; }
public int ApartmentId { get; private set; }
public int BuyerId { get; private set; }
public float DealPrice { get; private set; }
public DateTime DealDate { get; private set; }
public IEnumerable<ServicesDeal> DealServices { get; private set; } = [];
public static Deal CreateDeal(int id, int apartmentId, int buyerId, float dealPrice,
DateTime dealDate, IEnumerable<ServicesDeal> dealServices)
{
return new Deal
{
Id = id,
ApartmentId = apartmentId,
BuyerId = buyerId,
DealPrice = dealPrice,
DealDate = dealDate,
DealServices = dealServices
};
}
}
}

View File

@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealEstateTransactions.Entities.Enums
{
public enum AgencyType
{
None = 0,
Sniper = 1,
Shark = 2,
Hammer = 3
}
}

View File

@ -1,22 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealEstateTransactions.Entities.Enums
{
[Flags]
public enum FormFactorType
{
None = 0,
Kitchen = 1,
Hall = 2,
BedRoom = 4,
Lounge = 8
}
}

View File

@ -1,24 +0,0 @@
namespace RealEstateTransactions.Entities
{
public class PreSalesServices
{
public int Id { get; private set; }
public int ApartmentId { get; private set; }
public string Name { get; private set; } = string.Empty;
public float Cost { get; private set; }
public static PreSalesServices CreatePreSalesServices(int id, int apartmentId, string name, float cost)
{
return new PreSalesServices
{
Id = id,
ApartmentId = apartmentId,
Name = name,
Cost = cost
};
}
}
}

View File

@ -1,21 +0,0 @@
namespace RealEstateTransactions.Entities
{
public class Services
{
public int Id { get; private set; }
public string Name { get; private set; } = string.Empty;
public float Price { get; private set; }
public static Services CreateService(int id, string name, float price)
{
return new Services
{
Id = id,
Name = name,
Price = price
};
}
}
}

View File

@ -1,21 +0,0 @@
namespace RealEstateTransactions.Entities
{
public class ServicesDeal
{
public int ServicesId { get; private set; }
public int DealId { get; private set; }
public float ExecutionTime { get; private set; }
public static ServicesDeal CreateServicesDeal(int servicesId, int dealId, float executionTime)
{
return new ServicesDeal
{
ServicesId = servicesId,
DealId = dealId,
ExecutionTime = executionTime
};
}
}
}

View File

@ -0,0 +1,39 @@
namespace RealEstateTransactions
{
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()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@ -0,0 +1,10 @@
namespace RealEstateTransactions
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
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
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>
@ -26,36 +26,36 @@
<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
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
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
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
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
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
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
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->

View File

@ -1,139 +0,0 @@
namespace RealEstateTransactions
{
partial class FormGeneral
{
/// <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()
{
menuStrip1 = new MenuStrip();
справочникиToolStripMenuItem = new ToolStripMenuItem();
квартирыToolStripMenuItem = new ToolStripMenuItem();
покупателиToolStripMenuItem = new ToolStripMenuItem();
услугиToolStripMenuItem = new ToolStripMenuItem();
операцииToolStripMenuItem = new ToolStripMenuItem();
допродажныеУслугиToolStripMenuItem = new ToolStripMenuItem();
сделкиToolStripMenuItem = new ToolStripMenuItem();
отчётToolStripMenuItem = new ToolStripMenuItem();
menuStrip1.SuspendLayout();
SuspendLayout();
//
// menuStrip1
//
menuStrip1.ImageScalingSize = new Size(20, 20);
menuStrip1.Items.AddRange(new ToolStripItem[] { справочникиToolStripMenuItem, операцииToolStripMenuItem, отчётToolStripMenuItem });
menuStrip1.Location = new Point(0, 0);
menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new Size(800, 28);
menuStrip1.TabIndex = 0;
menuStrip1.Text = "menuStrip1";
//
// справочникиToolStripMenuItem
//
справочникиToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { квартирыToolStripMenuItem, покупателиToolStripMenuItem, услугиToolStripMenuItem });
справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem";
справочникиToolStripMenuItem.Size = new Size(117, 24);
справочникиToolStripMenuItem.Text = "Справочники";
//
// квартирыToolStripMenuItem
//
квартирыToolStripMenuItem.Name = "квартирыToolStripMenuItem";
квартирыToolStripMenuItem.Size = new Size(224, 26);
квартирыToolStripMenuItem.Text = "Квартиры";
квартирыToolStripMenuItem.Click += КвартирыToolStripMenuItem_Click;
//
// покупателиToolStripMenuItem
//
покупателиToolStripMenuItem.Name = "покупателиToolStripMenuItem";
покупателиToolStripMenuItem.Size = new Size(224, 26);
покупателиToolStripMenuItem.Text = "Покупатели";
покупателиToolStripMenuItem.Click += ПокупателиToolStripMenuItem_Click;
//
// услугиToolStripMenuItem
//
услугиToolStripMenuItem.Name = "услугиToolStripMenuItem";
услугиToolStripMenuItem.Size = new Size(224, 26);
услугиToolStripMenuItem.Text = "Услуги";
услугиToolStripMenuItem.Click += УслугиToolStripMenuItem_Click;
//
// операцииToolStripMenuItem
//
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { допродажныеУслугиToolStripMenuItem, сделкиToolStripMenuItem });
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
операцииToolStripMenuItem.Size = new Size(95, 24);
операцииToolStripMenuItem.Text = "Операции";
//
// допродажныеУслугиToolStripMenuItem
//
допродажныеУслугиToolStripMenuItem.Name = опродажныеУслугиToolStripMenuItem";
допродажныеУслугиToolStripMenuItem.Size = new Size(241, 26);
допродажныеУслугиToolStripMenuItem.Text = "Допродажные услуги";
допродажныеУслугиToolStripMenuItem.Click += ДопродажныеУслугиToolStripMenuItem_Click;
//
// сделкиToolStripMenuItem
//
сделкиToolStripMenuItem.Name = "сделкиToolStripMenuItem";
сделкиToolStripMenuItem.Size = new Size(241, 26);
сделкиToolStripMenuItem.Text = "Сделки";
сделкиToolStripMenuItem.Click += СделкиToolStripMenuItem_Click;
//
// отчётToolStripMenuItem
//
отчётToolStripMenuItem.Name = "отчётToolStripMenuItem";
отчётToolStripMenuItem.Size = new Size(73, 24);
отчётToolStripMenuItem.Text = "Отчёты";
//
// FormGeneral
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
BackgroundImage = Properties.Resources.фон;
BackgroundImageLayout = ImageLayout.Stretch;
ClientSize = new Size(800, 450);
Controls.Add(menuStrip1);
DoubleBuffered = true;
MainMenuStrip = menuStrip1;
Name = "FormGeneral";
StartPosition = FormStartPosition.CenterScreen;
Text = "Недвижимость";
menuStrip1.ResumeLayout(false);
menuStrip1.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion
private MenuStrip menuStrip1;
private ToolStripMenuItem справочникиToolStripMenuItem;
private ToolStripMenuItem квартирыToolStripMenuItem;
private ToolStripMenuItem покупателиToolStripMenuItem;
private ToolStripMenuItem операцииToolStripMenuItem;
private ToolStripMenuItem допродажныеУслугиToolStripMenuItem;
private ToolStripMenuItem отчётToolStripMenuItem;
private ToolStripMenuItem услугиToolStripMenuItem;
private ToolStripMenuItem сделкиToolStripMenuItem;
}
}

View File

@ -1,77 +0,0 @@
using Unity;
using RealEstateTransactions.Forms;
using RealEstateTransactions.Entities;
namespace RealEstateTransactions
{
public partial class FormGeneral : Form
{
private readonly IUnityContainer _container;
public FormGeneral(IUnityContainer container)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
}
private void ÊâàðòèðûToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormApartments>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ÏîêóïàòåëèToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormBuyers>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ÑäåëêèToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormDeals>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ÓñëóãèToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormServices>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ÄîïðîäàæíûåÓñëóãèToolStripMenuItem_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormPreSalesServices>().ShowDialog();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Îøèáêà ïðè çàãðóçêå", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}

View File

@ -1,123 +0,0 @@
<?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="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -1,268 +0,0 @@
namespace RealEstateTransactions.Forms
{
partial class FormApartment
{
/// <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()
{
comboBoxAgency = new ComboBox();
labelAgency = new Label();
labelformFactor = new Label();
labelArea = new Label();
labelPricePerSM = new Label();
labelBasePrice = new Label();
labelDesiredPrice = new Label();
buttonSave = new Button();
buttonCancel = new Button();
numericUpDownArea = new NumericUpDown();
numericUpDownPricePerSM = new NumericUpDown();
numericUpDownDesiredPrice = new NumericUpDown();
numericUpDownBasePrice = new NumericUpDown();
checkedListBoxFormFactor = new CheckedListBox();
((System.ComponentModel.ISupportInitialize)numericUpDownArea).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownPricePerSM).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownDesiredPrice).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownBasePrice).BeginInit();
SuspendLayout();
//
// comboBoxAgency
//
comboBoxAgency.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxAgency.Font = new Font("Segoe UI", 14F);
comboBoxAgency.FormattingEnabled = true;
comboBoxAgency.Location = new Point(336, 6);
comboBoxAgency.Name = "comboBoxAgency";
comboBoxAgency.Size = new Size(217, 39);
comboBoxAgency.TabIndex = 0;
//
// labelAgency
//
labelAgency.AutoSize = true;
labelAgency.Font = new Font("Segoe UI", 14F);
labelAgency.Location = new Point(12, 9);
labelAgency.Name = "labelAgency";
labelAgency.Size = new Size(312, 32);
labelAgency.TabIndex = 10;
labelAgency.Text = "Агенство - - - - - - - -";
//
// labelformFactor
//
labelformFactor.AutoSize = true;
labelformFactor.Font = new Font("Segoe UI", 14F);
labelformFactor.Location = new Point(12, 73);
labelformFactor.Name = "labelformFactor";
labelformFactor.Size = new Size(271, 32);
labelformFactor.TabIndex = 2;
labelformFactor.Text = "Вид квартиры - - - -";
//
// labelArea
//
labelArea.AutoSize = true;
labelArea.Font = new Font("Segoe UI", 14F);
labelArea.Location = new Point(12, 265);
labelArea.Name = "labelArea";
labelArea.Size = new Size(382, 32);
labelArea.TabIndex = 4;
labelArea.Text = "Площадь квартиры (м2) - - - -";
//
// labelPricePerSM
//
labelPricePerSM.AutoSize = true;
labelPricePerSM.Font = new Font("Segoe UI", 14F);
labelPricePerSM.Location = new Point(12, 332);
labelPricePerSM.Name = "labelPricePerSM";
labelPricePerSM.Size = new Size(380, 32);
labelPricePerSM.TabIndex = 11;
labelPricePerSM.Text = "Цена квадратного метра (руб) -";
//
// labelBasePrice
//
labelBasePrice.AutoSize = true;
labelBasePrice.Font = new Font("Segoe UI", 14F);
labelBasePrice.Location = new Point(12, 397);
labelBasePrice.Name = "labelBasePrice";
labelBasePrice.Size = new Size(278, 32);
labelBasePrice.TabIndex = 12;
labelBasePrice.Text = "Базовая цена (руб) - -";
//
// labelDesiredPrice
//
labelDesiredPrice.AutoSize = true;
labelDesiredPrice.Font = new Font("Segoe UI", 14F);
labelDesiredPrice.Location = new Point(12, 451);
labelDesiredPrice.Name = "labelDesiredPrice";
labelDesiredPrice.Size = new Size(281, 32);
labelDesiredPrice.TabIndex = 13;
labelDesiredPrice.Text = "Цена от агенства (руб) -";
//
// buttonSave
//
buttonSave.Font = new Font("Segoe UI", 14F);
buttonSave.Location = new Point(77, 517);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(150, 41);
buttonSave.TabIndex = 5;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Font = new Font("Segoe UI", 14F);
buttonCancel.Location = new Point(336, 517);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(150, 41);
buttonCancel.TabIndex = 6;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// numericUpDownArea
//
numericUpDownArea.BorderStyle = BorderStyle.FixedSingle;
numericUpDownArea.DecimalPlaces = 1;
numericUpDownArea.Font = new Font("Segoe UI", 14F);
numericUpDownArea.Increment = new decimal(new int[] { 5, 0, 0, 0 });
numericUpDownArea.Location = new Point(403, 272);
numericUpDownArea.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownArea.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
numericUpDownArea.Name = "numericUpDownArea";
numericUpDownArea.Size = new Size(150, 39);
numericUpDownArea.TabIndex = 2;
numericUpDownArea.TextAlign = HorizontalAlignment.Center;
numericUpDownArea.Value = new decimal(new int[] { 1, 0, 0, 0 });
numericUpDownArea.ValueChanged += NumericUpDownArea_ValueChanged;
//
// numericUpDownPricePerSM
//
numericUpDownPricePerSM.BorderStyle = BorderStyle.FixedSingle;
numericUpDownPricePerSM.DecimalPlaces = 2;
numericUpDownPricePerSM.Font = new Font("Segoe UI", 14F);
numericUpDownPricePerSM.Increment = new decimal(new int[] { 5, 0, 0, 0 });
numericUpDownPricePerSM.Location = new Point(403, 330);
numericUpDownPricePerSM.Maximum = new decimal(new int[] { 1000000, 0, 0, 0 });
numericUpDownPricePerSM.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
numericUpDownPricePerSM.Name = "numericUpDownPricePerSM";
numericUpDownPricePerSM.Size = new Size(150, 39);
numericUpDownPricePerSM.TabIndex = 3;
numericUpDownPricePerSM.TextAlign = HorizontalAlignment.Center;
numericUpDownPricePerSM.ThousandsSeparator = true;
numericUpDownPricePerSM.Value = new decimal(new int[] { 1, 0, 0, 0 });
numericUpDownPricePerSM.ValueChanged += NumericUpDownPricePerSM_ValueChanged;
//
// numericUpDownDesiredPrice
//
numericUpDownDesiredPrice.BorderStyle = BorderStyle.FixedSingle;
numericUpDownDesiredPrice.DecimalPlaces = 2;
numericUpDownDesiredPrice.Font = new Font("Segoe UI", 14F);
numericUpDownDesiredPrice.Increment = new decimal(new int[] { 5, 0, 0, 0 });
numericUpDownDesiredPrice.Location = new Point(294, 449);
numericUpDownDesiredPrice.Maximum = new decimal(new int[] { 1000000000, 0, 0, 0 });
numericUpDownDesiredPrice.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
numericUpDownDesiredPrice.Name = "numericUpDownDesiredPrice";
numericUpDownDesiredPrice.Size = new Size(259, 39);
numericUpDownDesiredPrice.TabIndex = 4;
numericUpDownDesiredPrice.TextAlign = HorizontalAlignment.Center;
numericUpDownDesiredPrice.ThousandsSeparator = true;
numericUpDownDesiredPrice.Value = new decimal(new int[] { 1, 0, 0, 0 });
//
// numericUpDownBasePrice
//
numericUpDownBasePrice.BorderStyle = BorderStyle.FixedSingle;
numericUpDownBasePrice.DecimalPlaces = 2;
numericUpDownBasePrice.Font = new Font("Segoe UI", 14F);
numericUpDownBasePrice.Increment = new decimal(new int[] { 5, 0, 0, 0 });
numericUpDownBasePrice.InterceptArrowKeys = false;
numericUpDownBasePrice.Location = new Point(294, 395);
numericUpDownBasePrice.Maximum = new decimal(new int[] { 1000000000, 0, 0, 0 });
numericUpDownBasePrice.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
numericUpDownBasePrice.Name = "numericUpDownBasePrice";
numericUpDownBasePrice.ReadOnly = true;
numericUpDownBasePrice.Size = new Size(259, 39);
numericUpDownBasePrice.TabIndex = 14;
numericUpDownBasePrice.TabStop = false;
numericUpDownBasePrice.TextAlign = HorizontalAlignment.Center;
numericUpDownBasePrice.ThousandsSeparator = true;
numericUpDownBasePrice.Value = new decimal(new int[] { 1, 0, 0, 0 });
//
// checkedListBoxFormFactor
//
checkedListBoxFormFactor.BorderStyle = BorderStyle.FixedSingle;
checkedListBoxFormFactor.Font = new Font("Segoe UI", 14F);
checkedListBoxFormFactor.FormattingEnabled = true;
checkedListBoxFormFactor.Location = new Point(289, 73);
checkedListBoxFormFactor.Name = "checkedListBoxFormFactor";
checkedListBoxFormFactor.Size = new Size(264, 172);
checkedListBoxFormFactor.TabIndex = 1;
//
// FormApartment
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(577, 575);
Controls.Add(checkedListBoxFormFactor);
Controls.Add(numericUpDownBasePrice);
Controls.Add(numericUpDownDesiredPrice);
Controls.Add(numericUpDownPricePerSM);
Controls.Add(numericUpDownArea);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(labelDesiredPrice);
Controls.Add(labelBasePrice);
Controls.Add(labelPricePerSM);
Controls.Add(labelArea);
Controls.Add(labelformFactor);
Controls.Add(labelAgency);
Controls.Add(comboBoxAgency);
Name = "FormApartment";
StartPosition = FormStartPosition.CenterParent;
Text = "Квартира";
((System.ComponentModel.ISupportInitialize)numericUpDownArea).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownPricePerSM).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownDesiredPrice).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownBasePrice).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private ComboBox comboBoxAgency;
private Label labelAgency;
private Label labelformFactor;
private Label labelArea;
private Label labelPricePerSM;
private Label labelBasePrice;
private Label labelDesiredPrice;
private Button buttonSave;
private Button buttonCancel;
private NumericUpDown numericUpDownArea;
private NumericUpDown numericUpDownPricePerSM;
private NumericUpDown numericUpDownDesiredPrice;
private NumericUpDown numericUpDownBasePrice;
private CheckedListBox checkedListBoxFormFactor;
}
}

View File

@ -1,101 +0,0 @@
using RealEstateTransactions.Entities;
using RealEstateTransactions.Repositories;
using RealEstateTransactions.Entities.Enums;
namespace RealEstateTransactions.Forms
{
public partial class FormApartment : Form
{
private readonly IApartmentRepository _repository;
private int? _apartmentId;
public int Id
{
set
{
try
{
var apartment = _repository.ReadApartment(value);
if (apartment == null) throw new InvalidDataException(nameof(apartment));
foreach (FormFactorType elem in Enum.GetValues(typeof(FormFactorType)))
{
if ((elem & apartment.FormFactorId) != 0)
checkedListBoxFormFactor.SetItemChecked(checkedListBoxFormFactor.Items.IndexOf(elem), true);
}
comboBoxAgency.SelectedIndex = (int)apartment.AgencyId;
numericUpDownArea.Value = (decimal)apartment.Area;
numericUpDownPricePerSM.Value = (decimal)apartment.PricePerSM;
numericUpDownBasePrice.Value = (decimal)apartment.BasePrice;
numericUpDownDesiredPrice.Value = (decimal)apartment.DesiredPrice;
_apartmentId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
public FormApartment(IApartmentRepository repository)
{
InitializeComponent();
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
comboBoxAgency.DataSource = Enum.GetValues(typeof(AgencyType));
foreach (var elem in Enum.GetValues(typeof(FormFactorType))) checkedListBoxFormFactor.Items.Add(elem);
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (comboBoxAgency.SelectedIndex == -1 || checkedListBoxFormFactor.CheckedItems.Count == 0)
{
throw new Exception("Имеются незаполненные поля");
}
if (_apartmentId.HasValue)
{
_repository.UpdateApartment(CreateApartment(_apartmentId.Value));
}
else
{
_repository.CreateApartment(CreateApartment(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private Apartment CreateApartment(int Id)
{
FormFactorType formFactorType = FormFactorType.None;
foreach (FormFactorType elem in checkedListBoxFormFactor.CheckedItems) formFactorType |= elem;
return Apartment.CreateApartment(Id,
(AgencyType)comboBoxAgency.SelectedIndex, formFactorType,
(float)numericUpDownArea.Value, (float)numericUpDownPricePerSM.Value,
(float)numericUpDownBasePrice.Value, (float)numericUpDownDesiredPrice.Value);
}
private void NumericUpDownArea_ValueChanged(object sender, EventArgs e) =>
numericUpDownBasePrice.Value = numericUpDownArea.Value * numericUpDownPricePerSM.Value;
private void NumericUpDownPricePerSM_ValueChanged(object sender, EventArgs e) =>
numericUpDownBasePrice.Value = numericUpDownArea.Value * numericUpDownPricePerSM.Value;
}
}

View File

@ -1,120 +0,0 @@
<?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>

View File

@ -1,128 +0,0 @@
namespace RealEstateTransactions.Forms
{
partial class FormApartments
{
/// <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()
{
panelTools = new Panel();
buttonDelete = new Button();
buttonUpdate = new Button();
buttonAdd = new Button();
dataGridView = new DataGridView();
panelTools.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// panelTools
//
panelTools.Controls.Add(buttonDelete);
panelTools.Controls.Add(buttonUpdate);
panelTools.Controls.Add(buttonAdd);
panelTools.Dock = DockStyle.Right;
panelTools.Location = new Point(851, 0);
panelTools.Name = "panelTools";
panelTools.Size = new Size(131, 553);
panelTools.TabIndex = 0;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.Delete;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(28, 333);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(80, 80);
buttonDelete.TabIndex = 2;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonUpdate
//
buttonUpdate.BackgroundImage = Properties.Resources.Update;
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
buttonUpdate.Location = new Point(28, 204);
buttonUpdate.Name = "buttonUpdate";
buttonUpdate.Size = new Size(80, 80);
buttonUpdate.TabIndex = 1;
buttonUpdate.UseVisualStyleBackColor = true;
buttonUpdate.Click += ButtonUpdate_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = Properties.Resources.Add;
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(28, 73);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(80, 80);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// dataGridView
//
dataGridView.AllowUserToAddRows = false;
dataGridView.AllowUserToDeleteRows = false;
dataGridView.AllowUserToResizeColumns = false;
dataGridView.AllowUserToResizeRows = false;
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Dock = DockStyle.Fill;
dataGridView.Location = new Point(0, 0);
dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView";
dataGridView.ReadOnly = true;
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(851, 553);
dataGridView.TabIndex = 1;
dataGridView.TabStop = false;
//
// FormApartments
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(982, 553);
Controls.Add(dataGridView);
Controls.Add(panelTools);
Name = "FormApartments";
StartPosition = FormStartPosition.CenterParent;
Text = "Квартиры";
Load += FormApartments_Load;
panelTools.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panelTools;
private Button buttonDelete;
private Button buttonUpdate;
private Button buttonAdd;
private DataGridView dataGridView;
}
}

View File

@ -1,95 +0,0 @@
using Unity;
using RealEstateTransactions.Repositories;
namespace RealEstateTransactions.Forms
{
public partial class FormApartments : Form
{
private readonly IUnityContainer _container;
private readonly IApartmentRepository _repository;
public FormApartments(IUnityContainer container, IApartmentRepository repository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
}
private void FormApartments_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка загрузки", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormApartment>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpdate_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFormSelectedRow(out var findId)) return;
try
{
var form = _container.Resolve<FormApartment>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFormSelectedRow(out var findId)) return;
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
!= DialogResult.Yes) return;
try
{
_repository.DeleteApartment(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView.DataSource = _repository.ReadApartments();
private bool TryGetIdentifierFormSelectedRow(out int id)
{
id = 0;
if (dataGridView.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -1,164 +0,0 @@
namespace RealEstateTransactions.Forms
{
partial class FormBuyer
{
/// <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()
{
labelFullName = new Label();
textBoxFullName = new TextBox();
labelPassportSeries = new Label();
numericUpDownPassportSeries = new NumericUpDown();
labelPassportNumber = new Label();
numericUpDownPassportNumber = new NumericUpDown();
buttonSave = new Button();
buttonCancel = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDownPassportSeries).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownPassportNumber).BeginInit();
SuspendLayout();
//
// labelFullName
//
labelFullName.AutoSize = true;
labelFullName.Font = new Font("Segoe UI", 14F);
labelFullName.Location = new Point(12, 9);
labelFullName.Name = "labelFullName";
labelFullName.Size = new Size(67, 32);
labelFullName.TabIndex = 0;
labelFullName.Text = "ФИО";
//
// textBoxFullName
//
textBoxFullName.BorderStyle = BorderStyle.FixedSingle;
textBoxFullName.Font = new Font("Segoe UI", 14F);
textBoxFullName.Location = new Point(85, 7);
textBoxFullName.Name = "textBoxFullName";
textBoxFullName.Size = new Size(357, 39);
textBoxFullName.TabIndex = 0;
textBoxFullName.TextAlign = HorizontalAlignment.Center;
//
// labelPassportSeries
//
labelPassportSeries.AutoSize = true;
labelPassportSeries.Font = new Font("Segoe UI", 14F);
labelPassportSeries.Location = new Point(12, 68);
labelPassportSeries.Name = "labelPassportSeries";
labelPassportSeries.Size = new Size(317, 32);
labelPassportSeries.TabIndex = 1;
labelPassportSeries.Text = "Серия паспорта - - - - -";
//
// numericUpDownPassportSeries
//
numericUpDownPassportSeries.BorderStyle = BorderStyle.FixedSingle;
numericUpDownPassportSeries.Font = new Font("Segoe UI", 14F);
numericUpDownPassportSeries.Location = new Point(345, 66);
numericUpDownPassportSeries.Maximum = new decimal(new int[] { 9999, 0, 0, 0 });
numericUpDownPassportSeries.Minimum = new decimal(new int[] { 1111, 0, 0, 0 });
numericUpDownPassportSeries.Name = "numericUpDownPassportSeries";
numericUpDownPassportSeries.Size = new Size(97, 39);
numericUpDownPassportSeries.TabIndex = 1;
numericUpDownPassportSeries.TextAlign = HorizontalAlignment.Center;
numericUpDownPassportSeries.Value = new decimal(new int[] { 1111, 0, 0, 0 });
//
// labelPassportNumber
//
labelPassportNumber.AutoSize = true;
labelPassportNumber.Font = new Font("Segoe UI", 14F);
labelPassportNumber.Location = new Point(12, 130);
labelPassportNumber.Name = "labelPassportNumber";
labelPassportNumber.Size = new Size(300, 32);
labelPassportNumber.TabIndex = 2;
labelPassportNumber.Text = "Номер паспорта - - - -";
//
// numericUpDownPassportNumber
//
numericUpDownPassportNumber.BorderStyle = BorderStyle.FixedSingle;
numericUpDownPassportNumber.Font = new Font("Segoe UI", 14F);
numericUpDownPassportNumber.Location = new Point(318, 128);
numericUpDownPassportNumber.Maximum = new decimal(new int[] { 999999, 0, 0, 0 });
numericUpDownPassportNumber.Minimum = new decimal(new int[] { 111111, 0, 0, 0 });
numericUpDownPassportNumber.Name = "numericUpDownPassportNumber";
numericUpDownPassportNumber.Size = new Size(124, 39);
numericUpDownPassportNumber.TabIndex = 2;
numericUpDownPassportNumber.TextAlign = HorizontalAlignment.Center;
numericUpDownPassportNumber.Value = new decimal(new int[] { 111111, 0, 0, 0 });
//
// buttonSave
//
buttonSave.Font = new Font("Segoe UI", 14F);
buttonSave.Location = new Point(49, 176);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(147, 50);
buttonSave.TabIndex = 3;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Font = new Font("Segoe UI", 14F);
buttonCancel.Location = new Point(258, 176);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(147, 50);
buttonCancel.TabIndex = 4;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += buttonCancel_Click;
//
// FormBuyer
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(455, 238);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(numericUpDownPassportNumber);
Controls.Add(labelPassportNumber);
Controls.Add(numericUpDownPassportSeries);
Controls.Add(labelPassportSeries);
Controls.Add(textBoxFullName);
Controls.Add(labelFullName);
Name = "FormBuyer";
StartPosition = FormStartPosition.CenterParent;
Text = "Покупатель";
((System.ComponentModel.ISupportInitialize)numericUpDownPassportSeries).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownPassportNumber).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelFullName;
private TextBox textBoxFullName;
private Label labelPassportSeries;
private NumericUpDown numericUpDownPassportSeries;
private Label labelPassportNumber;
private NumericUpDown numericUpDownPassportNumber;
private Button buttonSave;
private Button buttonCancel;
}
}

View File

@ -1,71 +0,0 @@
using RealEstateTransactions.Entities;
using RealEstateTransactions.Repositories;
namespace RealEstateTransactions.Forms
{
public partial class FormBuyer : Form
{
private readonly IBuyerRepository _repository;
private int? _buyerId;
public int Id
{
set
{
try
{
var buyer = _repository.ReadBuyer(value);
if (buyer == null) throw new InvalidDataException(nameof(buyer));
textBoxFullName.Text = buyer.FullName;
numericUpDownPassportSeries.Value = buyer.PassportSeries;
numericUpDownPassportNumber.Value = buyer.PassportNumber;
_buyerId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
public FormBuyer(IBuyerRepository repository)
{
InitializeComponent();
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(textBoxFullName.Text))
throw new Exception("Имеются не заполненные поля");
if (_buyerId.HasValue)
{
_repository.UpdateBuyer(CreateBuyer(_buyerId.Value));
}
else
{
_repository.CreateBuyer(CreateBuyer(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void buttonCancel_Click(object sender, EventArgs e) => Close();
private Buyer CreateBuyer(int id) => Buyer.CreateBuyer(id, textBoxFullName.Text,
(int)numericUpDownPassportSeries.Value, (int)numericUpDownPassportNumber.Value);
}
}

View File

@ -1,120 +0,0 @@
<?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>

View File

@ -1,128 +0,0 @@
namespace RealEstateTransactions.Forms
{
partial class FormBuyers
{
/// <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()
{
panelTools = new Panel();
buttonDelete = new Button();
buttonUpdate = new Button();
buttonAdd = new Button();
dataGridView = new DataGridView();
panelTools.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// panelTools
//
panelTools.Controls.Add(buttonDelete);
panelTools.Controls.Add(buttonUpdate);
panelTools.Controls.Add(buttonAdd);
panelTools.Dock = DockStyle.Right;
panelTools.Location = new Point(850, 0);
panelTools.Name = "panelTools";
panelTools.Size = new Size(132, 553);
panelTools.TabIndex = 0;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.Delete;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(27, 358);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(80, 80);
buttonDelete.TabIndex = 2;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonUpdate
//
buttonUpdate.BackgroundImage = Properties.Resources.Update;
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
buttonUpdate.Location = new Point(27, 223);
buttonUpdate.Name = "buttonUpdate";
buttonUpdate.Size = new Size(80, 80);
buttonUpdate.TabIndex = 1;
buttonUpdate.UseVisualStyleBackColor = true;
buttonUpdate.Click += ButtonUpdate_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = Properties.Resources.Add;
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(27, 88);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(80, 80);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// dataGridView
//
dataGridView.AllowUserToAddRows = false;
dataGridView.AllowUserToDeleteRows = false;
dataGridView.AllowUserToResizeColumns = false;
dataGridView.AllowUserToResizeRows = false;
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Dock = DockStyle.Fill;
dataGridView.Location = new Point(0, 0);
dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView";
dataGridView.ReadOnly = true;
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(850, 553);
dataGridView.TabIndex = 1;
dataGridView.TabStop = false;
//
// FormBuyers
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(982, 553);
Controls.Add(dataGridView);
Controls.Add(panelTools);
Name = "FormBuyers";
StartPosition = FormStartPosition.CenterParent;
Text = "Покупатели";
Load += FormBuyers_Load;
panelTools.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panelTools;
private Button buttonAdd;
private Button buttonDelete;
private Button buttonUpdate;
private DataGridView dataGridView;
}
}

View File

@ -1,96 +0,0 @@
using RealEstateTransactions.Repositories;
using Unity;
namespace RealEstateTransactions.Forms
{
public partial class FormBuyers : Form
{
private readonly IUnityContainer _container;
private readonly IBuyerRepository _repository;
public FormBuyers(IUnityContainer container, IBuyerRepository repository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
}
private void FormBuyers_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при загрузке", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormBuyer>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpdate_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFormSelectedRow(out var findId)) return;
try
{
var form = _container.Resolve<FormBuyer>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFormSelectedRow(out var findId)) return;
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo,
MessageBoxIcon.Question) == DialogResult.No) return;
try
{
_repository.DeleteBuyer(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView.DataSource = _repository.ReadBuyers();
private bool TryGetIdentifierFormSelectedRow(out int id)
{
id = 0;
if (dataGridView.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -1,120 +0,0 @@
<?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>

View File

@ -1,244 +0,0 @@
namespace RealEstateTransactions.Forms
{
partial class FormDeal
{
/// <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()
{
labelApartmentId = new Label();
comboBoxApartmentId = new ComboBox();
labelFullName = new Label();
comboBoxFullName = new ComboBox();
labelDealPrice = new Label();
numericUpDownDealPrice = new NumericUpDown();
labelDealDate = new Label();
dateTimePickerDealDate = new DateTimePicker();
buttonSave = new Button();
buttonCancel = new Button();
groupBoxDataGrid = new GroupBox();
dataGridView = new DataGridView();
ColumnService = new DataGridViewComboBoxColumn();
ColumnTimeSpan = new DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)numericUpDownDealPrice).BeginInit();
groupBoxDataGrid.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// labelApartmentId
//
labelApartmentId.AutoSize = true;
labelApartmentId.Font = new Font("Segoe UI", 14F);
labelApartmentId.Location = new Point(12, 9);
labelApartmentId.Name = "labelApartmentId";
labelApartmentId.Size = new Size(349, 32);
labelApartmentId.TabIndex = 0;
labelApartmentId.Text = "ID квартиры - - - - - - - -";
//
// comboBoxApartmentId
//
comboBoxApartmentId.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxApartmentId.Font = new Font("Segoe UI", 14F);
comboBoxApartmentId.FormattingEnabled = true;
comboBoxApartmentId.Location = new Point(370, 6);
comboBoxApartmentId.Name = "comboBoxApartmentId";
comboBoxApartmentId.Size = new Size(151, 39);
comboBoxApartmentId.TabIndex = 0;
//
// labelFullName
//
labelFullName.AutoSize = true;
labelFullName.Font = new Font("Segoe UI", 14F);
labelFullName.Location = new Point(12, 76);
labelFullName.Name = "labelFullName";
labelFullName.Size = new Size(200, 32);
labelFullName.TabIndex = 1;
labelFullName.Text = "ФИО покупателя";
//
// comboBoxFullName
//
comboBoxFullName.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxFullName.Font = new Font("Segoe UI", 14F);
comboBoxFullName.FormattingEnabled = true;
comboBoxFullName.Location = new Point(218, 73);
comboBoxFullName.Name = "comboBoxFullName";
comboBoxFullName.Size = new Size(303, 39);
comboBoxFullName.TabIndex = 1;
//
// labelDealPrice
//
labelDealPrice.AutoSize = true;
labelDealPrice.Font = new Font("Segoe UI", 14F);
labelDealPrice.Location = new Point(12, 152);
labelDealPrice.Name = "labelDealPrice";
labelDealPrice.Size = new Size(214, 32);
labelDealPrice.TabIndex = 3;
labelDealPrice.Text = "Стоимость сделки";
//
// numericUpDownDealPrice
//
numericUpDownDealPrice.BorderStyle = BorderStyle.FixedSingle;
numericUpDownDealPrice.DecimalPlaces = 2;
numericUpDownDealPrice.Font = new Font("Segoe UI", 14F);
numericUpDownDealPrice.Location = new Point(232, 150);
numericUpDownDealPrice.Maximum = new decimal(new int[] { 1410065408, 2, 0, 0 });
numericUpDownDealPrice.Name = "numericUpDownDealPrice";
numericUpDownDealPrice.Size = new Size(289, 39);
numericUpDownDealPrice.TabIndex = 2;
numericUpDownDealPrice.TextAlign = HorizontalAlignment.Center;
numericUpDownDealPrice.ThousandsSeparator = true;
//
// labelDealDate
//
labelDealDate.AutoSize = true;
labelDealDate.Font = new Font("Segoe UI", 14F);
labelDealDate.Location = new Point(12, 219);
labelDealDate.Name = "labelDealDate";
labelDealDate.Size = new Size(251, 32);
labelDealDate.TabIndex = 4;
labelDealDate.Text = "Дата сделки - - - -";
//
// dateTimePickerDealDate
//
dateTimePickerDealDate.CalendarFont = new Font("Segoe UI", 14F);
dateTimePickerDealDate.Enabled = false;
dateTimePickerDealDate.Font = new Font("Segoe UI", 14F);
dateTimePickerDealDate.Location = new Point(271, 213);
dateTimePickerDealDate.Name = "dateTimePickerDealDate";
dateTimePickerDealDate.Size = new Size(250, 39);
dateTimePickerDealDate.TabIndex = 5;
dateTimePickerDealDate.TabStop = false;
dateTimePickerDealDate.Value = new DateTime(2024, 11, 22, 10, 0, 0, 0);
//
// buttonSave
//
buttonSave.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSave.Font = new Font("Segoe UI", 14F);
buttonSave.Location = new Point(66, 579);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(146, 63);
buttonSave.TabIndex = 3;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Font = new Font("Segoe UI", 14F);
buttonCancel.Location = new Point(328, 579);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(146, 63);
buttonCancel.TabIndex = 4;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// groupBoxDataGrid
//
groupBoxDataGrid.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
groupBoxDataGrid.Controls.Add(dataGridView);
groupBoxDataGrid.Font = new Font("Segoe UI", 14F);
groupBoxDataGrid.Location = new Point(66, 283);
groupBoxDataGrid.Name = "groupBoxDataGrid";
groupBoxDataGrid.Size = new Size(408, 269);
groupBoxDataGrid.TabIndex = 6;
groupBoxDataGrid.TabStop = false;
groupBoxDataGrid.Text = "Услуги";
//
// dataGridView
//
dataGridView.AllowUserToResizeColumns = false;
dataGridView.AllowUserToResizeRows = false;
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Columns.AddRange(new DataGridViewColumn[] { ColumnService, ColumnTimeSpan });
dataGridView.Dock = DockStyle.Fill;
dataGridView.Location = new Point(3, 35);
dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView";
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(402, 231);
dataGridView.TabIndex = 0;
dataGridView.TabStop = false;
//
// ColumnService
//
ColumnService.HeaderText = "Услуга";
ColumnService.MinimumWidth = 6;
ColumnService.Name = "ColumnService";
//
// ColumnTimeSpan
//
ColumnTimeSpan.HeaderText = "Время выполнения (ч)";
ColumnTimeSpan.MinimumWidth = 6;
ColumnTimeSpan.Name = "ColumnTimeSpan";
//
// FormDeal
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(534, 654);
Controls.Add(groupBoxDataGrid);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(dateTimePickerDealDate);
Controls.Add(labelDealDate);
Controls.Add(numericUpDownDealPrice);
Controls.Add(labelDealPrice);
Controls.Add(comboBoxFullName);
Controls.Add(labelFullName);
Controls.Add(comboBoxApartmentId);
Controls.Add(labelApartmentId);
Name = "FormDeal";
StartPosition = FormStartPosition.CenterParent;
Text = "Сделка";
((System.ComponentModel.ISupportInitialize)numericUpDownDealPrice).EndInit();
groupBoxDataGrid.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelApartmentId;
private ComboBox comboBoxApartmentId;
private Label labelFullName;
private ComboBox comboBoxFullName;
private Label labelDealPrice;
private NumericUpDown numericUpDownDealPrice;
private Label labelDealDate;
private DateTimePicker dateTimePickerDealDate;
private Button buttonSave;
private Button buttonCancel;
private GroupBox groupBoxDataGrid;
private DataGridView dataGridView;
private DataGridViewComboBoxColumn ColumnService;
private DataGridViewTextBoxColumn ColumnTimeSpan;
}
}

View File

@ -1,68 +0,0 @@
using RealEstateTransactions.Entities;
using RealEstateTransactions.Repositories;
namespace RealEstateTransactions.Forms
{
public partial class FormDeal : Form
{
private readonly IDealRepository _repository;
public FormDeal(IDealRepository repository, IApartmentRepository apartmentRepository,
IBuyerRepository buyerRepository, IServicesRepository servicesRepository)
{
InitializeComponent();
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
comboBoxApartmentId.DataSource = apartmentRepository.ReadApartments();
comboBoxApartmentId.DisplayMember = "Id";
comboBoxApartmentId.ValueMember = "Id";
comboBoxFullName.DataSource = buyerRepository.ReadBuyers();
comboBoxFullName.DisplayMember = "FullName";
comboBoxFullName.ValueMember = "Id";
ColumnService.DataSource = servicesRepository.ReadServices();
ColumnService.DisplayMember = "Name";
ColumnService.ValueMember = "Id";
dateTimePickerDealDate.Value = DateTime.Now;
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (comboBoxApartmentId.SelectedItem == null || comboBoxFullName.SelectedItem == null
|| dataGridView.RowCount < 1)
throw new Exception("Имеются не заполненные поля");
_repository.CreateDeal(Deal.CreateDeal(0, (int)comboBoxApartmentId.SelectedValue!,
(int)comboBoxFullName.SelectedValue!, (float)numericUpDownDealPrice.Value,
dateTimePickerDealDate.Value, CreateListFromDataGridView()));
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
private List<ServicesDeal> CreateListFromDataGridView()
{
var list = new List<ServicesDeal>();
foreach (DataGridViewRow row in dataGridView.Rows)
{
if (row.Cells["ColumnService"].Value == null ||
row.Cells["ColumnTimeSpan"].Value == null)
{
continue;
}
list.Add(ServicesDeal.CreateServicesDeal((int)row.Cells["ColumnService"].Value, 0, (float)row.Cells["ColumnTimeSpan"].Value));
}
return list;
}
}
}

View File

@ -1,126 +0,0 @@
<?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="ColumnService.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColumnTimeSpan.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -1,114 +0,0 @@
namespace RealEstateTransactions.Entities
{
partial class FormDeals
{
/// <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()
{
panelTools = new Panel();
buttonDelete = new Button();
buttonAdd = new Button();
dataGridView = new DataGridView();
panelTools.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// panelTools
//
panelTools.Controls.Add(buttonDelete);
panelTools.Controls.Add(buttonAdd);
panelTools.Dock = DockStyle.Right;
panelTools.Location = new Point(851, 0);
panelTools.Name = "panelTools";
panelTools.Size = new Size(131, 553);
panelTools.TabIndex = 1;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.Delete;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(28, 333);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(80, 80);
buttonDelete.TabIndex = 1;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = Properties.Resources.Add;
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(28, 73);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(80, 80);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// dataGridView
//
dataGridView.AllowUserToAddRows = false;
dataGridView.AllowUserToDeleteRows = false;
dataGridView.AllowUserToResizeColumns = false;
dataGridView.AllowUserToResizeRows = false;
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Dock = DockStyle.Fill;
dataGridView.Location = new Point(0, 0);
dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView";
dataGridView.ReadOnly = true;
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(851, 553);
dataGridView.TabIndex = 2;
dataGridView.TabStop = false;
//
// FormDeals
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(982, 553);
Controls.Add(dataGridView);
Controls.Add(panelTools);
Name = "FormDeals";
StartPosition = FormStartPosition.CenterParent;
Text = "Сделки";
Load += FormDeals_Load;
panelTools.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panelTools;
private Button buttonDelete;
private Button buttonAdd;
private DataGridView dataGridView;
}
}

View File

@ -1,79 +0,0 @@
using RealEstateTransactions.Forms;
using RealEstateTransactions.Repositories;
using Unity;
namespace RealEstateTransactions.Entities
{
public partial class FormDeals : Form
{
private readonly IUnityContainer _container;
private readonly IDealRepository _repository;
public FormDeals(IUnityContainer container, IDealRepository repository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
}
private void FormDeals_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка загрузки", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormDeal>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFormSelectedRow(out var findId)) return;
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
!= DialogResult.Yes) return;
try
{
_repository.DeleteDeal(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView.DataSource = _repository.ReadDeals();
private bool TryGetIdentifierFormSelectedRow(out int id)
{
id = 0;
if (dataGridView.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -1,120 +0,0 @@
<?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>

View File

@ -1,159 +0,0 @@
namespace RealEstateTransactions.Forms
{
partial class FormPreSalesService
{
/// <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()
{
labelApartmentId = new Label();
comboBoxApartmentId = new ComboBox();
labelName = new Label();
textBoxName = new TextBox();
labelCost = new Label();
numericUpDownCost = new NumericUpDown();
buttonSave = new Button();
buttonCancel = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDownCost).BeginInit();
SuspendLayout();
//
// labelApartmentId
//
labelApartmentId.AutoSize = true;
labelApartmentId.Font = new Font("Segoe UI", 14F);
labelApartmentId.Location = new Point(12, 9);
labelApartmentId.Name = "labelApartmentId";
labelApartmentId.Size = new Size(270, 32);
labelApartmentId.TabIndex = 0;
labelApartmentId.Text = "ID квартиры - - - - -";
//
// comboBoxApartmentId
//
comboBoxApartmentId.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxApartmentId.Font = new Font("Segoe UI", 14F);
comboBoxApartmentId.FormattingEnabled = true;
comboBoxApartmentId.Location = new Point(292, 6);
comboBoxApartmentId.Name = "comboBoxApartmentId";
comboBoxApartmentId.Size = new Size(151, 39);
comboBoxApartmentId.TabIndex = 0;
//
// labelName
//
labelName.AutoSize = true;
labelName.Font = new Font("Segoe UI", 14F);
labelName.Location = new Point(12, 83);
labelName.Name = "labelName";
labelName.Size = new Size(198, 32);
labelName.TabIndex = 1;
labelName.Text = "Название услуги";
//
// textBoxName
//
textBoxName.BorderStyle = BorderStyle.FixedSingle;
textBoxName.Font = new Font("Segoe UI", 14F);
textBoxName.Location = new Point(216, 81);
textBoxName.Name = "textBoxName";
textBoxName.Size = new Size(227, 39);
textBoxName.TabIndex = 1;
textBoxName.TextAlign = HorizontalAlignment.Center;
//
// labelCost
//
labelCost.AutoSize = true;
labelCost.Font = new Font("Segoe UI", 14F);
labelCost.Location = new Point(12, 169);
labelCost.Name = "labelCost";
labelCost.Size = new Size(264, 32);
labelCost.TabIndex = 2;
labelCost.Text = "Стоимость услуги - -";
//
// numericUpDownCost
//
numericUpDownCost.BorderStyle = BorderStyle.FixedSingle;
numericUpDownCost.DecimalPlaces = 2;
numericUpDownCost.Font = new Font("Segoe UI", 14F);
numericUpDownCost.Location = new Point(272, 167);
numericUpDownCost.Maximum = new decimal(new int[] { 1000000, 0, 0, 0 });
numericUpDownCost.Name = "numericUpDownCost";
numericUpDownCost.Size = new Size(171, 39);
numericUpDownCost.TabIndex = 2;
numericUpDownCost.TextAlign = HorizontalAlignment.Center;
numericUpDownCost.ThousandsSeparator = true;
//
// buttonSave
//
buttonSave.Font = new Font("Segoe UI", 14F);
buttonSave.Location = new Point(48, 228);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(144, 57);
buttonSave.TabIndex = 3;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Font = new Font("Segoe UI", 14F);
buttonCancel.Location = new Point(254, 228);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(144, 57);
buttonCancel.TabIndex = 4;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += ButtonCancel_Click;
//
// FormPreSalesService
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(455, 294);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(numericUpDownCost);
Controls.Add(labelCost);
Controls.Add(textBoxName);
Controls.Add(labelName);
Controls.Add(comboBoxApartmentId);
Controls.Add(labelApartmentId);
Name = "FormPreSalesService";
StartPosition = FormStartPosition.CenterParent;
Text = "Допродажная услуга";
((System.ComponentModel.ISupportInitialize)numericUpDownCost).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelApartmentId;
private ComboBox comboBoxApartmentId;
private Label labelName;
private TextBox textBoxName;
private Label labelCost;
private NumericUpDown numericUpDownCost;
private Button buttonSave;
private Button buttonCancel;
}
}

View File

@ -1,42 +0,0 @@
using RealEstateTransactions.Entities;
using RealEstateTransactions.Repositories;
namespace RealEstateTransactions.Forms
{
public partial class FormPreSalesService : Form
{
private readonly IPreSalesServicesRepository _repository;
public FormPreSalesService(IPreSalesServicesRepository repository, IApartmentRepository apartmentRepository)
{
InitializeComponent();
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
comboBoxApartmentId.DataSource = apartmentRepository.ReadApartments();
comboBoxApartmentId.DisplayMember = "Id";
comboBoxApartmentId.ValueMember = "Id";
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (comboBoxApartmentId.SelectedItem == null || string.IsNullOrWhiteSpace(textBoxName.Text))
{
throw new Exception("Имеются незаполненные поля");
}
_repository.CreatePreSalesService(PreSalesServices.CreatePreSalesServices(0, (int)comboBoxApartmentId.SelectedValue!,
textBoxName.Text, (float)numericUpDownCost.Value));
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonCancel_Click(object sender, EventArgs e) => Close();
}
}

View File

@ -1,120 +0,0 @@
<?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>

View File

@ -1,114 +0,0 @@
namespace RealEstateTransactions.Forms
{
partial class FormPreSalesServices
{
/// <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()
{
panelTools = new Panel();
buttonDelete = new Button();
buttonAdd = new Button();
dataGridView = new DataGridView();
panelTools.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// panelTools
//
panelTools.Controls.Add(buttonDelete);
panelTools.Controls.Add(buttonAdd);
panelTools.Dock = DockStyle.Right;
panelTools.Location = new Point(851, 0);
panelTools.Name = "panelTools";
panelTools.Size = new Size(131, 553);
panelTools.TabIndex = 1;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.Delete;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(28, 307);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(80, 80);
buttonDelete.TabIndex = 1;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = Properties.Resources.Add;
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(28, 139);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(80, 80);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// dataGridView
//
dataGridView.AllowUserToAddRows = false;
dataGridView.AllowUserToDeleteRows = false;
dataGridView.AllowUserToResizeColumns = false;
dataGridView.AllowUserToResizeRows = false;
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Dock = DockStyle.Fill;
dataGridView.Location = new Point(0, 0);
dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView";
dataGridView.ReadOnly = true;
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(851, 553);
dataGridView.TabIndex = 2;
dataGridView.TabStop = false;
//
// FormPreSalesServices
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(982, 553);
Controls.Add(dataGridView);
Controls.Add(panelTools);
Name = "FormPreSalesServices";
StartPosition = FormStartPosition.CenterParent;
Text = "Допродажные услуги";
Load += FormPreSalesServices_Load;
panelTools.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panelTools;
private Button buttonDelete;
private Button buttonAdd;
private DataGridView dataGridView;
}
}

View File

@ -1,78 +0,0 @@
using RealEstateTransactions.Repositories;
using Unity;
namespace RealEstateTransactions.Forms
{
public partial class FormPreSalesServices : Form
{
private readonly IUnityContainer _container;
private readonly IPreSalesServicesRepository _repository;
public FormPreSalesServices(IUnityContainer container, IPreSalesServicesRepository repository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
}
private void FormPreSalesServices_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка загрузки", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormPreSalesService>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFormSelectedRow(out var findId)) return;
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
!= DialogResult.Yes) return;
try
{
_repository.DeletePreSalesService(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView.DataSource = _repository.ReadPreSalesServices();
private bool TryGetIdentifierFormSelectedRow(out int id)
{
id = 0;
if (dataGridView.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -1,120 +0,0 @@
<?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>

View File

@ -1,133 +0,0 @@
namespace RealEstateTransactions.Forms
{
partial class FormService
{
/// <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()
{
labelName = new Label();
labelPrice = new Label();
textBoxName = new TextBox();
numericUpDownPrice = new NumericUpDown();
buttonSave = new Button();
buttonCancel = new Button();
((System.ComponentModel.ISupportInitialize)numericUpDownPrice).BeginInit();
SuspendLayout();
//
// labelName
//
labelName.AutoSize = true;
labelName.Font = new Font("Segoe UI", 14F);
labelName.Location = new Point(12, 9);
labelName.Name = "labelName";
labelName.Size = new Size(198, 32);
labelName.TabIndex = 0;
labelName.Text = "Название услуги";
//
// labelPrice
//
labelPrice.AutoSize = true;
labelPrice.Font = new Font("Segoe UI", 14F);
labelPrice.Location = new Point(12, 80);
labelPrice.Name = "labelPrice";
labelPrice.Size = new Size(209, 32);
labelPrice.TabIndex = 1;
labelPrice.Text = "Стоимость услуги";
//
// textBoxName
//
textBoxName.BorderStyle = BorderStyle.FixedSingle;
textBoxName.Font = new Font("Segoe UI", 14F);
textBoxName.Location = new Point(232, 7);
textBoxName.Name = "textBoxName";
textBoxName.Size = new Size(186, 39);
textBoxName.TabIndex = 0;
textBoxName.TextAlign = HorizontalAlignment.Center;
//
// numericUpDownPrice
//
numericUpDownPrice.BorderStyle = BorderStyle.FixedSingle;
numericUpDownPrice.DecimalPlaces = 2;
numericUpDownPrice.Font = new Font("Segoe UI", 14F);
numericUpDownPrice.Location = new Point(232, 73);
numericUpDownPrice.Maximum = new decimal(new int[] { 1000000, 0, 0, 0 });
numericUpDownPrice.Name = "numericUpDownPrice";
numericUpDownPrice.Size = new Size(186, 39);
numericUpDownPrice.TabIndex = 1;
numericUpDownPrice.TextAlign = HorizontalAlignment.Center;
numericUpDownPrice.ThousandsSeparator = true;
//
// buttonSave
//
buttonSave.Font = new Font("Segoe UI", 14F);
buttonSave.Location = new Point(32, 137);
buttonSave.Name = "buttonSave";
buttonSave.Size = new Size(148, 49);
buttonSave.TabIndex = 2;
buttonSave.Text = "Сохранить";
buttonSave.UseVisualStyleBackColor = true;
buttonSave.Click += ButtonSave_Click;
//
// buttonCancel
//
buttonCancel.Font = new Font("Segoe UI", 14F);
buttonCancel.Location = new Point(232, 137);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(148, 49);
buttonCancel.TabIndex = 3;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
buttonCancel.Click += buttonCancel_Click;
//
// FormService
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(429, 194);
Controls.Add(buttonCancel);
Controls.Add(buttonSave);
Controls.Add(numericUpDownPrice);
Controls.Add(textBoxName);
Controls.Add(labelPrice);
Controls.Add(labelName);
Name = "FormService";
StartPosition = FormStartPosition.CenterParent;
Text = "Услуга";
((System.ComponentModel.ISupportInitialize)numericUpDownPrice).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private Label labelName;
private Label labelPrice;
private TextBox textBoxName;
private NumericUpDown numericUpDownPrice;
private Button buttonSave;
private Button buttonCancel;
}
}

View File

@ -1,73 +0,0 @@
using RealEstateTransactions.Entities;
using RealEstateTransactions.Repositories;
namespace RealEstateTransactions.Forms
{
public partial class FormService : Form
{
private readonly IServicesRepository _repository;
private int? _serviceId;
public int Id
{
set
{
try
{
var service = _repository.ReadService(value);
if (service == null) throw new InvalidDataException(nameof(service));
textBoxName.Text = service.Name;
numericUpDownPrice.Value = (decimal)service.Price;
_serviceId = value;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при получении данных",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
}
public FormService(IServicesRepository repository)
{
InitializeComponent();
_repository = repository ?? throw new ArgumentNullException(nameof(repository));
}
private void ButtonSave_Click(object sender, EventArgs e)
{
try
{
if (string.IsNullOrWhiteSpace(textBoxName.Text))
{
throw new Exception("Имеются незаполненные поля");
}
if (_serviceId.HasValue)
{
_repository.UpdateService(CreateService(_serviceId.Value));
}
else
{
_repository.CreateService(CreateService(0));
}
Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при сохранении",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void buttonCancel_Click(object sender, EventArgs e) => Close();
private Services CreateService(int id) => Services.CreateService(id, textBoxName.Text, (float)numericUpDownPrice.Value);
}
}

View File

@ -1,120 +0,0 @@
<?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>

View File

@ -1,128 +0,0 @@
namespace RealEstateTransactions.Entities
{
partial class FormServices
{
/// <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()
{
panelTools = new Panel();
buttonDelete = new Button();
buttonUpdate = new Button();
buttonAdd = new Button();
dataGridView = new DataGridView();
panelTools.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
SuspendLayout();
//
// panelTools
//
panelTools.Controls.Add(buttonDelete);
panelTools.Controls.Add(buttonUpdate);
panelTools.Controls.Add(buttonAdd);
panelTools.Dock = DockStyle.Right;
panelTools.Location = new Point(851, 0);
panelTools.Name = "panelTools";
panelTools.Size = new Size(131, 553);
panelTools.TabIndex = 1;
//
// buttonDelete
//
buttonDelete.BackgroundImage = Properties.Resources.Delete;
buttonDelete.BackgroundImageLayout = ImageLayout.Stretch;
buttonDelete.Location = new Point(28, 333);
buttonDelete.Name = "buttonDelete";
buttonDelete.Size = new Size(80, 80);
buttonDelete.TabIndex = 2;
buttonDelete.UseVisualStyleBackColor = true;
buttonDelete.Click += ButtonDelete_Click;
//
// buttonUpdate
//
buttonUpdate.BackgroundImage = Properties.Resources.Update;
buttonUpdate.BackgroundImageLayout = ImageLayout.Stretch;
buttonUpdate.Location = new Point(28, 204);
buttonUpdate.Name = "buttonUpdate";
buttonUpdate.Size = new Size(80, 80);
buttonUpdate.TabIndex = 1;
buttonUpdate.UseVisualStyleBackColor = true;
buttonUpdate.Click += ButtonUpdate_Click;
//
// buttonAdd
//
buttonAdd.BackgroundImage = Properties.Resources.Add;
buttonAdd.BackgroundImageLayout = ImageLayout.Stretch;
buttonAdd.Location = new Point(28, 73);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(80, 80);
buttonAdd.TabIndex = 0;
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += ButtonAdd_Click;
//
// dataGridView
//
dataGridView.AllowUserToAddRows = false;
dataGridView.AllowUserToDeleteRows = false;
dataGridView.AllowUserToResizeColumns = false;
dataGridView.AllowUserToResizeRows = false;
dataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView.Dock = DockStyle.Fill;
dataGridView.Location = new Point(0, 0);
dataGridView.MultiSelect = false;
dataGridView.Name = "dataGridView";
dataGridView.ReadOnly = true;
dataGridView.RowHeadersVisible = false;
dataGridView.RowHeadersWidth = 51;
dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView.Size = new Size(851, 553);
dataGridView.TabIndex = 2;
dataGridView.TabStop = false;
//
// FormServices
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(982, 553);
Controls.Add(dataGridView);
Controls.Add(panelTools);
Name = "FormServices";
StartPosition = FormStartPosition.CenterParent;
Text = "Услуги";
Load += FormServices_Load;
panelTools.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
ResumeLayout(false);
}
#endregion
private Panel panelTools;
private Button buttonDelete;
private Button buttonUpdate;
private Button buttonAdd;
private DataGridView dataGridView;
}
}

View File

@ -1,96 +0,0 @@
using RealEstateTransactions.Forms;
using RealEstateTransactions.Repositories;
using Unity;
namespace RealEstateTransactions.Entities
{
public partial class FormServices : Form
{
private readonly IUnityContainer _container;
private readonly IServicesRepository _repository;
public FormServices(IUnityContainer container, IServicesRepository repository)
{
InitializeComponent();
_container = container ?? throw new ArgumentNullException(nameof(container));
_repository = repository ?? throw new ArgumentNullException(nameof(_repository));
}
private void FormServices_Load(object sender, EventArgs e)
{
try
{
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка загрузки", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonAdd_Click(object sender, EventArgs e)
{
try
{
_container.Resolve<FormService>().ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при добавлении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonUpdate_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFormSelectedRow(out var findId)) return;
try
{
var form = _container.Resolve<FormService>();
form.Id = findId;
form.ShowDialog();
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при изменении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void ButtonDelete_Click(object sender, EventArgs e)
{
if (!TryGetIdentifierFormSelectedRow(out var findId)) return;
if (MessageBox.Show("Удалить запись?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
!= DialogResult.Yes) return;
try
{
_repository.DeleteService(findId);
LoadList();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Ошибка при удалении", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void LoadList() => dataGridView.DataSource = _repository.ReadServices();
private bool TryGetIdentifierFormSelectedRow(out int id)
{
id = 0;
if (dataGridView.SelectedRows.Count < 1)
{
MessageBox.Show("Нет выбранной записи", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
return true;
}
}
}

View File

@ -1,120 +0,0 @@
<?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>

View File

@ -1,7 +1,3 @@
using RealEstateTransactions.Repositories;
using RealEstateTransactions.Repositories.Implementations;
using Unity;
namespace RealEstateTransactions
{
internal static class Program
@ -15,21 +11,7 @@ namespace RealEstateTransactions
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(CreateContainer().Resolve<FormGeneral>());
}
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
container.RegisterType<IApartmentRepository, ApartmentRepository>();
container.RegisterType<IBuyerRepository, BuyerRepository>();
container.RegisterType<IDealRepository, DealRepository>();
container.RegisterType<IPreSalesServicesRepository, PreSalesServicesRepository>();
container.RegisterType<IServicesDealRepository, ServicesDealRepository>();
container.RegisterType<IServicesRepository, ServicesRepository>();
return container;
Application.Run(new Form1());
}
}
}

View File

@ -1,113 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RealEstateTransactions.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("RealEstateTransactions.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;
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Add {
get {
object obj = ResourceManager.GetObject("Add", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Delete {
get {
object obj = ResourceManager.GetObject("Delete", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap ERka {
get {
object obj = ResourceManager.GetObject("ERka", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Update {
get {
object obj = ResourceManager.GetObject("Update", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap фон {
get {
object obj = ResourceManager.GetObject("фон", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -1,136 +0,0 @@
<?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>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="фон" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\фон.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Add" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ERka" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ERka.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Update" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Update.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@ -8,23 +8,4 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Unity" Version="5.11.10" />
</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>

View File

@ -1,17 +0,0 @@
using RealEstateTransactions.Entities;
namespace RealEstateTransactions.Repositories
{
public interface IApartmentRepository
{
IEnumerable<Apartment> ReadApartments();
Apartment ReadApartment(int id);
void CreateApartment(Apartment apartment);
void UpdateApartment(Apartment apartment);
void DeleteApartment(int id);
}
}

View File

@ -1,17 +0,0 @@
using RealEstateTransactions.Entities;
namespace RealEstateTransactions.Repositories
{
public interface IBuyerRepository
{
IEnumerable<Buyer> ReadBuyers();
Buyer ReadBuyer(int id);
void CreateBuyer(Buyer buyer);
void UpdateBuyer(Buyer buyer);
void DeleteBuyer(int id);
}
}

View File

@ -1,17 +0,0 @@
using RealEstateTransactions.Entities;
namespace RealEstateTransactions.Repositories
{
public interface IDealRepository
{
IEnumerable<Deal> ReadDeals();
Deal ReadDeal(int id);
void CreateDeal(Deal deal);
void UpdateDeal(Deal deal);
void DeleteDeal(int id);
}
}

View File

@ -1,13 +0,0 @@
using RealEstateTransactions.Entities;
namespace RealEstateTransactions.Repositories
{
public interface IPreSalesServicesRepository
{
IEnumerable<PreSalesServices> ReadPreSalesServices();
void CreatePreSalesService(PreSalesServices preSalesServices);
void DeletePreSalesService(int id);
}
}

View File

@ -1,11 +0,0 @@
using RealEstateTransactions.Entities;
namespace RealEstateTransactions.Repositories
{
public interface IServicesDealRepository
{
IEnumerable<ServicesDeal> ReadServicesDeal();
void CreateServicesDeal(ServicesDeal servicesDeal);
}
}

View File

@ -1,17 +0,0 @@
using RealEstateTransactions.Entities;
namespace RealEstateTransactions.Repositories
{
public interface IServicesRepository
{
IEnumerable<Services> ReadServices();
Services ReadService(int id);
void CreateService(Services service);
void UpdateService(Services service);
void DeleteService(int id);
}
}

View File

@ -1,38 +0,0 @@
using RealEstateTransactions.Entities;
using RealEstateTransactions.Entities.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealEstateTransactions.Repositories.Implementations
{
public class ApartmentRepository : IApartmentRepository
{
public Apartment ReadApartment(int id)
{
return Apartment.CreateApartment(0, AgencyType.None, FormFactorType.None, 0, 0, 0, 0);
}
public IEnumerable<Apartment> ReadApartments()
{
return [];
}
public void CreateApartment(Apartment apartment)
{
}
public void DeleteApartment(int id)
{
}
public void UpdateApartment(Apartment apartment)
{
}
}
}

View File

@ -1,38 +0,0 @@
using RealEstateTransactions.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Text;
using System.Threading.Tasks;
namespace RealEstateTransactions.Repositories.Implementations
{
public class BuyerRepository : IBuyerRepository
{
public void CreateBuyer(Buyer buyer)
{
}
public void DeleteBuyer(int id)
{
}
public Buyer ReadBuyer(int id)
{
return Buyer.CreateBuyer(0, "", 0, 0);
}
public IEnumerable<Buyer> ReadBuyers()
{
return [];
}
public void UpdateBuyer(Buyer buyer)
{
}
}
}

View File

@ -1,32 +0,0 @@
using RealEstateTransactions.Entities;
namespace RealEstateTransactions.Repositories.Implementations
{
public class DealRepository : IDealRepository
{
public void CreateDeal(Deal deal)
{
}
public void DeleteDeal(int id)
{
}
public Deal ReadDeal(int id)
{
return Deal.CreateDeal(0, 0, 0, 0, DateTime.Now, []);
}
public IEnumerable<Deal> ReadDeals()
{
return [];
}
public void UpdateDeal(Deal deal)
{
}
}
}

View File

@ -1,28 +0,0 @@
using RealEstateTransactions.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealEstateTransactions.Repositories.Implementations
{
public class PreSalesServicesRepository : IPreSalesServicesRepository
{
public void CreatePreSalesService(PreSalesServices preSalesServices)
{
}
public void DeletePreSalesService(int id)
{
}
public IEnumerable<PreSalesServices> ReadPreSalesServices()
{
return [];
}
}
}

View File

@ -1,27 +0,0 @@
using RealEstateTransactions.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealEstateTransactions.Repositories.Implementations
{
public class ServicesDealRepository : IServicesDealRepository
{
public void CreateServicesDeal(ServicesDeal servicesDeal)
{
}
public void DeleteServicesDeal(int id)
{
}
public IEnumerable<ServicesDeal> ReadServicesDeal()
{
return [];
}
}
}

View File

@ -1,37 +0,0 @@
using RealEstateTransactions.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RealEstateTransactions.Repositories.Implementations
{
public class ServicesRepository : IServicesRepository
{
public void CreateService(Services service)
{
}
public void DeleteService(int id)
{
}
public Services ReadService(int id)
{
return Services.CreateService(0, "", 0);
}
public IEnumerable<Services> ReadServices()
{
return [];
}
public void UpdateService(Services service)
{
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 954 KiB

View File

@ -1 +0,0 @@