lab2_hard сделано и сдано
This commit is contained in:
parent
0a7ce63e60
commit
9d32a26b53
@ -10,6 +10,7 @@ using PrecastConcretePlantContracts.SearchModels;
|
|||||||
using PrecastConcretePlantContracts.StoragesContracts;
|
using PrecastConcretePlantContracts.StoragesContracts;
|
||||||
using PrecastConcretePlantContracts.ViewModels;
|
using PrecastConcretePlantContracts.ViewModels;
|
||||||
using PrecastConcretePlantDataModels.Enums;
|
using PrecastConcretePlantDataModels.Enums;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace PrecastConcretePlantBusinessLogic.BusinessLogics
|
namespace PrecastConcretePlantBusinessLogic.BusinessLogics
|
||||||
{
|
{
|
||||||
@ -17,12 +18,14 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics
|
|||||||
{
|
{
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly IOrderStorage _orderStorage;
|
private readonly IOrderStorage _orderStorage;
|
||||||
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage)
|
private readonly IShopStorage _shopStorage;
|
||||||
{
|
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage, IShopStorage shopStorage)
|
||||||
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_orderStorage = orderStorage;
|
_orderStorage = orderStorage;
|
||||||
}
|
_shopStorage = shopStorage;
|
||||||
public List<OrderViewModel>? ReadList(OrderSearchModel? model)
|
}
|
||||||
|
public List<OrderViewModel>? ReadList(OrderSearchModel? model)
|
||||||
{
|
{
|
||||||
_logger.LogInformation("ReadList. OrderId:{Id}", model?.Id);
|
_logger.LogInformation("ReadList. OrderId:{Id}", model?.Id);
|
||||||
var list = model == null ? _orderStorage.GetFullList() : _orderStorage.GetFilteredList(model);
|
var list = model == null ? _orderStorage.GetFullList() : _orderStorage.GetFilteredList(model);
|
||||||
@ -57,7 +60,23 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics
|
|||||||
}
|
}
|
||||||
public bool DeliveryOrder(OrderBindingModel model)
|
public bool DeliveryOrder(OrderBindingModel model)
|
||||||
{
|
{
|
||||||
return ChangeStatus(model, OrderStatus.Выдан);
|
var order = _orderStorage.GetElement(new OrderSearchModel
|
||||||
|
{
|
||||||
|
Id = model.Id,
|
||||||
|
});
|
||||||
|
if (order == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(order));
|
||||||
|
}
|
||||||
|
if (!_shopStorage.RestockingShops(new SupplyBindingModel
|
||||||
|
{
|
||||||
|
ReinforcedId = order.ReinforcedId,
|
||||||
|
count = order.Count
|
||||||
|
}))
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Недостаточно места в магазинах для поставки");
|
||||||
|
}
|
||||||
|
return ChangeStatus(model, OrderStatus.Выдан);
|
||||||
}
|
}
|
||||||
private void CheckModel(OrderBindingModel model, bool withParams = true)
|
private void CheckModel(OrderBindingModel model, bool withParams = true)
|
||||||
{
|
{
|
||||||
|
@ -118,8 +118,32 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogics
|
|||||||
}
|
}
|
||||||
shop.ShopReinforcedes.Add(model.ReinforcedId, (reinforsed, model.count));
|
shop.ShopReinforcedes.Add(model.ReinforcedId, (reinforsed, model.count));
|
||||||
}
|
}
|
||||||
|
_shopStorage.Update(new()
|
||||||
|
{
|
||||||
|
Id = shop.Id,
|
||||||
|
ShopName = shop.ShopName,
|
||||||
|
Adress = shop.Adress,
|
||||||
|
OpeningDate = shop.OpeningDate,
|
||||||
|
ShopReinforcedes = shop.ShopReinforcedes,
|
||||||
|
ReinforcedMaxCount = shop.ReinforcedMaxCount
|
||||||
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public bool Sale(SupplySearchModel model)
|
||||||
|
{
|
||||||
|
if (!model.ReinforcedId.HasValue || !model.Count.HasValue)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
_logger.LogInformation("Check reinforced count in all shops");
|
||||||
|
if (_shopStorage.Sale(model))
|
||||||
|
{
|
||||||
|
_logger.LogInformation("amount is enough. Selling sucsess");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
_logger.LogInformation("amount is insufficient");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
private void CheckModel(ShopBindingModel model, bool withParams = true)
|
private void CheckModel(ShopBindingModel model, bool withParams = true)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
|
@ -14,5 +14,6 @@ namespace PrecastConcretePlantContracts.BindingModels
|
|||||||
public string Adress { get; set; } = string.Empty;
|
public string Adress { get; set; } = string.Empty;
|
||||||
public DateTime OpeningDate { get; set; } = DateTime.Now;//Предполагается, что открытие магазина совпадает с добавлением его в Систему.
|
public DateTime OpeningDate { get; set; } = DateTime.Now;//Предполагается, что открытие магазина совпадает с добавлением его в Систему.
|
||||||
public Dictionary<int, (IReinforcedModel, int)> ShopReinforcedes { get; set; } = new();
|
public Dictionary<int, (IReinforcedModel, int)> ShopReinforcedes { get; set; } = new();
|
||||||
|
public int ReinforcedMaxCount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,5 +17,6 @@ namespace PrecastConcretePlantContracts.BusinessLogicsContracts
|
|||||||
bool Update(ShopBindingModel model);
|
bool Update(ShopBindingModel model);
|
||||||
bool Delete(ShopBindingModel model);
|
bool Delete(ShopBindingModel model);
|
||||||
bool MakeSupply(SupplyBindingModel model);
|
bool MakeSupply(SupplyBindingModel model);
|
||||||
|
bool Sale(SupplySearchModel model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace PrecastConcretePlantContracts.SearchModels
|
||||||
|
{
|
||||||
|
public class SupplySearchModel
|
||||||
|
{
|
||||||
|
public int? ReinforcedId { get; set; }
|
||||||
|
public int? Count { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -17,5 +17,7 @@ namespace PrecastConcretePlantContracts.StoragesContracts
|
|||||||
ShopViewModel? Insert(ShopBindingModel model);
|
ShopViewModel? Insert(ShopBindingModel model);
|
||||||
ShopViewModel? Update(ShopBindingModel model);
|
ShopViewModel? Update(ShopBindingModel model);
|
||||||
ShopViewModel? Delete(ShopBindingModel model);
|
ShopViewModel? Delete(ShopBindingModel model);
|
||||||
|
bool Sale(SupplySearchModel model);
|
||||||
|
bool RestockingShops(SupplyBindingModel model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,5 +18,7 @@ namespace PrecastConcretePlantContracts.ViewModels
|
|||||||
[DisplayName("Дата открытия")]
|
[DisplayName("Дата открытия")]
|
||||||
public DateTime OpeningDate { get; set; }
|
public DateTime OpeningDate { get; set; }
|
||||||
public Dictionary<int, (IReinforcedModel, int)> ShopReinforcedes { get; set; } = new();
|
public Dictionary<int, (IReinforcedModel, int)> ShopReinforcedes { get; set; } = new();
|
||||||
|
[DisplayName("Вместимость")]
|
||||||
|
public int ReinforcedMaxCount { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
using PrecastConcretePlantDataModels;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PrecastConcretePlantDataModels.Models
|
|
||||||
{
|
|
||||||
public interface IComponentModel : IId
|
|
||||||
{
|
|
||||||
string ComponentName { get; }
|
|
||||||
double Cost { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
using PrecastConcretePlantDataModels.Enums;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PrecastConcretePlantDataModels.Models
|
|
||||||
{
|
|
||||||
public interface IOrderModel : IId
|
|
||||||
{
|
|
||||||
int ReinforcedId { get; }
|
|
||||||
int Count { get; }
|
|
||||||
double Sum { get; }
|
|
||||||
OrderStatus Status { get; }
|
|
||||||
DateTime DateCreate { get; }
|
|
||||||
DateTime? DateImplement { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using PrecastConcretePlantDataModels.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace PrecastConcretePlantDataModels.Models
|
|
||||||
{
|
|
||||||
public interface IReinforcedModel : IId
|
|
||||||
{
|
|
||||||
string ReinforcedName { get; }
|
|
||||||
double Price { get; }
|
|
||||||
Dictionary<int, (IComponentModel, int)> ReinforcedComponents { get; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -14,5 +14,6 @@ namespace PrecastConcretePlantDataModels.Models
|
|||||||
string Adress { get; }
|
string Adress { get; }
|
||||||
DateTime OpeningDate { get; }
|
DateTime OpeningDate { get; }
|
||||||
Dictionary<int, (IReinforcedModel, int)> ShopReinforcedes { get; }
|
Dictionary<int, (IReinforcedModel, int)> ShopReinforcedes { get; }
|
||||||
|
int ReinforcedMaxCount { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -8,46 +8,50 @@ using System.Xml.Linq;
|
|||||||
|
|
||||||
namespace PrecastConcretePlantFileImplement
|
namespace PrecastConcretePlantFileImplement
|
||||||
{
|
{
|
||||||
public class DataFileSingleton
|
public class DataFileSingleton
|
||||||
{
|
{
|
||||||
private static DataFileSingleton? instance;
|
private static DataFileSingleton? instance;
|
||||||
private readonly string ComponentFileName = "Component.xml";
|
private readonly string ComponentFileName = "Component.xml";
|
||||||
private readonly string OrderFileName = "Order.xml";
|
private readonly string OrderFileName = "Order.xml";
|
||||||
private readonly string ReinforcedFileName = "Reinforced.xml";
|
private readonly string ReinforcedFileName = "Reinforced.xml";
|
||||||
public List<Component> Components { get; private set; }
|
private readonly string ShopFileName = "Shop.xml";
|
||||||
public List<Order> Orders { get; private set; }
|
public List<Component> Components { get; private set; }
|
||||||
public List<Reinforced> Reinforceds { get; private set; }
|
public List<Order> Orders { get; private set; }
|
||||||
public static DataFileSingleton GetInstance()
|
public List<Reinforced> Reinforceds { get; private set; }
|
||||||
{
|
public List<Shop> Shops { get; private set; }
|
||||||
if (instance == null)
|
public static DataFileSingleton GetInstance()
|
||||||
{
|
{
|
||||||
instance = new DataFileSingleton();
|
if (instance == null)
|
||||||
}
|
{
|
||||||
return instance;
|
instance = new DataFileSingleton();
|
||||||
}
|
}
|
||||||
public void SaveComponents() => SaveData(Components, ComponentFileName, "Components", x => x.GetXElement);
|
return instance;
|
||||||
public void SaveReinforceds() => SaveData(Reinforceds, ReinforcedFileName, "Reinforceds", x => x.GetXElement);
|
}
|
||||||
public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement);
|
public void SaveComponents() => SaveData(Components, ComponentFileName, "Components", x => x.GetXElement);
|
||||||
private DataFileSingleton()
|
public void SaveReinforceds() => SaveData(Reinforceds, ReinforcedFileName, "Reinforceds", x => x.GetXElement);
|
||||||
{
|
public void SaveOrders() => SaveData(Orders, OrderFileName, "Orders", x => x.GetXElement);
|
||||||
Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!;
|
public void SaveShops() => SaveData(Shops, ShopFileName, "Shops", x => x.GetXElement);
|
||||||
Reinforceds = LoadData(ReinforcedFileName, "Reinforced", x => Reinforced.Create(x)!)!;
|
private DataFileSingleton()
|
||||||
Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!;
|
{
|
||||||
}
|
Components = LoadData(ComponentFileName, "Component", x => Component.Create(x)!)!;
|
||||||
private static List<T>? LoadData<T>(string filename, string xmlNodeName, Func<XElement, T> selectFunction)
|
Reinforceds = LoadData(ReinforcedFileName, "Reinforced", x => Reinforced.Create(x)!)!;
|
||||||
{
|
Orders = LoadData(OrderFileName, "Order", x => Order.Create(x)!)!;
|
||||||
if (File.Exists(filename))
|
Shops = LoadData(ShopFileName, "Shop", x => Shop.Create(x)!)!;
|
||||||
{
|
}
|
||||||
return XDocument.Load(filename)?.Root?.Elements(xmlNodeName)?.Select(selectFunction)?.ToList();
|
private static List<T>? LoadData<T>(string filename, string xmlNodeName, Func<XElement, T> selectFunction)
|
||||||
}
|
{
|
||||||
return new List<T>();
|
if (File.Exists(filename))
|
||||||
}
|
{
|
||||||
private static void SaveData<T>(List<T> data, string filename, string xmlNodeName, Func<T, XElement> selectFunction)
|
return XDocument.Load(filename)?.Root?.Elements(xmlNodeName)?.Select(selectFunction)?.ToList();
|
||||||
{
|
}
|
||||||
if (data != null)
|
return new List<T>();
|
||||||
{
|
}
|
||||||
new XDocument(new XElement(xmlNodeName, data.Select(selectFunction).ToArray())).Save(filename);
|
private static void SaveData<T>(List<T> data, string filename, string xmlNodeName, Func<T, XElement> selectFunction)
|
||||||
}
|
{
|
||||||
}
|
if (data != null)
|
||||||
}
|
{
|
||||||
|
new XDocument(new XElement(xmlNodeName, data.Select(selectFunction).ToArray())).Save(filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -11,69 +11,69 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace PrecastConcretePlantFileImplement.Implements
|
namespace PrecastConcretePlantFileImplement.Implements
|
||||||
{
|
{
|
||||||
public class ComponentStorage : IComponentStorage
|
public class ComponentStorage : IComponentStorage
|
||||||
{
|
{
|
||||||
private readonly DataFileSingleton source;
|
private readonly DataFileSingleton source;
|
||||||
public ComponentStorage()
|
public ComponentStorage()
|
||||||
{
|
{
|
||||||
source = DataFileSingleton.GetInstance();
|
source = DataFileSingleton.GetInstance();
|
||||||
}
|
}
|
||||||
public List<ComponentViewModel> GetFullList()
|
public List<ComponentViewModel> GetFullList()
|
||||||
{
|
{
|
||||||
return source.Components.Select(x => x.GetViewModel).ToList();
|
return source.Components.Select(x => x.GetViewModel).ToList();
|
||||||
}
|
}
|
||||||
public List<ComponentViewModel> GetFilteredList(ComponentSearchModel model)
|
public List<ComponentViewModel> GetFilteredList(ComponentSearchModel model)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(model.ComponentName))
|
if (string.IsNullOrEmpty(model.ComponentName))
|
||||||
{
|
{
|
||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
return source.Components.Where(x => x.ComponentName.Contains(model.ComponentName)).Select(x => x.GetViewModel).ToList();
|
return source.Components.Where(x => x.ComponentName.Contains(model.ComponentName)).Select(x => x.GetViewModel).ToList();
|
||||||
}
|
}
|
||||||
public ComponentViewModel? GetElement(ComponentSearchModel model)
|
public ComponentViewModel? GetElement(ComponentSearchModel model)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(model.ComponentName) && !model.Id.HasValue)
|
if (string.IsNullOrEmpty(model.ComponentName) && !model.Id.HasValue)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return source.Components.FirstOrDefault(x =>
|
return source.Components.FirstOrDefault(x =>
|
||||||
(!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName == model.ComponentName) ||
|
(!string.IsNullOrEmpty(model.ComponentName) && x.ComponentName == model.ComponentName) ||
|
||||||
(model.Id.HasValue && x.Id == model.Id))
|
(model.Id.HasValue && x.Id == model.Id))
|
||||||
?.GetViewModel;
|
?.GetViewModel;
|
||||||
}
|
}
|
||||||
public ComponentViewModel? Insert(ComponentBindingModel model)
|
public ComponentViewModel? Insert(ComponentBindingModel model)
|
||||||
{
|
{
|
||||||
model.Id = source.Components.Count > 0 ? source.Components.Max(x => x.Id) + 1 : 1;
|
model.Id = source.Components.Count > 0 ? source.Components.Max(x => x.Id) + 1 : 1;
|
||||||
var newComponent = Component.Create(model);
|
var newComponent = Component.Create(model);
|
||||||
if (newComponent == null)
|
if (newComponent == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
source.Components.Add(newComponent);
|
source.Components.Add(newComponent);
|
||||||
source.SaveComponents();
|
source.SaveComponents();
|
||||||
return newComponent.GetViewModel;
|
return newComponent.GetViewModel;
|
||||||
}
|
}
|
||||||
public ComponentViewModel? Update(ComponentBindingModel model)
|
public ComponentViewModel? Update(ComponentBindingModel model)
|
||||||
{
|
{
|
||||||
var component = source.Components.FirstOrDefault(x => x.Id == model.Id);
|
var component = source.Components.FirstOrDefault(x => x.Id == model.Id);
|
||||||
if (component == null)
|
if (component == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
component.Update(model);
|
component.Update(model);
|
||||||
source.SaveComponents();
|
source.SaveComponents();
|
||||||
return component.GetViewModel;
|
return component.GetViewModel;
|
||||||
}
|
}
|
||||||
public ComponentViewModel? Delete(ComponentBindingModel model)
|
public ComponentViewModel? Delete(ComponentBindingModel model)
|
||||||
{
|
{
|
||||||
var element = source.Components.FirstOrDefault(x => x.Id == model.Id);
|
var element = source.Components.FirstOrDefault(x => x.Id == model.Id);
|
||||||
if (element != null)
|
if (element != null)
|
||||||
{
|
{
|
||||||
source.Components.Remove(element);
|
source.Components.Remove(element);
|
||||||
source.SaveComponents();
|
source.SaveComponents();
|
||||||
return element.GetViewModel;
|
return element.GetViewModel;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,83 +11,83 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace PrecastConcretePlantFileImplement.Implements
|
namespace PrecastConcretePlantFileImplement.Implements
|
||||||
{
|
{
|
||||||
public class OrderStorage : IOrderStorage
|
public class OrderStorage : IOrderStorage
|
||||||
{
|
{
|
||||||
private readonly DataFileSingleton source;
|
private readonly DataFileSingleton source;
|
||||||
public OrderStorage()
|
public OrderStorage()
|
||||||
{
|
{
|
||||||
source = DataFileSingleton.GetInstance();
|
source = DataFileSingleton.GetInstance();
|
||||||
}
|
}
|
||||||
public List<OrderViewModel> GetFullList()
|
public List<OrderViewModel> GetFullList()
|
||||||
{
|
{
|
||||||
return source.Orders.Select(x => AttachReinforcedName(x.GetViewModel)).ToList();
|
return source.Orders.Select(x => AttachReinforcedName(x.GetViewModel)).ToList();
|
||||||
}
|
}
|
||||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||||
{
|
{
|
||||||
//Метод полностью может быть заменён следующим. Практическая польза незначительна
|
//Метод полностью может быть заменён следующим. Практическая польза незначительна
|
||||||
if (!model.Id.HasValue)
|
if (!model.Id.HasValue)
|
||||||
{
|
{
|
||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
return source.Orders.Where(x => x.Id == model.Id).Select(x => AttachReinforcedName(x.GetViewModel)).ToList();
|
return source.Orders.Where(x => x.Id == model.Id).Select(x => AttachReinforcedName(x.GetViewModel)).ToList();
|
||||||
}
|
}
|
||||||
public OrderViewModel? GetElement(OrderSearchModel model)
|
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||||
{
|
{
|
||||||
if (!model.Id.HasValue)
|
if (!model.Id.HasValue)
|
||||||
{
|
{
|
||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
return AttachReinforcedName(source.Orders.FirstOrDefault(x => x.Id == model.Id)?.GetViewModel);
|
return AttachReinforcedName(source.Orders.FirstOrDefault(x => x.Id == model.Id)?.GetViewModel);
|
||||||
}
|
}
|
||||||
public OrderViewModel? Insert(OrderBindingModel model)
|
public OrderViewModel? Insert(OrderBindingModel model)
|
||||||
{
|
{
|
||||||
model.Id = source.Orders.Count > 0 ? source.Orders.Max(x => x.Id) + 1 : 1;
|
model.Id = source.Orders.Count > 0 ? source.Orders.Max(x => x.Id) + 1 : 1;
|
||||||
var newOrder = Order.Create(model);
|
var newOrder = Order.Create(model);
|
||||||
if (newOrder == null)
|
if (newOrder == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
source.Orders.Add(newOrder);
|
source.Orders.Add(newOrder);
|
||||||
source.SaveOrders();
|
source.SaveOrders();
|
||||||
return AttachReinforcedName(newOrder.GetViewModel);
|
return AttachReinforcedName(newOrder.GetViewModel);
|
||||||
}
|
}
|
||||||
public OrderViewModel? Update(OrderBindingModel model)
|
public OrderViewModel? Update(OrderBindingModel model)
|
||||||
{
|
{
|
||||||
var order = source.Orders.FirstOrDefault(x => x.Id == model.Id);
|
var order = source.Orders.FirstOrDefault(x => x.Id == model.Id);
|
||||||
if (order == null)
|
if (order == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
order.Update(model);
|
order.Update(model);
|
||||||
source.SaveOrders();
|
source.SaveOrders();
|
||||||
return AttachReinforcedName(order.GetViewModel);
|
return AttachReinforcedName(order.GetViewModel);
|
||||||
}
|
}
|
||||||
public OrderViewModel? Delete(OrderBindingModel model)
|
public OrderViewModel? Delete(OrderBindingModel model)
|
||||||
{
|
{
|
||||||
var order = source.Orders.FirstOrDefault(x => x.Id == model.Id);
|
var order = source.Orders.FirstOrDefault(x => x.Id == model.Id);
|
||||||
if (order != null)
|
if (order != null)
|
||||||
{
|
{
|
||||||
source.Orders.Remove(order);
|
source.Orders.Remove(order);
|
||||||
source.SaveOrders();
|
source.SaveOrders();
|
||||||
return AttachReinforcedName(order.GetViewModel);
|
return AttachReinforcedName(order.GetViewModel);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
private OrderViewModel AttachReinforcedName(OrderViewModel? model)
|
private OrderViewModel AttachReinforcedName(OrderViewModel? model)
|
||||||
{
|
{
|
||||||
//Из всех мест, это выглядит наиболее подходящим, для данной манипуляции.
|
//Из всех мест, это выглядит наиболее подходящим, для данной манипуляции.
|
||||||
//При расположении ниже нарушится целостность данных
|
//При расположении ниже нарушится целостность данных
|
||||||
//При расположении выше будет нарушен принцип разделения уровней
|
//При расположении выше будет нарушен принцип разделения уровней
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var reinforced = source.Reinforceds.FirstOrDefault(x => x.Id == model.ReinforcedId);
|
var reinforced = source.Reinforceds.FirstOrDefault(x => x.Id == model.ReinforcedId);
|
||||||
if (reinforced != null)
|
if (reinforced != null)
|
||||||
{
|
{
|
||||||
model.ReinforcedName = reinforced.ReinforcedName;
|
model.ReinforcedName = reinforced.ReinforcedName;
|
||||||
}
|
}
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,69 +11,69 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace PrecastConcretePlantFileImplement.Implements
|
namespace PrecastConcretePlantFileImplement.Implements
|
||||||
{
|
{
|
||||||
public class ReinforcedStorage : IReinforcedStorage
|
public class ReinforcedStorage : IReinforcedStorage
|
||||||
{
|
{
|
||||||
private readonly DataFileSingleton source;
|
private readonly DataFileSingleton source;
|
||||||
public ReinforcedStorage()
|
public ReinforcedStorage()
|
||||||
{
|
{
|
||||||
source = DataFileSingleton.GetInstance();
|
source = DataFileSingleton.GetInstance();
|
||||||
}
|
}
|
||||||
public List<ReinforcedViewModel> GetFullList()
|
public List<ReinforcedViewModel> GetFullList()
|
||||||
{
|
{
|
||||||
return source.Reinforceds.Select(x => x.GetViewModel).ToList();
|
return source.Reinforceds.Select(x => x.GetViewModel).ToList();
|
||||||
}
|
}
|
||||||
public List<ReinforcedViewModel> GetFilteredList(ReinforcedSearchModel model)
|
public List<ReinforcedViewModel> GetFilteredList(ReinforcedSearchModel model)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(model.ReinforcedName))
|
if (string.IsNullOrEmpty(model.ReinforcedName))
|
||||||
{
|
{
|
||||||
return new();
|
return new();
|
||||||
}
|
}
|
||||||
return source.Reinforceds.Where(x => x.ReinforcedName.Contains(model.ReinforcedName)).Select(x => x.GetViewModel).ToList();
|
return source.Reinforceds.Where(x => x.ReinforcedName.Contains(model.ReinforcedName)).Select(x => x.GetViewModel).ToList();
|
||||||
}
|
}
|
||||||
public ReinforcedViewModel? GetElement(ReinforcedSearchModel model)
|
public ReinforcedViewModel? GetElement(ReinforcedSearchModel model)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(model.ReinforcedName) && !model.Id.HasValue)
|
if (string.IsNullOrEmpty(model.ReinforcedName) && !model.Id.HasValue)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return source.Reinforceds.FirstOrDefault(x =>
|
return source.Reinforceds.FirstOrDefault(x =>
|
||||||
(!string.IsNullOrEmpty(model.ReinforcedName) && x.ReinforcedName == model.ReinforcedName) ||
|
(!string.IsNullOrEmpty(model.ReinforcedName) && x.ReinforcedName == model.ReinforcedName) ||
|
||||||
(model.Id.HasValue && x.Id == model.Id))
|
(model.Id.HasValue && x.Id == model.Id))
|
||||||
?.GetViewModel;
|
?.GetViewModel;
|
||||||
}
|
}
|
||||||
public ReinforcedViewModel? Insert(ReinforcedBindingModel model)
|
public ReinforcedViewModel? Insert(ReinforcedBindingModel model)
|
||||||
{
|
{
|
||||||
model.Id = source.Reinforceds.Count > 0 ? source.Reinforceds.Max(x => x.Id) + 1 : 1;
|
model.Id = source.Reinforceds.Count > 0 ? source.Reinforceds.Max(x => x.Id) + 1 : 1;
|
||||||
var newReinforced = Reinforced.Create(model);
|
var newReinforced = Reinforced.Create(model);
|
||||||
if (newReinforced == null)
|
if (newReinforced == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
source.Reinforceds.Add(newReinforced);
|
source.Reinforceds.Add(newReinforced);
|
||||||
source.SaveReinforceds();
|
source.SaveReinforceds();
|
||||||
return newReinforced.GetViewModel;
|
return newReinforced.GetViewModel;
|
||||||
}
|
}
|
||||||
public ReinforcedViewModel? Update(ReinforcedBindingModel model)
|
public ReinforcedViewModel? Update(ReinforcedBindingModel model)
|
||||||
{
|
{
|
||||||
var reinforced = source.Reinforceds.FirstOrDefault(x => x.Id == model.Id);
|
var reinforced = source.Reinforceds.FirstOrDefault(x => x.Id == model.Id);
|
||||||
if (reinforced == null)
|
if (reinforced == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
reinforced.Update(model);
|
reinforced.Update(model);
|
||||||
source.SaveReinforceds();
|
source.SaveReinforceds();
|
||||||
return reinforced.GetViewModel;
|
return reinforced.GetViewModel;
|
||||||
}
|
}
|
||||||
public ReinforcedViewModel? Delete(ReinforcedBindingModel model)
|
public ReinforcedViewModel? Delete(ReinforcedBindingModel model)
|
||||||
{
|
{
|
||||||
var reinforced = source.Reinforceds.FirstOrDefault(x => x.Id == model.Id);
|
var reinforced = source.Reinforceds.FirstOrDefault(x => x.Id == model.Id);
|
||||||
if (reinforced != null)
|
if (reinforced != null)
|
||||||
{
|
{
|
||||||
source.Reinforceds.Remove(reinforced);
|
source.Reinforceds.Remove(reinforced);
|
||||||
source.SaveReinforceds();
|
source.SaveReinforceds();
|
||||||
return reinforced.GetViewModel;
|
return reinforced.GetViewModel;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,141 @@
|
|||||||
|
using PrecastConcretePlantContracts.BindingModels;
|
||||||
|
using PrecastConcretePlantContracts.SearchModels;
|
||||||
|
using PrecastConcretePlantContracts.StoragesContracts;
|
||||||
|
using PrecastConcretePlantContracts.ViewModels;
|
||||||
|
using PrecastConcretePlantFileImplement.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace PrecastConcretePlantFileImplement.Implements
|
||||||
|
{
|
||||||
|
public class ShopStorage : IShopStorage
|
||||||
|
{
|
||||||
|
private readonly DataFileSingleton source;
|
||||||
|
public ShopStorage()
|
||||||
|
{
|
||||||
|
source = DataFileSingleton.GetInstance();
|
||||||
|
}
|
||||||
|
public List<ShopViewModel> GetFullList()
|
||||||
|
{
|
||||||
|
return source.Shops.Select(x => x.GetViewModel).ToList();
|
||||||
|
}
|
||||||
|
public List<ShopViewModel> GetFilteredList(ShopSearchModel model)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(model.ShopName))
|
||||||
|
{
|
||||||
|
return new();
|
||||||
|
}
|
||||||
|
return source.Shops.Where(x => x.ShopName.Contains(model.ShopName)).Select(x => x.GetViewModel).ToList();
|
||||||
|
}
|
||||||
|
public ShopViewModel? GetElement(ShopSearchModel model)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(model.ShopName) && !model.Id.HasValue)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return source.Shops.FirstOrDefault(x =>
|
||||||
|
(!string.IsNullOrEmpty(model.ShopName) && x.ShopName == model.ShopName) ||
|
||||||
|
(model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
|
||||||
|
}
|
||||||
|
public ShopViewModel? Insert(ShopBindingModel model)
|
||||||
|
{
|
||||||
|
model.Id = source.Shops.Count > 0 ? source.Shops.Max(x => x.Id) + 1 : 1;
|
||||||
|
var newShop = Shop.Create(model);
|
||||||
|
if (newShop == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
source.Shops.Add(newShop);
|
||||||
|
source.SaveShops();
|
||||||
|
return newShop.GetViewModel;
|
||||||
|
}
|
||||||
|
public ShopViewModel? Update(ShopBindingModel model)
|
||||||
|
{
|
||||||
|
var shop = source.Shops.FirstOrDefault(x => x.Id == model.Id);
|
||||||
|
if (shop == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
shop.Update(model);
|
||||||
|
source.SaveShops();
|
||||||
|
return shop.GetViewModel;
|
||||||
|
}
|
||||||
|
public ShopViewModel? Delete(ShopBindingModel model)
|
||||||
|
{
|
||||||
|
var shop = source.Shops.FirstOrDefault(x => x.Id == model.Id);
|
||||||
|
if (shop != null)
|
||||||
|
{
|
||||||
|
source.Shops.Remove(shop);
|
||||||
|
source.SaveShops();
|
||||||
|
return shop.GetViewModel;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
public bool Sale(SupplySearchModel model)
|
||||||
|
{
|
||||||
|
if (model == null || !model.ReinforcedId.HasValue || !model.Count.HasValue)
|
||||||
|
return false;
|
||||||
|
int remainingSpace = source.Shops.Select(x => x.Reinforcedes.ContainsKey(model.ReinforcedId.Value) ? x.Reinforcedes[model.ReinforcedId.Value] : 0).Sum();
|
||||||
|
if (remainingSpace < model.Count)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var shops = source.Shops.Where(x => x.Reinforcedes.ContainsKey(model.ReinforcedId.Value)).OrderByDescending(x => x.Reinforcedes[model.ReinforcedId.Value]).ToList();
|
||||||
|
foreach (var shop in shops)
|
||||||
|
{
|
||||||
|
int residue = model.Count.Value - shop.Reinforcedes[model.ReinforcedId.Value];
|
||||||
|
if (residue > 0)
|
||||||
|
{
|
||||||
|
shop.Reinforcedes.Remove(model.ReinforcedId.Value);
|
||||||
|
shop.UpdateContent();
|
||||||
|
model.Count = residue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (residue == 0)
|
||||||
|
shop.Reinforcedes.Remove(model.ReinforcedId.Value);
|
||||||
|
else
|
||||||
|
shop.Reinforcedes[model.ReinforcedId.Value] = -residue;
|
||||||
|
shop.UpdateContent();
|
||||||
|
source.SaveShops();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
source.SaveShops();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public bool RestockingShops(SupplyBindingModel model)
|
||||||
|
{
|
||||||
|
if (model == null || source.Shops.Select(x => x.ReinforcedMaxCount - x.ShopReinforcedes.Select(y => y.Value.Item2).Sum()).Sum() < model.count)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
foreach (Shop shop in source.Shops)
|
||||||
|
{
|
||||||
|
int difference = shop.ReinforcedMaxCount - shop.ShopReinforcedes.Select(x => x.Value.Item2).Sum();
|
||||||
|
if (difference <= 0)
|
||||||
|
continue;
|
||||||
|
int refill = Math.Min(difference, model.count);
|
||||||
|
model.count -= refill;
|
||||||
|
if (shop.Reinforcedes.ContainsKey(model.ReinforcedId))
|
||||||
|
{
|
||||||
|
shop.Reinforcedes[model.ReinforcedId] += refill;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
shop.Reinforcedes.Add(model.ReinforcedId, refill);
|
||||||
|
}
|
||||||
|
shop.UpdateContent();
|
||||||
|
if (model.count == 0)
|
||||||
|
{
|
||||||
|
source.SaveShops();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new ArgumentException("Непредвиденная ошибка при пополнении магазинов");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -11,55 +11,55 @@ using System.Xml.Linq;
|
|||||||
|
|
||||||
namespace PrecastConcretePlantFileImplement.Models
|
namespace PrecastConcretePlantFileImplement.Models
|
||||||
{
|
{
|
||||||
public class Component : IComponentModel
|
public class Component : IComponentModel
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public string ComponentName { get; private set; } = string.Empty;
|
public string ComponentName { get; private set; } = string.Empty;
|
||||||
public double Cost { get; set; }
|
public double Cost { get; set; }
|
||||||
public static Component? Create(ComponentBindingModel model)
|
public static Component? Create(ComponentBindingModel model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new Component()
|
return new Component()
|
||||||
{
|
{
|
||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
ComponentName = model.ComponentName,
|
ComponentName = model.ComponentName,
|
||||||
Cost = model.Cost
|
Cost = model.Cost
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public static Component? Create(XElement element)
|
public static Component? Create(XElement element)
|
||||||
{
|
{
|
||||||
if (element == null)
|
if (element == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new Component()
|
return new Component()
|
||||||
{
|
{
|
||||||
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
|
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
|
||||||
ComponentName = element.Element("ComponentName")!.Value,
|
ComponentName = element.Element("ComponentName")!.Value,
|
||||||
Cost = Convert.ToDouble(element.Element("Cost")!.Value)
|
Cost = Convert.ToDouble(element.Element("Cost")!.Value)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public void Update(ComponentBindingModel model)
|
public void Update(ComponentBindingModel model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ComponentName = model.ComponentName;
|
ComponentName = model.ComponentName;
|
||||||
Cost = model.Cost;
|
Cost = model.Cost;
|
||||||
}
|
}
|
||||||
public ComponentViewModel GetViewModel => new()
|
public ComponentViewModel GetViewModel => new()
|
||||||
{
|
{
|
||||||
Id = Id,
|
Id = Id,
|
||||||
ComponentName = ComponentName,
|
ComponentName = ComponentName,
|
||||||
Cost = Cost
|
Cost = Cost
|
||||||
};
|
};
|
||||||
public XElement GetXElement => new("Component",
|
public XElement GetXElement => new("Component",
|
||||||
new XAttribute("Id", Id),
|
new XAttribute("Id", Id),
|
||||||
new XElement("ComponentName", ComponentName),
|
new XElement("ComponentName", ComponentName),
|
||||||
new XElement("Cost", Cost.ToString()));
|
new XElement("Cost", Cost.ToString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,78 +11,78 @@ using System.Xml.Linq;
|
|||||||
|
|
||||||
namespace PrecastConcretePlantFileImplement.Models
|
namespace PrecastConcretePlantFileImplement.Models
|
||||||
{
|
{
|
||||||
public class Order : IOrderModel
|
public class Order : IOrderModel
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public int ReinforcedId { get; private set; }
|
public int ReinforcedId { get; private set; }
|
||||||
public int Count { get; private set; }
|
public int Count { get; private set; }
|
||||||
public double Sum { get; private set; }
|
public double Sum { get; private set; }
|
||||||
public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен;
|
public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен;
|
||||||
public DateTime DateCreate { get; private set; } = DateTime.Now;
|
public DateTime DateCreate { get; private set; } = DateTime.Now;
|
||||||
public DateTime? DateImplement { get; private set; }
|
public DateTime? DateImplement { get; private set; }
|
||||||
public static Order? Create(OrderBindingModel? model)
|
public static Order? Create(OrderBindingModel? model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new Order()
|
return new Order()
|
||||||
{
|
{
|
||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
ReinforcedId = model.ReinforcedId,
|
ReinforcedId = model.ReinforcedId,
|
||||||
Count = model.Count,
|
Count = model.Count,
|
||||||
Sum = model.Sum,
|
Sum = model.Sum,
|
||||||
Status = model.Status,
|
Status = model.Status,
|
||||||
DateCreate = model.DateCreate,
|
DateCreate = model.DateCreate,
|
||||||
DateImplement = model.DateImplement,
|
DateImplement = model.DateImplement,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public static Order? Create(XElement element)
|
public static Order? Create(XElement element)
|
||||||
{
|
{
|
||||||
if (element == null)
|
if (element == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
string dateImplement = element.Element("DateImplement")!.Value;
|
string dateImplement = element.Element("DateImplement")!.Value;
|
||||||
return new Order()
|
return new Order()
|
||||||
{
|
{
|
||||||
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
|
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
|
||||||
ReinforcedId = Convert.ToInt32(element.Element("ReinforcedId")!.Value),
|
ReinforcedId = Convert.ToInt32(element.Element("ReinforcedId")!.Value),
|
||||||
Count = Convert.ToInt32(element.Element("Count")!.Value),
|
Count = Convert.ToInt32(element.Element("Count")!.Value),
|
||||||
Sum = Convert.ToInt32(element.Element("Sum")!.Value),
|
Sum = Convert.ToInt32(element.Element("Sum")!.Value),
|
||||||
Status = (OrderStatus)(Enum.Parse(typeof(OrderStatus), element.Element("Status")!.Value)),
|
Status = (OrderStatus)(Enum.Parse(typeof(OrderStatus), element.Element("Status")!.Value)),
|
||||||
DateCreate = Convert.ToDateTime(element.Element("DateCreate")!.Value),
|
DateCreate = Convert.ToDateTime(element.Element("DateCreate")!.Value),
|
||||||
DateImplement = string.IsNullOrEmpty(dateImplement) ? null : Convert.ToDateTime(dateImplement)
|
DateImplement = string.IsNullOrEmpty(dateImplement) ? null : Convert.ToDateTime(dateImplement)
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
public void Update(OrderBindingModel model)
|
public void Update(OrderBindingModel model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Status = model.Status;
|
Status = model.Status;
|
||||||
DateImplement = model.DateImplement;
|
DateImplement = model.DateImplement;
|
||||||
}
|
}
|
||||||
public OrderViewModel GetViewModel => new()
|
public OrderViewModel GetViewModel => new()
|
||||||
{
|
{
|
||||||
//ReinforcedName ,будет определено далее, в классе хранилища, так как это более рационально
|
//ReinforcedName ,будет определено далее, в классе хранилища, так как это более рационально
|
||||||
Id = Id,
|
Id = Id,
|
||||||
ReinforcedId = ReinforcedId,
|
ReinforcedId = ReinforcedId,
|
||||||
Count = Count,
|
Count = Count,
|
||||||
Sum = Sum,
|
Sum = Sum,
|
||||||
Status = Status,
|
Status = Status,
|
||||||
DateCreate = DateCreate,
|
DateCreate = DateCreate,
|
||||||
DateImplement = DateImplement,
|
DateImplement = DateImplement,
|
||||||
};
|
};
|
||||||
public XElement GetXElement => new("Order",
|
public XElement GetXElement => new("Order",
|
||||||
new XAttribute("Id", Id),
|
new XAttribute("Id", Id),
|
||||||
new XElement("ReinforcedId", ReinforcedId.ToString()),
|
new XElement("ReinforcedId", ReinforcedId.ToString()),
|
||||||
new XElement("Count", Count.ToString()),
|
new XElement("Count", Count.ToString()),
|
||||||
new XElement("Sum", Sum.ToString()),
|
new XElement("Sum", Sum.ToString()),
|
||||||
new XElement("Status", Status.ToString()),
|
new XElement("Status", Status.ToString()),
|
||||||
new XElement("DateCreate", DateCreate.ToString()),
|
new XElement("DateCreate", DateCreate.ToString()),
|
||||||
new XElement("DateImplement", DateImplement.ToString()));
|
new XElement("DateImplement", DateImplement.ToString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,79 +10,79 @@ using System.Xml.Linq;
|
|||||||
|
|
||||||
namespace PrecastConcretePlantFileImplement.Models
|
namespace PrecastConcretePlantFileImplement.Models
|
||||||
{
|
{
|
||||||
public class Reinforced : IReinforcedModel
|
public class Reinforced : IReinforcedModel
|
||||||
{
|
{
|
||||||
public int Id { get; private set; }
|
public int Id { get; private set; }
|
||||||
public string ReinforcedName { get; private set; } = string.Empty;
|
public string ReinforcedName { get; private set; } = string.Empty;
|
||||||
public double Price { get; private set; }
|
public double Price { get; private set; }
|
||||||
public Dictionary<int, int> Components { get; private set; } = new();
|
public Dictionary<int, int> Components { get; private set; } = new();
|
||||||
private Dictionary<int, (IComponentModel, int)>? _reinforcedComponents = null;
|
private Dictionary<int, (IComponentModel, int)>? _reinforcedComponents = null;
|
||||||
public Dictionary<int, (IComponentModel, int)> ReinforcedComponents
|
public Dictionary<int, (IComponentModel, int)> ReinforcedComponents
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_reinforcedComponents == null)
|
if (_reinforcedComponents == null)
|
||||||
{
|
{
|
||||||
var source = DataFileSingleton.GetInstance();
|
var source = DataFileSingleton.GetInstance();
|
||||||
_reinforcedComponents = Components.ToDictionary(x => x.Key, y => ((source.Components.FirstOrDefault(z => z.Id == y.Key) as IComponentModel)!, y.Value));
|
_reinforcedComponents = Components.ToDictionary(x => x.Key, y => ((source.Components.FirstOrDefault(z => z.Id == y.Key) as IComponentModel)!, y.Value));
|
||||||
}
|
}
|
||||||
return _reinforcedComponents;
|
return _reinforcedComponents;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static Reinforced? Create(ReinforcedBindingModel model)
|
public static Reinforced? Create(ReinforcedBindingModel model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new Reinforced()
|
return new Reinforced()
|
||||||
{
|
{
|
||||||
Id = model.Id,
|
Id = model.Id,
|
||||||
ReinforcedName = model.ReinforcedName,
|
ReinforcedName = model.ReinforcedName,
|
||||||
Price = model.Price,
|
Price = model.Price,
|
||||||
Components = model.ReinforcedComponents.ToDictionary(x => x.Key, x => x.Value.Item2)
|
Components = model.ReinforcedComponents.ToDictionary(x => x.Key, x => x.Value.Item2)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public static Reinforced? Create(XElement element)
|
public static Reinforced? Create(XElement element)
|
||||||
{
|
{
|
||||||
if (element == null)
|
if (element == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new Reinforced()
|
return new Reinforced()
|
||||||
{
|
{
|
||||||
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
|
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
|
||||||
ReinforcedName = element.Element("ReinforcedName")!.Value,
|
ReinforcedName = element.Element("ReinforcedName")!.Value,
|
||||||
Price = Convert.ToDouble(element.Element("Price")!.Value),
|
Price = Convert.ToDouble(element.Element("Price")!.Value),
|
||||||
Components = element.Element("ReinforcedComponents")!.Elements("ReinforcedComponent").ToDictionary(x => Convert.ToInt32(x.Element("Key")?.Value),
|
Components = element.Element("ReinforcedComponents")!.Elements("ReinforcedComponent").ToDictionary(x => Convert.ToInt32(x.Element("Key")?.Value),
|
||||||
x => Convert.ToInt32(x.Element("Value")?.Value))
|
x => Convert.ToInt32(x.Element("Value")?.Value))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public void Update(ReinforcedBindingModel model)
|
public void Update(ReinforcedBindingModel model)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ReinforcedName = model.ReinforcedName;
|
ReinforcedName = model.ReinforcedName;
|
||||||
Price = model.Price;
|
Price = model.Price;
|
||||||
Components = model.ReinforcedComponents.ToDictionary(x => x.Key, x => x.Value.Item2);
|
Components = model.ReinforcedComponents.ToDictionary(x => x.Key, x => x.Value.Item2);
|
||||||
_reinforcedComponents = null;
|
_reinforcedComponents = null;
|
||||||
}
|
}
|
||||||
public ReinforcedViewModel GetViewModel => new()
|
public ReinforcedViewModel GetViewModel => new()
|
||||||
{
|
{
|
||||||
Id = Id,
|
Id = Id,
|
||||||
ReinforcedName = ReinforcedName,
|
ReinforcedName = ReinforcedName,
|
||||||
Price = Price,
|
Price = Price,
|
||||||
ReinforcedComponents = ReinforcedComponents
|
ReinforcedComponents = ReinforcedComponents
|
||||||
};
|
};
|
||||||
public XElement GetXElement => new("Reinforced",
|
public XElement GetXElement => new("Reinforced",
|
||||||
new XAttribute("Id", Id),
|
new XAttribute("Id", Id),
|
||||||
new XElement("ReinforcedName", ReinforcedName),
|
new XElement("ReinforcedName", ReinforcedName),
|
||||||
new XElement("Price", Price.ToString()),
|
new XElement("Price", Price.ToString()),
|
||||||
new XElement("ReinforcedComponents", Components.Select(
|
new XElement("ReinforcedComponents", Components.Select(
|
||||||
x => new XElement("ReinforcedComponent", new XElement("Key", x.Key), new XElement("Value", x.Value))).ToArray()));
|
x => new XElement("ReinforcedComponent", new XElement("Key", x.Key), new XElement("Value", x.Value))).ToArray()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -0,0 +1,104 @@
|
|||||||
|
using PrecastConcretePlantContracts.BindingModels;
|
||||||
|
using PrecastConcretePlantContracts.ViewModels;
|
||||||
|
using PrecastConcretePlantDataModels.Models;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
namespace PrecastConcretePlantFileImplement.Models
|
||||||
|
{
|
||||||
|
public class Shop : IShopModel
|
||||||
|
{
|
||||||
|
public int Id { get; private set; }
|
||||||
|
public string ShopName { get; private set; } = string.Empty;
|
||||||
|
public string Adress { get; private set; } = string.Empty;
|
||||||
|
public DateTime OpeningDate { get; private set; }
|
||||||
|
public Dictionary<int, int> Reinforcedes { get; private set; } = new();
|
||||||
|
private Dictionary<int, (IReinforcedModel, int)>? _shopReinforcedes = null;
|
||||||
|
public Dictionary<int, (IReinforcedModel, int)> ShopReinforcedes
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_shopReinforcedes == null)
|
||||||
|
{
|
||||||
|
var source = DataFileSingleton.GetInstance();
|
||||||
|
_shopReinforcedes = Reinforcedes.ToDictionary(x => x.Key, y => ((source.Reinforceds.FirstOrDefault(z => z.Id == y.Key) as IReinforcedModel)!, y.Value));
|
||||||
|
}
|
||||||
|
return _shopReinforcedes;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public int ReinforcedMaxCount { get; private set; }
|
||||||
|
public static Shop? Create(ShopBindingModel? model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new Shop()
|
||||||
|
{
|
||||||
|
Id = model.Id,
|
||||||
|
ShopName = model.ShopName,
|
||||||
|
Adress = model.Adress,
|
||||||
|
OpeningDate = model.OpeningDate,
|
||||||
|
Reinforcedes = model.ShopReinforcedes.ToDictionary(x => x.Key, x => x.Value.Item2),
|
||||||
|
ReinforcedMaxCount = model.ReinforcedMaxCount
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public static Shop? Create(XElement element)
|
||||||
|
{
|
||||||
|
if (element == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new()
|
||||||
|
{
|
||||||
|
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
|
||||||
|
ShopName = element.Element("ShopName")!.Value,
|
||||||
|
Adress = element.Element("Adress")!.Value,
|
||||||
|
OpeningDate = Convert.ToDateTime(element.Element("OpeningDate")!.Value),
|
||||||
|
Reinforcedes = element.Element("ShopReinforcedes")!.Elements("ShopReinforced")!.ToDictionary(x => Convert.ToInt32(x.Element("Key")?.Value),
|
||||||
|
x => Convert.ToInt32(x.Element("Value")?.Value)),
|
||||||
|
ReinforcedMaxCount = Convert.ToInt32(element.Element("ReinforcedMaxCount")!.Value)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public void Update(ShopBindingModel? model)
|
||||||
|
{
|
||||||
|
if (model == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ShopName = model.ShopName;
|
||||||
|
Adress = model.Adress;
|
||||||
|
OpeningDate = model.OpeningDate;
|
||||||
|
ReinforcedMaxCount = model.ReinforcedMaxCount;
|
||||||
|
Reinforcedes = model.ShopReinforcedes.ToDictionary(x => x.Key, x => x.Value.Item2);
|
||||||
|
_shopReinforcedes = null;
|
||||||
|
}
|
||||||
|
public ShopViewModel GetViewModel => new()
|
||||||
|
{
|
||||||
|
Id = Id,
|
||||||
|
ShopName = ShopName,
|
||||||
|
Adress = Adress,
|
||||||
|
OpeningDate = OpeningDate,
|
||||||
|
ShopReinforcedes = ShopReinforcedes,
|
||||||
|
ReinforcedMaxCount = ReinforcedMaxCount
|
||||||
|
};
|
||||||
|
public XElement GetXElement => new("Shop",
|
||||||
|
new XAttribute("Id", Id),
|
||||||
|
new XElement("ShopName", ShopName),
|
||||||
|
new XElement("Adress", Adress),
|
||||||
|
new XElement("OpeningDate", OpeningDate.ToString()),
|
||||||
|
new XElement("ShopReinforcedes", Reinforcedes.Select(
|
||||||
|
x => new XElement("ShopReinforced", new XElement("Key", x.Key), new XElement("Value", x.Value))).ToArray()),
|
||||||
|
new XElement("ReinforcedMaxCount", ReinforcedMaxCount.ToString())
|
||||||
|
);
|
||||||
|
public void UpdateContent()
|
||||||
|
{
|
||||||
|
//метод придуман для удобного обновления на низком уровне(из хранилища). Фактически меняем мы там Reinforcedes.
|
||||||
|
_shopReinforcedes = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -102,5 +102,17 @@ namespace PrecastConcretePlantListImplement.Implements
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
public bool Sale(SupplySearchModel model)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
public bool PresenceCheck(SupplySearchModel model)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
public bool RestockingShops(SupplyBindingModel model)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ namespace PrecastConcretePlantView
|
|||||||
});
|
});
|
||||||
if (!operationResult)
|
if (!operationResult)
|
||||||
{
|
{
|
||||||
throw new Exception("Ошибка при создании поставки. Дополнительная информация в логах.");
|
throw new Exception("Магазин заполнен.");
|
||||||
}
|
}
|
||||||
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Сохранение прошло успешно", "Сообщение", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
DialogResult = DialogResult.OK;
|
DialogResult = DialogResult.OK;
|
||||||
|
@ -41,6 +41,7 @@
|
|||||||
buttonOrderReady = new Button();
|
buttonOrderReady = new Button();
|
||||||
buttonIssuedOrder = new Button();
|
buttonIssuedOrder = new Button();
|
||||||
buttonRef = new Button();
|
buttonRef = new Button();
|
||||||
|
создатьПродажуToolStripMenuItem = new ToolStripMenuItem();
|
||||||
menuStrip1.SuspendLayout();
|
menuStrip1.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
@ -83,7 +84,7 @@
|
|||||||
//
|
//
|
||||||
// операцииToolStripMenuItem
|
// операцииToolStripMenuItem
|
||||||
//
|
//
|
||||||
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { создатьПоставкуToolStripMenuItem });
|
операцииToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { создатьПоставкуToolStripMenuItem, создатьПродажуToolStripMenuItem });
|
||||||
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
операцииToolStripMenuItem.Name = "операцииToolStripMenuItem";
|
||||||
операцииToolStripMenuItem.Size = new Size(75, 20);
|
операцииToolStripMenuItem.Size = new Size(75, 20);
|
||||||
операцииToolStripMenuItem.Text = "Операции";
|
операцииToolStripMenuItem.Text = "Операции";
|
||||||
@ -155,6 +156,12 @@
|
|||||||
buttonRef.UseVisualStyleBackColor = true;
|
buttonRef.UseVisualStyleBackColor = true;
|
||||||
buttonRef.Click += buttonRef_Click;
|
buttonRef.Click += buttonRef_Click;
|
||||||
//
|
//
|
||||||
|
// создатьПродажуToolStripMenuItem
|
||||||
|
//
|
||||||
|
создатьПродажуToolStripMenuItem.Name = "создатьПродажуToolStripMenuItem";
|
||||||
|
создатьПродажуToolStripMenuItem.Size = new Size(180, 22);
|
||||||
|
создатьПродажуToolStripMenuItem.Text = "Создать продажу";
|
||||||
|
//
|
||||||
// FormMain
|
// FormMain
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
@ -193,5 +200,6 @@
|
|||||||
private ToolStripMenuItem магазиныToolStripMenuItem;
|
private ToolStripMenuItem магазиныToolStripMenuItem;
|
||||||
private ToolStripMenuItem операцииToolStripMenuItem;
|
private ToolStripMenuItem операцииToolStripMenuItem;
|
||||||
private ToolStripMenuItem создатьПоставкуToolStripMenuItem;
|
private ToolStripMenuItem создатьПоставкуToolStripMenuItem;
|
||||||
|
private ToolStripMenuItem создатьПродажуToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,64 @@
|
|||||||
<root>
|
<?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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
120
PrecastConcretePlant/PrecastConcretePlantView/FormSellingReinforsed.Designer.cs
generated
Normal file
120
PrecastConcretePlant/PrecastConcretePlantView/FormSellingReinforsed.Designer.cs
generated
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
namespace PrecastConcretePlantView
|
||||||
|
{
|
||||||
|
partial class FormSellingReinforsed
|
||||||
|
{
|
||||||
|
/// <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.labelReinforced = new System.Windows.Forms.Label();
|
||||||
|
this.comboBoxReinforced = new System.Windows.Forms.ComboBox();
|
||||||
|
this.label1 = new System.Windows.Forms.Label();
|
||||||
|
this.textBoxCount = new System.Windows.Forms.TextBox();
|
||||||
|
this.buttonSell = new System.Windows.Forms.Button();
|
||||||
|
this.buttonCancel = new System.Windows.Forms.Button();
|
||||||
|
this.SuspendLayout();
|
||||||
|
//
|
||||||
|
// labelReinforced
|
||||||
|
//
|
||||||
|
this.labelReinforced.AutoSize = true;
|
||||||
|
this.labelReinforced.Location = new System.Drawing.Point(12, 14);
|
||||||
|
this.labelReinforced.Name = "labelReinforced";
|
||||||
|
this.labelReinforced.Size = new System.Drawing.Size(75, 20);
|
||||||
|
this.labelReinforced.TabIndex = 0;
|
||||||
|
this.labelReinforced.Text = "Изделие: ";
|
||||||
|
//
|
||||||
|
// comboBoxReinforced
|
||||||
|
//
|
||||||
|
this.comboBoxReinforced.FormattingEnabled = true;
|
||||||
|
this.comboBoxReinforced.Location = new System.Drawing.Point(115, 11);
|
||||||
|
this.comboBoxReinforced.Name = "comboBoxReinforced";
|
||||||
|
this.comboBoxReinforced.Size = new System.Drawing.Size(239, 28);
|
||||||
|
this.comboBoxReinforced.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
this.label1.AutoSize = true;
|
||||||
|
this.label1.Location = new System.Drawing.Point(12, 55);
|
||||||
|
this.label1.Name = "label1";
|
||||||
|
this.label1.Size = new System.Drawing.Size(97, 20);
|
||||||
|
this.label1.TabIndex = 2;
|
||||||
|
this.label1.Text = "Количество: ";
|
||||||
|
//
|
||||||
|
// textBoxCount
|
||||||
|
//
|
||||||
|
this.textBoxCount.Location = new System.Drawing.Point(115, 52);
|
||||||
|
this.textBoxCount.Name = "textBoxCount";
|
||||||
|
this.textBoxCount.Size = new System.Drawing.Size(239, 27);
|
||||||
|
this.textBoxCount.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// buttonSell
|
||||||
|
//
|
||||||
|
this.buttonSell.Location = new System.Drawing.Point(128, 99);
|
||||||
|
this.buttonSell.Name = "buttonSell";
|
||||||
|
this.buttonSell.Size = new System.Drawing.Size(94, 29);
|
||||||
|
this.buttonSell.TabIndex = 4;
|
||||||
|
this.buttonSell.Text = "Продать";
|
||||||
|
this.buttonSell.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonSell.Click += new System.EventHandler(this.buttonSell_Click);
|
||||||
|
//
|
||||||
|
// buttonCancel
|
||||||
|
//
|
||||||
|
this.buttonCancel.Location = new System.Drawing.Point(242, 99);
|
||||||
|
this.buttonCancel.Name = "buttonCancel";
|
||||||
|
this.buttonCancel.Size = new System.Drawing.Size(94, 29);
|
||||||
|
this.buttonCancel.TabIndex = 5;
|
||||||
|
this.buttonCancel.Text = "Отмена";
|
||||||
|
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
|
||||||
|
//
|
||||||
|
// FormSellingReinforsed
|
||||||
|
//
|
||||||
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
|
this.ClientSize = new System.Drawing.Size(366, 140);
|
||||||
|
this.Controls.Add(this.buttonCancel);
|
||||||
|
this.Controls.Add(this.buttonSell);
|
||||||
|
this.Controls.Add(this.textBoxCount);
|
||||||
|
this.Controls.Add(this.label1);
|
||||||
|
this.Controls.Add(this.comboBoxReinforced);
|
||||||
|
this.Controls.Add(this.labelReinforced);
|
||||||
|
this.Name = "FormSellingReinforsed";
|
||||||
|
this.Text = "Продажа изделий";
|
||||||
|
this.Load += new System.EventHandler(this.FormSellingReinforsed_Load);
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Label labelReinforced;
|
||||||
|
private ComboBox comboBoxReinforced;
|
||||||
|
private Label label1;
|
||||||
|
private TextBox textBoxCount;
|
||||||
|
private Button buttonSell;
|
||||||
|
private Button buttonCancel;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using PrecastConcretePlantContracts.BusinessLogicsContracts;
|
||||||
|
using PrecastConcretePlantContracts.SearchModels;
|
||||||
|
using PrecastConcretePlantContracts.StoragesContracts;
|
||||||
|
using PrecastConcretePlantContracts.ViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace PrecastConcretePlantView
|
||||||
|
{
|
||||||
|
public partial class FormSellingReinforsed : Form
|
||||||
|
{
|
||||||
|
private readonly ILogger _logger;
|
||||||
|
private readonly IReinforcedLogic _logicR;
|
||||||
|
private readonly IShopLogic _logicS;
|
||||||
|
private List<ReinforcedViewModel> _reinforcedList = new List<ReinforcedViewModel>();
|
||||||
|
public FormSellingReinforsed(ILogger<FormSellingReinforsed> logger, IReinforcedLogic logicR, IShopLogic logicS)
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_logger = logger;
|
||||||
|
_logicR = logicR;
|
||||||
|
_logicS = logicS;
|
||||||
|
}
|
||||||
|
private void FormSellingReinforsed_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_reinforcedList = _logicR.ReadList(null);
|
||||||
|
if (_reinforcedList != null)
|
||||||
|
{
|
||||||
|
comboBoxReinforced.DisplayMember = "ReinforcedName";
|
||||||
|
comboBoxReinforced.ValueMember = "Id";
|
||||||
|
comboBoxReinforced.DataSource = _reinforcedList;
|
||||||
|
comboBoxReinforced.SelectedItem = null;
|
||||||
|
_logger.LogInformation("Загрузка изделий для продажи");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void buttonSell_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (comboBoxReinforced.SelectedValue == null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Выберите изделие", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_logger.LogInformation("Создание покупки");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool resout = _logicS.Sale(new SupplySearchModel
|
||||||
|
{
|
||||||
|
ReinforcedId = Convert.ToInt32(comboBoxReinforced.SelectedValue),
|
||||||
|
Count = Convert.ToInt32(textBoxCount.Text)
|
||||||
|
});
|
||||||
|
if (resout)
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Проверка пройдена, продажа проведена");
|
||||||
|
MessageBox.Show("Продажа проведена", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_logger.LogInformation("Проверка не пройдена");
|
||||||
|
MessageBox.Show("Продажа не может быть создана.", "Результат", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Ошибка создания покупки");
|
||||||
|
MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private void buttonCancel_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DialogResult = DialogResult.Cancel;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
<root>
|
||||||
|
<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>
|
@ -40,7 +40,10 @@
|
|||||||
labelAdress = new Label();
|
labelAdress = new Label();
|
||||||
textBoxName = new TextBox();
|
textBoxName = new TextBox();
|
||||||
labelName = new Label();
|
labelName = new Label();
|
||||||
|
labelMaxCount = new Label();
|
||||||
|
numericUpDownMaxCount = new NumericUpDown();
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownMaxCount).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// dateTimePickerOpeningDate
|
// dateTimePickerOpeningDate
|
||||||
@ -48,7 +51,7 @@
|
|||||||
dateTimePickerOpeningDate.Location = new Point(118, 79);
|
dateTimePickerOpeningDate.Location = new Point(118, 79);
|
||||||
dateTimePickerOpeningDate.Margin = new Padding(3, 2, 3, 2);
|
dateTimePickerOpeningDate.Margin = new Padding(3, 2, 3, 2);
|
||||||
dateTimePickerOpeningDate.Name = "dateTimePickerOpeningDate";
|
dateTimePickerOpeningDate.Name = "dateTimePickerOpeningDate";
|
||||||
dateTimePickerOpeningDate.Size = new Size(216, 23);
|
dateTimePickerOpeningDate.Size = new Size(165, 23);
|
||||||
dateTimePickerOpeningDate.TabIndex = 17;
|
dateTimePickerOpeningDate.TabIndex = 17;
|
||||||
//
|
//
|
||||||
// labelOpeningDate
|
// labelOpeningDate
|
||||||
@ -155,11 +158,30 @@
|
|||||||
labelName.TabIndex = 9;
|
labelName.TabIndex = 9;
|
||||||
labelName.Text = "Название: ";
|
labelName.Text = "Название: ";
|
||||||
//
|
//
|
||||||
|
// labelMaxCount
|
||||||
|
//
|
||||||
|
labelMaxCount.AutoSize = true;
|
||||||
|
labelMaxCount.Location = new Point(289, 80);
|
||||||
|
labelMaxCount.Name = "labelMaxCount";
|
||||||
|
labelMaxCount.Size = new Size(86, 15);
|
||||||
|
labelMaxCount.TabIndex = 19;
|
||||||
|
labelMaxCount.Text = "Вместимость: ";
|
||||||
|
//
|
||||||
|
// numericUpDownMaxCount
|
||||||
|
//
|
||||||
|
numericUpDownMaxCount.Location = new Point(388, 79);
|
||||||
|
numericUpDownMaxCount.Margin = new Padding(3, 2, 3, 2);
|
||||||
|
numericUpDownMaxCount.Name = "numericUpDownMaxCount";
|
||||||
|
numericUpDownMaxCount.Size = new Size(164, 23);
|
||||||
|
numericUpDownMaxCount.TabIndex = 18;
|
||||||
|
//
|
||||||
// FormShop
|
// FormShop
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(563, 352);
|
ClientSize = new Size(563, 352);
|
||||||
|
Controls.Add(labelMaxCount);
|
||||||
|
Controls.Add(numericUpDownMaxCount);
|
||||||
Controls.Add(dateTimePickerOpeningDate);
|
Controls.Add(dateTimePickerOpeningDate);
|
||||||
Controls.Add(labelOpeningDate);
|
Controls.Add(labelOpeningDate);
|
||||||
Controls.Add(buttonSave);
|
Controls.Add(buttonSave);
|
||||||
@ -173,6 +195,7 @@
|
|||||||
Text = "Магазин";
|
Text = "Магазин";
|
||||||
Load += FormShop_Load;
|
Load += FormShop_Load;
|
||||||
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
((System.ComponentModel.ISupportInitialize)dataGridView).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)numericUpDownMaxCount).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
PerformLayout();
|
PerformLayout();
|
||||||
}
|
}
|
||||||
@ -191,5 +214,7 @@
|
|||||||
private Label labelAdress;
|
private Label labelAdress;
|
||||||
private TextBox textBoxName;
|
private TextBox textBoxName;
|
||||||
private Label labelName;
|
private Label labelName;
|
||||||
|
private Label labelMaxCount;
|
||||||
|
private NumericUpDown numericUpDownMaxCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -46,6 +46,7 @@ namespace PrecastConcretePlantView
|
|||||||
textBoxAdress.Text = view.Adress;
|
textBoxAdress.Text = view.Adress;
|
||||||
dateTimePickerOpeningDate.Value = view.OpeningDate;
|
dateTimePickerOpeningDate.Value = view.OpeningDate;
|
||||||
_ShopReinforcedes = view.ShopReinforcedes ?? new Dictionary<int, (IReinforcedModel, int)>();
|
_ShopReinforcedes = view.ShopReinforcedes ?? new Dictionary<int, (IReinforcedModel, int)>();
|
||||||
|
numericUpDownMaxCount.Value = view.ReinforcedMaxCount;
|
||||||
LoadData();
|
LoadData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -96,7 +97,9 @@ namespace PrecastConcretePlantView
|
|||||||
Id = _id ?? 0,
|
Id = _id ?? 0,
|
||||||
ShopName = textBoxName.Text,
|
ShopName = textBoxName.Text,
|
||||||
Adress = textBoxAdress.Text,
|
Adress = textBoxAdress.Text,
|
||||||
OpeningDate = dateTimePickerOpeningDate.Value
|
OpeningDate = dateTimePickerOpeningDate.Value,
|
||||||
|
ReinforcedMaxCount = (int)numericUpDownMaxCount.Value,
|
||||||
|
ShopReinforcedes = _ShopReinforcedes
|
||||||
};
|
};
|
||||||
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
var operationResult = _id.HasValue ? _logic.Update(model) : _logic.Create(model);
|
||||||
if (!operationResult)
|
if (!operationResult)
|
||||||
|
@ -1,4 +1,64 @@
|
|||||||
<root>
|
<?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: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:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
@ -66,13 +126,4 @@
|
|||||||
<metadata name="Count.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="Count.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="ReinforcedName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="Count.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
|
||||||
<value>True</value>
|
|
||||||
</metadata>
|
|
||||||
</root>
|
</root>
|
@ -57,6 +57,7 @@ namespace PrecastConcretePlant
|
|||||||
services.AddTransient<FormShop>();
|
services.AddTransient<FormShop>();
|
||||||
services.AddTransient<FormShops>();
|
services.AddTransient<FormShops>();
|
||||||
services.AddTransient<FormCreateSupply>();
|
services.AddTransient<FormCreateSupply>();
|
||||||
|
services.AddTransient<FormSellingReinforsed>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user