форматирование

This commit is contained in:
Николай 2023-04-30 14:29:25 +04:00
parent a2c2573beb
commit ca62934748
5 changed files with 10 additions and 7 deletions

View File

@ -19,13 +19,16 @@ namespace FoodOrdersContracts.Attributes
public bool IsUseAutoSize { get; private set; }
public ColumnAttribute(string title = "", bool visible = true, int width = 0, GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false)
public string Format { get; private set; }
public ColumnAttribute(string title = "", bool visible = true, int width = 0, GridViewAutoSize gridViewAutoSize = GridViewAutoSize.None, bool isUseAutoSize = false, string format = "")
{
Title = title;
Visible = visible;
Width = width;
GridViewAutoSize = gridViewAutoSize;
IsUseAutoSize = isUseAutoSize;
Format = format;
}
}
}

View File

@ -11,7 +11,7 @@ namespace FoodOrdersContracts.ViewModels
[Column("Название компонента", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
public string ComponentName { get; set; } = string.Empty;
[Column("Цена", width: 80)]
[Column("Цена", width: 80, format: "0.00")]
public double Cost { get; set; }
}
}

View File

@ -10,7 +10,7 @@ namespace FoodOrdersContracts.ViewModels
public int Id { get; set; }
[Column("Название блюда", gridViewAutoSize: GridViewAutoSize.Fill, isUseAutoSize: true)]
public string DishName { get; set; } = string.Empty;
[Column("Цена", width: 100)]
[Column("Цена", width: 100, format: "0.00")]
public double Price { get; set; }
[Column(visible: false)]
public Dictionary<int, (IComponentModel, int)> DishComponents {get; set;} = new();

View File

@ -15,7 +15,7 @@ namespace FoodOrdersContracts.ViewModels
[Column("Отправитель", gridViewAutoSize: GridViewAutoSize.DisplayedCells, isUseAutoSize: true)]
public string SenderName { get; set; } = string.Empty;
[Column("Дата письма", width: 100)]
[Column("Дата письма", width: 100, format: "D")]
public DateTime DateDelivery { get; set; }
[Column("Заголовок", width: 150)]

View File

@ -30,16 +30,16 @@ namespace FoodOrdersContracts.ViewModels
[Column("Количество", gridViewAutoSize: GridViewAutoSize.AllCells, isUseAutoSize: true)]
public int Count { get; set; }
[Column("Сумма", gridViewAutoSize: GridViewAutoSize.AllCells, isUseAutoSize: true)]
[Column("Сумма", gridViewAutoSize: GridViewAutoSize.AllCells, isUseAutoSize: true, format: "0.00")]
public double Sum { get; set; }
[Column("Статус", gridViewAutoSize: GridViewAutoSize.AllCells, isUseAutoSize: true)]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[Column("Дата создания", width: 100)]
[Column("Дата создания", width: 100, format: "D")]
public DateTime DateCreate { get; set; } = DateTime.Now;
[Column("Дата выполнения", width: 100)]
[Column("Дата выполнения", width: 100, format: "D")]
public DateTime? DateImplement { get; set; }
}
}