Compare commits

...

2 Commits

Author SHA1 Message Date
sardq
e1920f0f22 коммит 2024-06-18 14:07:54 +04:00
sardq
3e5221a9d1 секрте 2024-06-17 21:27:15 +04:00
9 changed files with 17 additions and 17 deletions

View File

@ -142,10 +142,10 @@ namespace PlumbingRepairBusinessLogic.BusinessLogics
} }
} }
_orderStorage.Update(model);
model.Status = newStatus; model.Status = newStatus;
if (model.Status == OrderStatus.Выдан) if (model.Status == OrderStatus.Выдан)
model.DateImplement = DateTime.Now; model.DateImplement = DateTime.Now;
_orderStorage.Update(model);
var orderView = _orderStorage.GetElement(new() { Id = model.Id }); var orderView = _orderStorage.GetElement(new() { Id = model.Id });
var clientView = _clientStorage.GetElement(new() { Id = orderView!.ClientId }); var clientView = _clientStorage.GetElement(new() { Id = orderView!.ClientId });

View File

@ -12,11 +12,11 @@
public GridViewAutoSize GridViewAutoSize { get; private set; } public GridViewAutoSize GridViewAutoSize { get; private set; }
public bool IsUseAutoSize { get; private set; } public bool IsUseAutoSize { get; private set; }
public bool FormattedDate { get; private set; } public string FormattedDate { get; private set; }
public bool FormattedNumber { get; private set; } public bool FormattedNumber { get; private set; }
public ColumnAttribute(string title = "", bool visible = true, int width = 0, GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false, bool formatDate = false, bool formattedNumber = false) public ColumnAttribute(string title = "", bool visible = true, int width = 0, GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false, string formatDate = "", bool formattedNumber = false)
{ {
Title = title; Title = title;
Visible = visible; Visible = visible;

View File

@ -8,8 +8,8 @@ using System.Threading.Tasks;
namespace PlumbingRepairContracts.BindingModels namespace PlumbingRepairContracts.BindingModels
{ {
public class ShopBindingModel public class ShopBindingModel : IShopModel
{ {
public int Id { get; set; } public int Id { get; set; }
public string ShopName { get; set; } =string.Empty; public string ShopName { get; set; } =string.Empty;

View File

@ -12,7 +12,7 @@ namespace PlumbingRepairContracts.ViewModels
public int? ClientId { get; set; } public int? ClientId { get; set; }
[Column(title: "Отправитель", width: 150)] [Column(title: "Отправитель", width: 150)]
public string SenderName { get; set; } = string.Empty; public string SenderName { get; set; } = string.Empty;
[Column(title: "Дата отправления", width: 150, formatDate: true)] [Column(title: "Дата отправления", width: 150, formatDate: "dd MMMM YY, HH:mm:ss")]
public DateTime DateDelivery { get; set; } public DateTime DateDelivery { get; set; }
[Column(title: "Заголовок", width: 150)] [Column(title: "Заголовок", width: 150)]
public string Subject { get; set; } = string.Empty; public string Subject { get; set; } = string.Empty;

View File

@ -36,10 +36,10 @@ namespace PlumbingRepairContracts.ViewModels
[Column(title: "Статус", width: 150)] [Column(title: "Статус", width: 150)]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен; public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[Column(title: "Дата создания", width: 200, formatDate: true)] [Column(title: "Дата создания", width: 200, formatDate: "dd MMMM YY, HH:mm:ss")]
public DateTime DateCreate { get; set; } = DateTime.Now; public DateTime DateCreate { get; set; } = DateTime.Now;
[Column(title: "Дата выполнения", width: 200, formatDate: true)] [Column(title: "Дата выполнения", width: 200, formatDate: "dd MMMM YY, HH:mm:ss")]
public DateTime? DateImplement { get; set; } public DateTime? DateImplement { get; set; }
} }
} }

View File

@ -4,8 +4,8 @@ using System.ComponentModel;
namespace PlumbingRepairContracts.ViewModels namespace PlumbingRepairContracts.ViewModels
{ {
public class ShopViewModel public class ShopViewModel : IShopModel
{ {
[Column(visible: false)] [Column(visible: false)]
public int Id { get; set; } public int Id { get; set; }
@ -16,7 +16,7 @@ namespace PlumbingRepairContracts.ViewModels
public string Address { get; set; } = string.Empty; public string Address { get; set; } = string.Empty;
[Column(title: "Максимальное количество работ", width: 150)] [Column(title: "Максимальное количество работ", width: 150)]
public int maxCountWorks { get; set; } public int maxCountWorks { get; set; }
[Column(title: "Дата открытия", width: 150, formatDate: true)] [Column(title: "Дата открытия", width: 150, formatDate: "dd MMMM YY, HH:mm:ss")]
public DateTime DateOpening { get; set; } public DateTime DateOpening { get; set; }
[Column(visible: false)] [Column(visible: false)]
public Dictionary<int, (IWorkModel, int)> ShopWorks { get; set; } = new(); public Dictionary<int, (IWorkModel, int)> ShopWorks { get; set; } = new();

View File

@ -1,6 +1,6 @@
namespace PlumbingRepairDataModels.Models namespace PlumbingRepairDataModels.Models
{ {
public class IShopModel public interface IShopModel: IId
{ {
string ShopName { get; } string ShopName { get; }

View File

@ -9,8 +9,8 @@ using System.Runtime.Serialization;
namespace PlumbingRepairDatabaseImplement.Models namespace PlumbingRepairDatabaseImplement.Models
{ {
[DataContract] [DataContract]
public class Shop public class Shop : IShopModel
{ {
[DataMember] [DataMember]
public int Id { get; set; } public int Id { get; set; }

View File

@ -39,9 +39,9 @@ namespace PlumbingRepairView
{ {
column.Width = columnAttr.Width; column.Width = columnAttr.Width;
} }
if (columnAttr.FormattedDate && (column.ValueType == typeof(DateTime) || column.ValueType == typeof(DateTime?))) if (!columnAttr.FormattedDate.Equals(""))
{ {
column.DefaultCellStyle.Format = "dd MMMM yy, HH:mm:ss"; column.DefaultCellStyle.Format = columnAttr.FormattedDate;
} }
if (columnAttr.FormattedNumber && column.ValueType == typeof(double)) if (columnAttr.FormattedNumber && column.ValueType == typeof(double))
{ {