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;
if (model.Status == OrderStatus.Выдан)
model.DateImplement = DateTime.Now;
_orderStorage.Update(model);
var orderView = _orderStorage.GetElement(new() { Id = model.Id });
var clientView = _clientStorage.GetElement(new() { Id = orderView!.ClientId });

View File

@ -12,11 +12,11 @@
public GridViewAutoSize GridViewAutoSize { 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 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;
Visible = visible;

View File

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

View File

@ -12,7 +12,7 @@ namespace PlumbingRepairContracts.ViewModels
public int? ClientId { get; set; }
[Column(title: "Отправитель", width: 150)]
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; }
[Column(title: "Заголовок", width: 150)]
public string Subject { get; set; } = string.Empty;

View File

@ -36,10 +36,10 @@ namespace PlumbingRepairContracts.ViewModels
[Column(title: "Статус", width: 150)]
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;
[Column(title: "Дата выполнения", width: 200, formatDate: true)]
[Column(title: "Дата выполнения", width: 200, formatDate: "dd MMMM YY, HH:mm:ss")]
public DateTime? DateImplement { get; set; }
}
}

View File

@ -4,7 +4,7 @@ using System.ComponentModel;
namespace PlumbingRepairContracts.ViewModels
{
public class ShopViewModel
public class ShopViewModel : IShopModel
{
[Column(visible: false)]
public int Id { get; set; }
@ -16,7 +16,7 @@ namespace PlumbingRepairContracts.ViewModels
public string Address { get; set; } = string.Empty;
[Column(title: "Максимальное количество работ", width: 150)]
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; }
[Column(visible: false)]
public Dictionary<int, (IWorkModel, int)> ShopWorks { get; set; } = new();

View File

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

View File

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

View File

@ -39,9 +39,9 @@ namespace PlumbingRepairView
{
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))
{