лр3 сдана)

This commit is contained in:
ityurner02@mail.ru 2023-10-28 09:02:31 +04:00
parent e37edd505a
commit f882b814ab
5 changed files with 9 additions and 9 deletions

View File

@ -14,6 +14,6 @@ namespace ClientsContracts.ViewModels
[DisplayName("Статус")]
public string Status { get; set; }
[DisplayName("Сумма покупок")]
public int? Amount { get; set; }
public string Amount { get; set; }
}
}

View File

@ -110,7 +110,7 @@ namespace ClientsDatabaseImplement.Implements
return new ClientViewModel
{
Id = client.Id,
Amount = client.Amount,
Amount = client.Amount.ToString(),
Name = client.Name,
Status = client.Status,
Reviews = client.Reviews

View File

@ -38,7 +38,7 @@ namespace WinForms
label3 = new Label();
buttonSave = new Button();
buttonCancel = new Button();
controlInputNullableInt1 = new ControlsLibraryNet60.Input.ControlInputNullableInt();
controlInputNullableInt1 = new ControlInputNullableInt();
myDropDownList1 = new VisualCompLib.MyDropDownList();
SuspendLayout();
//
@ -141,7 +141,7 @@ namespace WinForms
myDropDownList1.Margin = new Padding(3, 4, 3, 4);
myDropDownList1.Name = "myDropDownList1";
myDropDownList1.SelectedValue = "";
myDropDownList1.Size = new Size(198, 39);
myDropDownList1.Size = new Size(201, 39);
myDropDownList1.TabIndex = 13;
//
// FormClient
@ -177,7 +177,7 @@ namespace WinForms
private Label label3;
private Button buttonSave;
private Button buttonCancel;
private ControlsLibraryNet60.Input.ControlInputNullableInt controlInputNullableInt1;
private ControlInputNullableInt controlInputNullableInt1;
private VisualCompLib.MyDropDownList myDropDownList1;
}
}

View File

@ -45,7 +45,7 @@ namespace WinForms
myDropDownList1.SelectedValue = view.Status;
if (view.Amount != null)
{
controlInputNullableInt1.Value = view.Amount;
controlInputNullableInt1.Value = Int32.Parse(view.Amount);
}
}
}

View File

@ -36,7 +36,7 @@ namespace WinForms
var list = _clientLogic.Read(null);
for (int i = 0; i < list.Count; i++)
{
if (list[i].Amount == null) { list[i].Amount = 0; }
if (list[i].Amount == null || list[i].Amount == "") { list[i].Amount = "нет"; }
}
myTreeView1.LoadTree(list);
}
@ -109,7 +109,7 @@ namespace WinForms
{
foreach (var item in list)
{
if (item.Amount != null)
if (item.Amount != null && item.Amount != "")
{
string clients = string.Concat("ФИО: ", item.Name, " Отзывы: ", item.Reviews);
textList.Add(clients);
@ -170,7 +170,7 @@ namespace WinForms
var clients = _clientLogic.Read(null);
for (int i = 0; i < clients.Count; i++)
{
if (clients[i].Amount == null) { clients[i].Amount = 0; }
if (clients[i].Amount == null || clients[i].Amount == "") { clients[i].Amount = "нет"; }
}
componentDocumentWithTableMultiHeaderPdf1.CreateDoc(new ComponentDocumentWithTableHeaderDataConfig<ClientViewModel>
{