Исправление

This commit is contained in:
AnnZhimol 2023-01-31 12:21:29 +04:00
parent 495a8ca63e
commit 7f72ec0ea9
8 changed files with 27 additions and 8 deletions

View File

@ -23,5 +23,6 @@ namespace SofrwareInstallationContracts.BindingModels
public DateTime? DateImplement { get; set; }
public int Id { get; set; }
public string PackageName { get; set; } = string.Empty;
}
}

View File

@ -16,6 +16,9 @@ namespace SofrwareInstallationContracts.ViewModels
[DisplayName("Номер")]
public int Id { get; set; }
[DisplayName("Название изделия")]
public string PackageName { get; set; } = string.Empty;
[DisplayName("Количество")]
public int Count { get; set; }
@ -31,5 +34,6 @@ namespace SofrwareInstallationContracts.ViewModels
[DisplayName("Дата выполнения")]
public DateTime? DateImplement { get; set; }
}
}

View File

@ -114,6 +114,7 @@ namespace SoftwareInstallationView
var operationResult = _logicO.CreateOrder(new OrderBindingModel
{
PackageId = Convert.ToInt32(PackageComboBox.SelectedValue),
PackageName=PackageComboBox.Text,
Count = Convert.ToInt32(CountTextBox.Text),
Sum = Convert.ToDouble(SumTextBox.Text)
});

View File

@ -48,7 +48,7 @@
this.СправочникиToolStripMenuItem});
this.MenuStrip.Location = new System.Drawing.Point(0, 0);
this.MenuStrip.Name = "MenuStrip";
this.MenuStrip.Size = new System.Drawing.Size(800, 24);
this.MenuStrip.Size = new System.Drawing.Size(865, 24);
this.MenuStrip.TabIndex = 0;
this.MenuStrip.Text = "menuStrip1";
//
@ -81,12 +81,12 @@
this.DataGridView.Location = new System.Drawing.Point(0, 27);
this.DataGridView.Name = "DataGridView";
this.DataGridView.RowTemplate.Height = 25;
this.DataGridView.Size = new System.Drawing.Size(657, 421);
this.DataGridView.Size = new System.Drawing.Size(722, 421);
this.DataGridView.TabIndex = 1;
//
// CreateOrderButton
//
this.CreateOrderButton.Location = new System.Drawing.Point(663, 27);
this.CreateOrderButton.Location = new System.Drawing.Point(728, 28);
this.CreateOrderButton.Name = "CreateOrderButton";
this.CreateOrderButton.Size = new System.Drawing.Size(125, 33);
this.CreateOrderButton.TabIndex = 2;
@ -96,7 +96,7 @@
//
// TakeOrderInWorkButton
//
this.TakeOrderInWorkButton.Location = new System.Drawing.Point(663, 82);
this.TakeOrderInWorkButton.Location = new System.Drawing.Point(728, 83);
this.TakeOrderInWorkButton.Name = "TakeOrderInWorkButton";
this.TakeOrderInWorkButton.Size = new System.Drawing.Size(125, 39);
this.TakeOrderInWorkButton.TabIndex = 3;
@ -106,7 +106,7 @@
//
// OrderReadyButton
//
this.OrderReadyButton.Location = new System.Drawing.Point(663, 145);
this.OrderReadyButton.Location = new System.Drawing.Point(728, 146);
this.OrderReadyButton.Name = "OrderReadyButton";
this.OrderReadyButton.Size = new System.Drawing.Size(125, 33);
this.OrderReadyButton.TabIndex = 4;
@ -116,7 +116,7 @@
//
// IssuedOrderButton
//
this.IssuedOrderButton.Location = new System.Drawing.Point(663, 203);
this.IssuedOrderButton.Location = new System.Drawing.Point(728, 204);
this.IssuedOrderButton.Name = "IssuedOrderButton";
this.IssuedOrderButton.Size = new System.Drawing.Size(125, 33);
this.IssuedOrderButton.TabIndex = 5;
@ -126,7 +126,7 @@
//
// UpdateListButton
//
this.UpdateListButton.Location = new System.Drawing.Point(663, 261);
this.UpdateListButton.Location = new System.Drawing.Point(728, 262);
this.UpdateListButton.Name = "UpdateListButton";
this.UpdateListButton.Size = new System.Drawing.Size(125, 33);
this.UpdateListButton.TabIndex = 6;
@ -138,7 +138,7 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.ClientSize = new System.Drawing.Size(865, 450);
this.Controls.Add(this.UpdateListButton);
this.Controls.Add(this.IssuedOrderButton);
this.Controls.Add(this.OrderReadyButton);

View File

@ -99,6 +99,7 @@ namespace SoftwareInstallationView
{
Id = id,
PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value),
PackageName = DataGridView.SelectedRows[0].Cells["PackageName"].Value.ToString(),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
@ -133,6 +134,7 @@ namespace SoftwareInstallationView
{
Id = id,
PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value),
PackageName = DataGridView.SelectedRows[0].Cells["PackageName"].Value.ToString(),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
@ -167,6 +169,7 @@ namespace SoftwareInstallationView
{
Id = id,
PackageId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["PackageId"].Value),
PackageName = DataGridView.SelectedRows[0].Cells["PackageName"].Value.ToString(),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),

View File

@ -60,4 +60,7 @@
<metadata name="MenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>31</value>
</metadata>
</root>

View File

@ -10,6 +10,7 @@ namespace SoftwareInstallationDataModels.Models
public interface IOrderModel : IId
{
int PackageId { get; }
string PackageName { get; }
int Count { get; }
double Sum { get; }
OrderStatus Status { get; }

View File

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using SofrwareInstallationContracts.BindingModels;
@ -15,6 +16,8 @@ namespace SoftwareInstallationListImplement.Models
{
public int PackageId { get; private set; }
public string PackageName { get; private set; }
public int Count { get; private set; }
public double Sum { get; private set; }
@ -37,6 +40,7 @@ namespace SoftwareInstallationListImplement.Models
{
Id = model.Id,
PackageId = model.PackageId,
PackageName=model.PackageName,
Count = model.Count,
Sum=model.Sum,
Status = model.Status,
@ -52,6 +56,7 @@ namespace SoftwareInstallationListImplement.Models
return;
}
PackageId = model.PackageId;
PackageName = model.PackageName;
Count = model.Count;
Sum = model.Sum;
Status = model.Status;
@ -63,6 +68,7 @@ namespace SoftwareInstallationListImplement.Models
{
Id = Id,
PackageId = PackageId,
PackageName = PackageName,
Count = Count,
Sum = Sum,
Status = Status,