Compare commits

..

No commits in common. "e1920f0f22a0b5aca489dcd47196a57397fe0ac5" and "188d246b30dce7301ffc0cd335906fd80c3276fe" have entirely different histories.

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 string FormattedDate { get; private set; }
public bool 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, string formatDate = "", bool formattedNumber = false)
public ColumnAttribute(string title = "", bool visible = true, int width = 0, GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false, bool formatDate = false, bool formattedNumber = false)
{
Title = title;
Visible = visible;

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace PlumbingRepairContracts.BindingModels
{
public class ShopBindingModel : IShopModel
public class ShopBindingModel
{
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: "dd MMMM YY, HH:mm:ss")]
[Column(title: "Дата отправления", width: 150, formatDate: true)]
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: "dd MMMM YY, HH:mm:ss")]
[Column(title: "Дата создания", width: 200, formatDate: true)]
public DateTime DateCreate { get; set; } = DateTime.Now;
[Column(title: "Дата выполнения", width: 200, formatDate: "dd MMMM YY, HH:mm:ss")]
[Column(title: "Дата выполнения", width: 200, formatDate: true)]
public DateTime? DateImplement { get; set; }
}
}

View File

@ -4,7 +4,7 @@ using System.ComponentModel;
namespace PlumbingRepairContracts.ViewModels
{
public class ShopViewModel : IShopModel
public class ShopViewModel
{
[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: "dd MMMM YY, HH:mm:ss")]
[Column(title: "Дата открытия", width: 150, formatDate: true)]
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 interface IShopModel: IId
public class IShopModel
{
string ShopName { get; }

View File

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

View File

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