diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshop.csproj b/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshop.csproj
index faeeef0..eb9a45f 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshop.csproj
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/BlacksmithWorkshop.csproj
@@ -20,7 +20,7 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.Designer.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.Designer.cs
index a788b8b..5516f67 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.Designer.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.Designer.cs
@@ -28,93 +28,92 @@
///
private void InitializeComponent()
{
- this.panel = new System.Windows.Forms.Panel();
- this.ButtonToPdf = new System.Windows.Forms.Button();
- this.ButtonMake = new System.Windows.Forms.Button();
- this.dateTimePickerTo = new System.Windows.Forms.DateTimePicker();
- this.label2 = new System.Windows.Forms.Label();
- this.dateTimePickerFrom = new System.Windows.Forms.DateTimePicker();
- this.label1 = new System.Windows.Forms.Label();
- this.panel.SuspendLayout();
- this.SuspendLayout();
+ panel = new Panel();
+ ButtonToPdf = new Button();
+ ButtonMake = new Button();
+ dateTimePickerTo = new DateTimePicker();
+ label2 = new Label();
+ dateTimePickerFrom = new DateTimePicker();
+ label1 = new Label();
+ panel.SuspendLayout();
+ SuspendLayout();
//
// panel
//
- this.panel.Controls.Add(this.ButtonToPdf);
- this.panel.Controls.Add(this.ButtonMake);
- this.panel.Controls.Add(this.dateTimePickerTo);
- this.panel.Controls.Add(this.label2);
- this.panel.Controls.Add(this.dateTimePickerFrom);
- this.panel.Controls.Add(this.label1);
- this.panel.Location = new System.Drawing.Point(0, 2);
- this.panel.Name = "panel";
- this.panel.Size = new System.Drawing.Size(932, 42);
- this.panel.TabIndex = 0;
+ panel.Controls.Add(ButtonToPdf);
+ panel.Controls.Add(ButtonMake);
+ panel.Controls.Add(dateTimePickerTo);
+ panel.Controls.Add(label2);
+ panel.Controls.Add(dateTimePickerFrom);
+ panel.Controls.Add(label1);
+ panel.Location = new Point(-6, 2);
+ panel.Name = "panel";
+ panel.Size = new Size(943, 42);
+ panel.TabIndex = 0;
//
// ButtonToPdf
//
- this.ButtonToPdf.Location = new System.Drawing.Point(829, 8);
- this.ButtonToPdf.Name = "ButtonToPdf";
- this.ButtonToPdf.Size = new System.Drawing.Size(94, 29);
- this.ButtonToPdf.TabIndex = 5;
- this.ButtonToPdf.Text = "в PDF";
- this.ButtonToPdf.UseVisualStyleBackColor = true;
- this.ButtonToPdf.Click += new System.EventHandler(this.ButtonToPdf_Click);
+ ButtonToPdf.Location = new Point(829, 8);
+ ButtonToPdf.Name = "ButtonToPdf";
+ ButtonToPdf.Size = new Size(94, 29);
+ ButtonToPdf.TabIndex = 5;
+ ButtonToPdf.Text = "в PDF";
+ ButtonToPdf.UseVisualStyleBackColor = true;
+ ButtonToPdf.Click += ButtonToPdf_Click;
//
// ButtonMake
//
- this.ButtonMake.Location = new System.Drawing.Point(550, 8);
- this.ButtonMake.Name = "ButtonMake";
- this.ButtonMake.Size = new System.Drawing.Size(128, 29);
- this.ButtonMake.TabIndex = 4;
- this.ButtonMake.Text = "Сформировать";
- this.ButtonMake.UseVisualStyleBackColor = true;
- this.ButtonMake.Click += new System.EventHandler(this.ButtonMake_Click);
+ ButtonMake.Location = new Point(550, 8);
+ ButtonMake.Name = "ButtonMake";
+ ButtonMake.Size = new Size(128, 29);
+ ButtonMake.TabIndex = 4;
+ ButtonMake.Text = "Сформировать";
+ ButtonMake.UseVisualStyleBackColor = true;
+ ButtonMake.Click += ButtonMake_Click;
//
// dateTimePickerTo
//
- this.dateTimePickerTo.Location = new System.Drawing.Point(269, 10);
- this.dateTimePickerTo.Name = "dateTimePickerTo";
- this.dateTimePickerTo.Size = new System.Drawing.Size(250, 27);
- this.dateTimePickerTo.TabIndex = 3;
+ dateTimePickerTo.Location = new Point(269, 10);
+ dateTimePickerTo.Name = "dateTimePickerTo";
+ dateTimePickerTo.Size = new Size(250, 27);
+ dateTimePickerTo.TabIndex = 3;
//
// label2
//
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(236, 12);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(27, 20);
- this.label2.TabIndex = 2;
- this.label2.Text = "по";
+ label2.AutoSize = true;
+ label2.Location = new Point(236, 12);
+ label2.Name = "label2";
+ label2.Size = new Size(27, 20);
+ label2.TabIndex = 2;
+ label2.Text = "по";
//
// dateTimePickerFrom
//
- this.dateTimePickerFrom.Location = new System.Drawing.Point(42, 10);
- this.dateTimePickerFrom.Name = "dateTimePickerFrom";
- this.dateTimePickerFrom.Size = new System.Drawing.Size(188, 27);
- this.dateTimePickerFrom.TabIndex = 1;
+ dateTimePickerFrom.Location = new Point(42, 10);
+ dateTimePickerFrom.Name = "dateTimePickerFrom";
+ dateTimePickerFrom.Size = new Size(188, 27);
+ dateTimePickerFrom.TabIndex = 1;
//
// label1
//
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(20, 12);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(16, 20);
- this.label1.TabIndex = 0;
- this.label1.Text = "с";
+ label1.AutoSize = true;
+ label1.Location = new Point(20, 12);
+ label1.Name = "label1";
+ label1.Size = new Size(16, 20);
+ label1.TabIndex = 0;
+ label1.Text = "с";
//
// FormReportOrders
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(935, 450);
- this.Controls.Add(this.panel);
- this.Name = "FormReportOrders";
- this.Text = "FormReportOrders";
- this.panel.ResumeLayout(false);
- this.panel.PerformLayout();
- this.ResumeLayout(false);
-
+ AutoScaleDimensions = new SizeF(8F, 20F);
+ AutoScaleMode = AutoScaleMode.Font;
+ ClientSize = new Size(938, 450);
+ Controls.Add(panel);
+ Name = "FormReportOrders";
+ Text = "FormReportOrders";
+ panel.ResumeLayout(false);
+ panel.PerformLayout();
+ ResumeLayout(false);
}
#endregion
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.cs b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.cs
index fd7ffda..5eff4a4 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/FormReportOrders.cs
@@ -30,10 +30,11 @@ namespace BlacksmithWorkshop
Dock = DockStyle.Fill
};
reportViewer.LocalReport.LoadReportDefinition(new
- FileStream("C:\\Users\\User\\source\\repos\\BlacksmithWorkshop\\BlacksmithWorkshop\\BlacksmithWorkshop\\ReportOrders.rdlc", FileMode.Open));
+ FileStream("C:\\Users\\User\\source\\repos\\BlacksmithWorkshop\\BlacksmithWorkshop\\BlacksmithWorkshop\\ReportOrders.rdlc", FileMode.Open));
Controls.Clear();
- Controls.Add(reportViewer);
Controls.Add(panel);
+ Controls.Add(reportViewer);
+
}
private void ButtonMake_Click(object sender, EventArgs e)
@@ -51,13 +52,16 @@ namespace BlacksmithWorkshop
DateFrom = dateTimePickerFrom.Value,
DateTo = dateTimePickerTo.Value
});
+
var source = new ReportDataSource("DataSetOrders", dataSource);
reportViewer.LocalReport.DataSources.Clear();
reportViewer.LocalReport.DataSources.Add(source);
- var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c {dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}") }; reportViewer.LocalReport.SetParameters(parameters);
+ var parameters = new[] { new ReportParameter("ReportParameterPeriod", $"c {dateTimePickerFrom.Value.ToShortDateString()} по {dateTimePickerTo.Value.ToShortDateString()}") };
+ reportViewer.LocalReport.SetParameters(parameters);
reportViewer.RefreshReport();
_logger.LogInformation("Загрузка списка заказов на период {From}-{ To}", dateTimePickerFrom.Value.ToShortDateString(),
dateTimePickerTo.Value.ToShortDateString());
+
}
catch (Exception ex)
{
@@ -99,12 +103,12 @@ namespace BlacksmithWorkshop
catch (Exception ex)
{
_logger.LogError(ex, "Ошибка сохранения списка заказов на период");
-
+
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
-
- }
+
+ }
}
}
diff --git a/BlacksmithWorkshop/BlacksmithWorkshop/ReportOrders.rdlc b/BlacksmithWorkshop/BlacksmithWorkshop/ReportOrders.rdlc
index 3093666..17dc45d 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshop/ReportOrders.rdlc
+++ b/BlacksmithWorkshop/BlacksmithWorkshop/ReportOrders.rdlc
@@ -1,6 +1,50 @@
0
+
+
+
+ System.Data.DataSet
+ /* Local Connection */
+
+ 605c80d0-7d6c-4474-934b-337c1a3114c7
+
+
+
+
+
+ BlacksmithWorkshopContractsViewModels
+ /* Local Query */
+
+
+
+ Id
+ System.Int32
+
+
+ DateCreate
+ System.DateTime
+
+
+ ManufactureName
+ System.String
+
+
+ Sum
+ System.Decimal
+
+
+ OrderStatus
+ BlacksmithWorkshopDataModels.OrderStatus
+
+
+
+ BlacksmithWorkshopContracts.ViewModels
+ ReportOrdersViewModel
+ BlacksmithWorkshopContracts.ViewModels.ReportOrdersViewModel, ConfectioneryContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+
@@ -12,9 +56,8 @@
- Заказ
+ Заказы
@@ -26,7 +69,8 @@
Textbox1
- 0.84553cm
+ 0.61383cm
+ 1.03603cm
16.51cm
+
ReportParameterPeriod
- 0.91609cm
- 0.77611cm
+ 1.64986cm
+ 0.6985cm
16.51cm
1
+
+
+
+
+ 1.73518cm
+
+
+ 3.66134cm
+
+
+ 3.87301cm
+
+
+ 2.5cm
+
+
+ 2.5cm
+
+
+
+
+ 0.76214cm
+
+
+
+
+ true
+ true
+
+
+
+
+ Номер
+
+
+
+
+
+
+ Textbox2
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Дата создания
+
+
+
+
+
+
+ Textbox4
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Изделие
+
+
+
+
+
+
+ Textbox6
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Сумма
+
+
+
+
+
+
+ Textbox8
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Статус
+
+
+
+
+
+
+ Textbox14
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ 0.76214cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Id.Value
+
+
+
+
+
+
+ Id
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!DateCreate.Value
+
+
+
+
+
+
+ DateCreate
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!ManufactureName.Value
+
+
+
+
+
+
+ ManufactureName
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!Sum.Value
+
+
+
+
+
+
+ Sum
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Fields!OrderStatus.Value
+
+
+
+
+
+
+ OrderStatus
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ After
+
+
+
+
+
+
+ DataSetOrders
+ 2.86342cm
+ 2.26483cm
+ 1.52428cm
+ 14.26953cm
+ 2
+
+
+
+
+
+ true
+ true
+
+
+
+
+ Итого
+
+
+
+
+
+
+ Textbox10
+ 4.85987cm
+ 10.06687cm
+ 0.89633cm
+ 2.373cm
+ 3
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+ true
+ true
+
+
+
+
+ =Sum(Fields!Sum.Value, "DataSetOrders")
+
+
+
+
+
+
+ Textbox11
+ 4.85987cm
+ 12.47514cm
+ 0.89633cm
+ 2.5cm
+ 4
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
- 2in
+ 2.75in
- 6.5in
+ 6.58367in
29.7cm
21cm
@@ -107,5 +587,5 @@
Cm
- 57846e0b-e3a0-4418-ab77-05190e6a6b9e
+ ae77169d-5beb-4d55-9ff7-96b65ad9bcfa
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/ReportLogic.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/ReportLogic.cs
index 052ae23..b3d5fc3 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/ReportLogic.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/BusinessLogics/ReportLogic.cs
@@ -10,6 +10,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using DocumentFormat.OpenXml.Office2010.ExcelAc;
namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
{
@@ -40,25 +41,25 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
public List GetManufactureComponent()
{
var components = _componentStorage.GetFullList();
- var products = _manufactureStorage.GetFullList();
+ var manufactures = _manufactureStorage.GetFullList();
var list = new List();
- foreach (var component in components)
+ foreach (var manufacture in manufactures)
{
var record = new ReportManufactureComponentViewModel
{
- ManufactureName = component.ComponentName,
+ ManufactureName = manufacture.ManufactureName,
Components = new List>(),
TotalCount = 0
};
- foreach (var product in products)
+ foreach (var component in manufacture.ManufactureComponents)
{
- if (product.ManufactureComponents.ContainsKey(component.Id))
- {
+
record.Components.Add(new Tuple(product.ManufactureName, product.ManufactureComponents[component.Id].Item2));
- record.TotalCount +=
- product.ManufactureComponents[component.Id].Item2;
- }
+ int>(component.Value.Item1.ComponentName, component.Value.Item2));
+ record.TotalCount += component.Value.Item2;
+
+
+
}
list.Add(record);
}
@@ -71,7 +72,8 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
///
public List GetOrders(ReportBindingModel model)
{
- return _orderStorage.GetFilteredList(new OrderSearchModel
+
+ return _orderStorage.GetFilteredList(new OrderSearchModel
{
DateFrom
= model.DateFrom,
@@ -82,9 +84,12 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
Id = x.Id,
DateCreate = x.DateCreate,
ManufactureName = x.ManufactureName,
- Sum = x.Sum
+ Sum = x.Sum,
+ OrderStatus = x.Status.ToString()
})
.ToList();
+
+
}
///
/// Сохранение компонент в файл-Word
@@ -123,9 +128,12 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
FileName = model.FileName,
Title = "Список заказов",
DateFrom = model.DateFrom!.Value,
+
DateTo = model.DateTo!.Value,
Orders = GetOrders(model)
});
+
+
}
}
}
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
index 0613b27..d37b119 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshopBusinessLogic/OfficePackage/AbstractSaveToPdf.cs
@@ -26,11 +26,11 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage
= "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
- CreateTable(new List { "2cm", "3cm", "6cm", "3cm" });
+ CreateTable(new List { "2cm", "3cm", "6cm", "3cm", "2cm" });
CreateRow(new PdfRowParameters
{
Texts = new List { "Номер", "Дата заказа", "Изделие",
-"Сумма" },
+"Сумма", "Статус" },
Style = "NormalTitle",
ParagraphAlignment = PdfParagraphAlignmentType.Center
});
@@ -39,7 +39,7 @@ namespace BlacksmithWorkshopBusinessLogic.OfficePackage
CreateRow(new PdfRowParameters
{
Texts = new List { order.Id.ToString(),
-order.DateCreate.ToShortDateString(), order.ManufactureName, order.Sum.ToString() },
+order.DateCreate.ToShortDateString(), order.ManufactureName, order.Sum.ToString(), order.OrderStatus.ToString() },
Style = "Normal",
ParagraphAlignment = PdfParagraphAlignmentType.Left
});
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DataSources/BlacksmithWorkshopContracts.BusinessLogicsContracts.IReportLogic.datasource b/BlacksmithWorkshop/BlacksmithWorkshopContracts/DataSources/BlacksmithWorkshopContracts.BusinessLogicsContracts.IReportLogic.datasource
deleted file mode 100644
index 74859dd..0000000
--- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/DataSources/BlacksmithWorkshopContracts.BusinessLogicsContracts.IReportLogic.datasource
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
- BlacksmithWorkshopContracts.BusinessLogicsContracts.IReportLogic, BlacksmithWorkshopContracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
-
\ No newline at end of file
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs
index 7995d2a..617cb7e 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshopContracts/ViewModels/ReportOrdersViewModel.cs
@@ -12,6 +12,7 @@ namespace BlacksmithWorkshopContracts.ViewModels
public DateTime DateCreate { get; set; }
public string ManufactureName { get; set; } = string.Empty;
public double Sum { get; set; }
-
+ public string OrderStatus { get; set; } = string.Empty;
+
}
}
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs
index f2c2f52..970072e 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Implements/OrderStorage.cs
@@ -44,13 +44,13 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
public List GetFilteredList(OrderSearchModel model)
{
- if (!model.Id.HasValue)
+ if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
{
return new();
}
using var context = new BlacksmithWorkshopDatabase();
return context.Orders
- .ToList()
+ .Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo)
.Select(x => x.GetViewModel)
.ToList();
}
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs
index 96823e4..2e6d8b8 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Manufacture.cs
@@ -36,9 +36,9 @@ namespace BlacksmithWorkshopDatabaseImplement.Models
return _manufactureComponents;
}
}
- [ForeignKey("ProductId")]
+ [ForeignKey("ManufactureId")]
public virtual List Components { get; set; } = new();
- [ForeignKey("ProductId")]
+ [ForeignKey("ManufactureId")]
public virtual List Orders { get; set; } = new();
public static Manufacture Create(BlacksmithWorkshopDatabase context,
ManufactureBindingModel model)
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Order.cs b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Order.cs
index 9fc654b..e792845 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Order.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshopDatabaseImplement/Models/Order.cs
@@ -26,6 +26,7 @@ namespace BlacksmithWorkshopDatabaseImplement.Models
public DateTime? DateImplement { get; private set; }
public int Id { get; private set; }
+ //public virtual Manufacture Manufacture { get; set; }
public static Order? Create(OrderBindingModel model)
{
if (model == null)
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs
index 0c1a4e0..df61cb1 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshopFileImplement/Implements/OrderStorage.cs
@@ -39,7 +39,7 @@ namespace BlacksmithWorkshopFileImplement.Implements
}
return source.Orders
.FirstOrDefault(x =>
- (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
+ (model.Id.HasValue && x.Id == model.Id) && model.DateFrom <= x.DateCreate && x.DateCreate >= model.DateTo)?.GetViewModel;
}
public List GetFilteredList(OrderSearchModel model)
diff --git a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/OrderStorage.cs b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/OrderStorage.cs
index 5ce63e1..b31c2dd 100644
--- a/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/OrderStorage.cs
+++ b/BlacksmithWorkshop/BlacksmithWorkshopListImplement/Implements/OrderStorage.cs
@@ -59,7 +59,7 @@ namespace BlacksmithWorkshopListImplement.Implements
foreach (var order in _source.Orders)
{
- if (order.Id == model.Id)
+ if (order.Id == model.Id )/*|| model.DateFrom <= order.DateCreate && order.DateCreate <= model.DateTo)*/
{
result.Add(order.GetViewModel);
}