Ismailov_Rovshan 2023-05-19 19:16:54 +04:00
commit 42c2147542
9 changed files with 23 additions and 31 deletions

View File

@ -5,7 +5,7 @@ namespace FurnitureContracts.BindingModels
public class OrdersBindingModel : IOrdersModel public class OrdersBindingModel : IOrdersModel
{ {
public string Title { get; set; } = string.Empty; 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 string Status { get; set; } = string.Empty;
public int Id { get; set; } public int Id { get; set; }
public int ManagerId { get; set; } public int ManagerId { get; set; }

View File

@ -6,8 +6,7 @@ namespace FurnitureContracts.BindingModels
{ {
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
public string Address { 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 ManagerId { get; set; }
public int Id { get; set; }
} }
} }

View File

@ -16,7 +16,7 @@ namespace FurnitureContracts.ViewModel
[DisplayName("Дата заказа")] [DisplayName("Дата заказа")]
public DateTime Date { get; set; } public DateTime DateCreate { get; set; }
[DisplayName("Статус")] [DisplayName("Статус")]
public string Status { get; set; } = string.Empty; public string Status { get; set; } = string.Empty;

View File

@ -150,7 +150,7 @@ namespace FurnitureFactoryBusinessLogic.BusinessLogic
{ {
SalesSalonTitle = salessalons.FirstOrDefault(x => x.Id == salessalonOrder).ToString(), SalesSalonTitle = salessalons.FirstOrDefault(x => x.Id == salessalonOrder).ToString(),
OrderTitle = order.Title, OrderTitle = order.Title,
DateCreateOrder = order.Date, DateCreateOrder = order.DateCreate,
HeadsetTitle = headset.Title, HeadsetTitle = headset.Title,
}); });
} }
@ -196,7 +196,7 @@ namespace FurnitureFactoryBusinessLogic.BusinessLogic
{ {
SalesSalonTitle = interests.FirstOrDefault(x => x.Id == interestOrder).ToString(), SalesSalonTitle = interests.FirstOrDefault(x => x.Id == interestOrder).ToString(),
OrderTitle = order.Title, OrderTitle = order.Title,
DateCreateOrder = order.Date, DateCreateOrder = order.DateCreate,
HeadsetTitle = headset.Title, HeadsetTitle = headset.Title,
DateCreateHeadset = headset.DateCreate DateCreateHeadset = headset.DateCreate
}); });

View File

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using FurnitureFactoryDataBaseImplement.Models; using FurnitureFactoryDataBaseImplement.Models;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -23,13 +22,7 @@ namespace FurnitureFactoryDataBaseImplement
{ {
if (optionsBuilder.IsConfigured == false) if (optionsBuilder.IsConfigured == false)
{ {
//optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=FurnitureFactory;Username=postgres;Password=postgres"); optionsBuilder.UseNpgsql(@"Host=localhost;Port=5432;Database=FurnitureFactory;Username=postgres;Password=Jus999666Y");
optionsBuilder.UseNpgsql(@"
Host=localhost;
Port=5432;
Database=FurnitureFactory;
Username=postgres;
Password=postgres");
} }
base.OnConfiguring(optionsBuilder); base.OnConfiguring(optionsBuilder);
} }

View File

@ -39,7 +39,7 @@ namespace FurnitureFactoryDataBaseImplements.Implements
return context.Orders return context.Orders
.Include(x => x.SalesSalons) .Include(x => x.SalesSalons)
.ThenInclude(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() .ToList()
.Select(x => x.GetViewModel) .Select(x => x.GetViewModel)
.ToList(); .ToList();

View File

@ -18,7 +18,7 @@ namespace FurnitureFactoryDataBaseImplement.Models
[Required] [Required]
public string Status { get; set; } = string.Empty; public string Status { get; set; } = string.Empty;
[Required] [Required]
public DateTime Date { get; set; } public DateTime DateCreate { get; set; }
[Required] [Required]
public int ManagerId { get; set; } public int ManagerId { get; set; }
public virtual Manager Manager { get; set; } public virtual Manager Manager { get; set; }
@ -50,7 +50,7 @@ namespace FurnitureFactoryDataBaseImplement.Models
Id = model.Id, Id = model.Id,
Title = model.Title, Title = model.Title,
Status = model.Status, Status = model.Status,
Date = model.Date, DateCreate = model.DateCreate,
ManagerId = model.ManagerId, ManagerId = model.ManagerId,
SalesSalons = model.OrdersSalesSalons.Select(x => new OrdersSalesSalons SalesSalons = model.OrdersSalesSalons.Select(x => new OrdersSalesSalons
{ {
@ -62,7 +62,7 @@ namespace FurnitureFactoryDataBaseImplement.Models
public void Update(OrdersBindingModel model) public void Update(OrdersBindingModel model)
{ {
Status = model.Status; Status = model.Status;
Date = model.Date; DateCreate = model.DateCreate;
} }
public OrdersViewModel GetViewModel => new() public OrdersViewModel GetViewModel => new()
@ -70,7 +70,7 @@ namespace FurnitureFactoryDataBaseImplement.Models
Id = Id, Id = Id,
Title = Title, Title = Title,
Status = Status, Status = Status,
Date = Date, DateCreate = DateCreate,
ManagerId = ManagerId, ManagerId = ManagerId,
OrdersSalesSalons = OrdersSalesSalons OrdersSalesSalons = OrdersSalesSalons
}; };

View File

@ -9,7 +9,7 @@ namespace FurnitureFactoryDataModels.Models
public interface IOrdersModel : IId public interface IOrdersModel : IId
{ {
string Title { get; } string Title { get; }
DateTime Date { get; } DateTime DateCreate { get; }
string Status { get; } string Status { get; }
public Dictionary<int, ISalesSalonsModel> OrdersSalesSalons { get; } public Dictionary<int, ISalesSalonsModel> OrdersSalesSalons { get; }
int ManagerId { get; } int ManagerId { get; }

View File

@ -338,7 +338,7 @@ namespace ManagerWebClient.Controllers
ManagerId = APIClient.Manager.Id, ManagerId = APIClient.Manager.Id,
Title = title, Title = title,
Status = status, Status = status,
Date = DateTime.SpecifyKind(DateTime.Parse(dateCreate), DateTimeKind.Utc), DateCreate = DateTime.SpecifyKind(DateTime.Parse(dateCreate), DateTimeKind.Utc),
OrdersSalesSalons = orderSalesSalons OrdersSalesSalons = orderSalesSalons
}); });
@ -386,7 +386,7 @@ namespace ManagerWebClient.Controllers
ManagerId = APIClient.Manager.Id, ManagerId = APIClient.Manager.Id,
Title = title, Title = title,
Status = status, Status = status,
Date = DateTime.SpecifyKind(DateTime.Parse(dateCreate), DateTimeKind.Utc), DateCreate = DateTime.SpecifyKind(DateTime.Parse(dateCreate), DateTimeKind.Utc),
OrdersSalesSalons = orderSalesSalons OrdersSalesSalons = orderSalesSalons
}); });