fix Contracts
This commit is contained in:
parent
c2ed8a645e
commit
8d6846eefc
@ -5,7 +5,7 @@ namespace FurnitureContracts.BindingModels
|
||||
public class OrdersBindingModel : IOrdersModel
|
||||
{
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public DateTime Date { get; set; } = DateTime.Now;
|
||||
public DateTime DateCreate { get; set; } = DateTime.Now;
|
||||
public string Status { get; set; } = string.Empty;
|
||||
public int Id { get; set; }
|
||||
public int ManagerId { get; set; }
|
||||
|
@ -6,8 +6,7 @@ namespace FurnitureContracts.BindingModels
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Address { get; set; } = string.Empty;
|
||||
public Dictionary<int, IOrdersModel> OrdersId { get; set; }
|
||||
public int Id { get; set; }
|
||||
public int ManagerId { get; set; }
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ namespace FurnitureContracts.ViewModel
|
||||
|
||||
|
||||
[DisplayName("Дата заказа")]
|
||||
public DateTime Date { get; set; }
|
||||
public DateTime DateCreate { get; set; }
|
||||
|
||||
[DisplayName("Статус")]
|
||||
public string Status { get; set; } = string.Empty;
|
||||
|
@ -150,7 +150,7 @@ namespace FurnitureFactoryBusinessLogic.BusinessLogic
|
||||
{
|
||||
SalesSalonTitle = salessalons.FirstOrDefault(x => x.Id == salessalonOrder).ToString(),
|
||||
OrderTitle = order.Title,
|
||||
DateCreateOrder = order.Date,
|
||||
DateCreateOrder = order.DateCreate,
|
||||
HeadsetTitle = headset.Title,
|
||||
});
|
||||
}
|
||||
@ -196,7 +196,7 @@ namespace FurnitureFactoryBusinessLogic.BusinessLogic
|
||||
{
|
||||
SalesSalonTitle = interests.FirstOrDefault(x => x.Id == interestOrder).ToString(),
|
||||
OrderTitle = order.Title,
|
||||
DateCreateOrder = order.Date,
|
||||
DateCreateOrder = order.DateCreate,
|
||||
HeadsetTitle = headset.Title,
|
||||
DateCreateHeadset = headset.DateCreate
|
||||
});
|
||||
|
@ -22,7 +22,7 @@ namespace FurnitureFactoryDataBaseImplement
|
||||
{
|
||||
if (optionsBuilder.IsConfigured == false)
|
||||
{
|
||||
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=FurnitureFactory;Username=postgres;Password=Jus999666Y");
|
||||
optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=FurnitureFactory;Username=postgres;Password=Jus999666Y");
|
||||
}
|
||||
base.OnConfiguring(optionsBuilder);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements
|
||||
return context.Orders
|
||||
.Include(x => x.SalesSalons)
|
||||
.ThenInclude(x => x.SalesSalons)
|
||||
.Where(x => x.Date >= model.DateFrom && x.Date <= model.DateTo && x.ManagerId == model.ManagerId)
|
||||
.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo && x.ManagerId == model.ManagerId)
|
||||
.ToList()
|
||||
.Select(x => x.GetViewModel)
|
||||
.ToList();
|
||||
|
@ -18,7 +18,7 @@ namespace FurnitureFactoryDataBaseImplement.Models
|
||||
[Required]
|
||||
public string Status { get; set; } = string.Empty;
|
||||
[Required]
|
||||
public DateTime Date { get; set; }
|
||||
public DateTime DateCreate { get; set; }
|
||||
[Required]
|
||||
public int ManagerId { get; set; }
|
||||
public virtual Manager Manager { get; set; }
|
||||
@ -50,7 +50,7 @@ namespace FurnitureFactoryDataBaseImplement.Models
|
||||
Id = model.Id,
|
||||
Title = model.Title,
|
||||
Status = model.Status,
|
||||
Date = model.Date,
|
||||
DateCreate = model.DateCreate,
|
||||
ManagerId = model.ManagerId,
|
||||
SalesSalons = model.OrdersSalesSalons.Select(x => new OrdersSalesSalons
|
||||
{
|
||||
@ -62,7 +62,7 @@ namespace FurnitureFactoryDataBaseImplement.Models
|
||||
public void Update(OrdersBindingModel model)
|
||||
{
|
||||
Status = model.Status;
|
||||
Date = model.Date;
|
||||
DateCreate = model.DateCreate;
|
||||
}
|
||||
|
||||
public OrdersViewModel GetViewModel => new()
|
||||
@ -70,7 +70,7 @@ namespace FurnitureFactoryDataBaseImplement.Models
|
||||
Id = Id,
|
||||
Title = Title,
|
||||
Status = Status,
|
||||
Date = Date,
|
||||
DateCreate = DateCreate,
|
||||
ManagerId = ManagerId,
|
||||
OrdersSalesSalons = OrdersSalesSalons
|
||||
};
|
||||
|
@ -9,7 +9,7 @@ namespace FurnitureFactoryDataModels.Models
|
||||
public interface IOrdersModel : IId
|
||||
{
|
||||
string Title { get; }
|
||||
DateTime Date { get; }
|
||||
DateTime DateCreate { get; }
|
||||
string Status { get; }
|
||||
public Dictionary<int, ISalesSalonsModel> OrdersSalesSalons { get; }
|
||||
int ManagerId { get; }
|
||||
|
@ -338,7 +338,7 @@ namespace ManagerWebClient.Controllers
|
||||
ManagerId = APIClient.Manager.Id,
|
||||
Title = title,
|
||||
Status = status,
|
||||
Date = DateTime.SpecifyKind(DateTime.Parse(dateCreate), DateTimeKind.Utc),
|
||||
DateCreate = DateTime.SpecifyKind(DateTime.Parse(dateCreate), DateTimeKind.Utc),
|
||||
OrdersSalesSalons = orderSalesSalons
|
||||
|
||||
});
|
||||
@ -386,7 +386,7 @@ namespace ManagerWebClient.Controllers
|
||||
ManagerId = APIClient.Manager.Id,
|
||||
Title = title,
|
||||
Status = status,
|
||||
Date = DateTime.SpecifyKind(DateTime.Parse(dateCreate), DateTimeKind.Utc),
|
||||
DateCreate = DateTime.SpecifyKind(DateTime.Parse(dateCreate), DateTimeKind.Utc),
|
||||
OrdersSalesSalons = orderSalesSalons
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user