ОНООООООО РАБОТАЕЕЕЕЕЕЕЕЕЕТ!!!!!!

This commit is contained in:
Кашин Максим 2023-03-28 00:27:02 +04:00
parent 368338db82
commit c315095758
16 changed files with 158 additions and 184 deletions

View File

@ -151,6 +151,7 @@
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "FormCreateOrder";
this.Text = "Заказ";
this.Load += new System.EventHandler(this.FormCreateOrder_Load);
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -63,11 +63,6 @@ namespace PrecastConcretePlantView
}
}
private void FormCreateOrder_Load(object sender, EventArgs e)
{
LoadData();
}
private void CalcSum()
{
if (ReinforcedComboBox.SelectedValue != null && !string.IsNullOrEmpty(CountTextBox.Text))
@ -125,7 +120,6 @@ namespace PrecastConcretePlantView
{
ClientId = Convert.ToInt32(ClientСomboBox.SelectedValue),
ReinforcedId = Convert.ToInt32(ReinforcedComboBox.SelectedValue),
ReinforcedName = ReinforcedComboBox.Text,
Count = Convert.ToInt32(CountTextBox.Text),
Sum = Convert.ToDouble(SumTextBox.Text)
});
@ -156,5 +150,10 @@ namespace PrecastConcretePlantView
{
CalcSum();
}
private void FormCreateOrder_Load(object sender, EventArgs e)
{
LoadData();
}
}
}

View File

@ -47,6 +47,7 @@ namespace PrecastConcretePlantView
{
DataGridView.DataSource = list;
DataGridView.Columns["ReinforcedId"].Visible = false;
DataGridView.Columns["ClientId"].Visible = false;
}
_logger.LogInformation("Загрузка заказов");
@ -101,12 +102,7 @@ namespace PrecastConcretePlantView
var operationResult = _orderLogic.TakeOrderInWork(new OrderBindingModel
{
Id = id,
ReinforcedId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["ReinforcedId"].Value),
ReinforcedName = DataGridView.SelectedRows[0].Cells["ReinforcedName"].Value.ToString(),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()),
});
if (!operationResult)
@ -136,12 +132,6 @@ namespace PrecastConcretePlantView
var operationResult = _orderLogic.FinishOrder(new OrderBindingModel
{
Id = id,
ReinforcedId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["ReinforcedId"].Value),
ReinforcedName = DataGridView.SelectedRows[0].Cells["ReinforcedName"].Value.ToString(),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()),
});
if (!operationResult)
@ -171,12 +161,7 @@ namespace PrecastConcretePlantView
var operationResult = _orderLogic.DeliveryOrder(new OrderBindingModel
{
Id = id,
ReinforcedId = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["ReinforcedId"].Value),
ReinforcedName = DataGridView.SelectedRows[0].Cells["ReinforcedName"].Value.ToString(),
Status = Enum.Parse<OrderStatus>(DataGridView.SelectedRows[0].Cells["Status"].Value.ToString()),
Count = Convert.ToInt32(DataGridView.SelectedRows[0].Cells["Count"].Value),
Sum = double.Parse(DataGridView.SelectedRows[0].Cells["Sum"].Value.ToString()),
DateCreate = DateTime.Parse(DataGridView.SelectedRows[0].Cells["DateCreate"].Value.ToString()),
});
if (!operationResult)

View File

@ -27,53 +27,67 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
public bool CreateOrder(OrderBindingModel model)
{
CheckModel(model);
if (model.Status != OrderStatus.Неизвестен)
{
_logger.LogWarning("Insert operation failed. Order status incorrect.");
return false;
}
model.Status = OrderStatus.Принят;
if (_orderStorage.Insert(model) == null)
{
model.Status = OrderStatus.Неизвестен;
_logger.LogWarning("Insert operation failed");
return false;
}
return true;
}
public bool StatusUpdate(OrderBindingModel model, OrderStatus newStatus)
public bool StatusUpdate(OrderBindingModel rawModel, OrderStatus newStatus)
{
CheckModel(model);
var viewModel = _orderStorage.GetElement(new OrderSearchModel
{
Id = rawModel.Id
});
if (viewModel == null)
{
_logger.LogWarning("Order model not found");
return false;
}
OrderBindingModel model = new OrderBindingModel
{
Id = viewModel.Id,
ReinforcedId = viewModel.ReinforcedId,
Status = viewModel.Status,
DateCreate = viewModel.DateCreate,
DateImplement = viewModel.DateImplement,
Count = viewModel.Count,
Sum = viewModel.Sum
};
CheckModel(model, false);
if (model.Status + 1 != newStatus)
{
_logger.LogWarning("Status update to " + newStatus.ToString() + " operation failed. Order status incorrect.");
return false;
}
model.Status = newStatus;
if (model.Status == OrderStatus.Выдан)
model.DateImplement = DateTime.Now;
if (model.Status == OrderStatus.Выдан) model.DateImplement = DateTime.Now;
if (_orderStorage.Update(model) == null)
{
model.Status--;
_logger.LogWarning("Update operation failed");
return false;
}
return true;
}
public bool TakeOrderInWork(OrderBindingModel model)
{
return StatusUpdate(model, OrderStatus.Выполняется);
}
public bool DeliveryOrder(OrderBindingModel model)
{
return StatusUpdate(model, OrderStatus.Готов);
@ -83,18 +97,16 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
{
return StatusUpdate(model, OrderStatus.Выдан);
}
public List<OrderViewModel>? ReadList(OrderSearchModel? model)
{
_logger.LogInformation("Order. OrderId:{Id}", model?.Id);
_logger.LogInformation("Order. OrderID:{Id}", model?.Id);
var list = model == null ? _orderStorage.GetFullList() : _orderStorage.GetFilteredList(model);
if (list == null)
{
_logger.LogWarning("ReadList return null list");
return null;
}
_logger.LogInformation("ReadList. Count:{Count}", list.Count);
return list;
}
@ -104,28 +116,23 @@ namespace PrecastConcretePlantBusinessLogic.BusinessLogic
{
throw new ArgumentNullException(nameof(model));
}
if (!withParams)
{
return;
}
if (model.ReinforcedId < 0)
{
throw new ArgumentNullException("Некорректный идентификатор изделия", nameof(model.ReinforcedId));
throw new ArgumentNullException("Некорректный идентификатор документа", nameof(model.ReinforcedId));
}
if (model.Count <= 0)
{
throw new ArgumentNullException("Количество изделий в заказе должно быть больше 0", nameof(model.Count));
throw new ArgumentNullException("Количество документов в заказе должно быть больше 0", nameof(model.Count));
}
if (model.Sum <= 0)
{
throw new ArgumentNullException("Сумма заказа должна быть больше 0", nameof(model.Sum));
}
_logger.LogInformation("Order. OrderId:{Id}.Sum:{ Sum}. ReinforcedId: { ReinforcedId}", model.Id, model.Sum, model.ReinforcedId);
_logger.LogInformation("Order. OrderID:{Id}.Sum:{ Sum}. ReinforcedId: { ReinforcedId}", model.Id, model.Sum, model.ReinforcedId);
}
}
}

View File

@ -9,12 +9,10 @@ namespace PrecastConcretePlantClientApp.Controllers
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
if (APIClient.Client == null)
@ -23,7 +21,6 @@ namespace PrecastConcretePlantClientApp.Controllers
}
return View(APIClient.GetRequest<List<OrderViewModel>>($"api/main/getorders?clientId={APIClient.Client.Id}"));
}
[HttpGet]
public IActionResult Privacy()
{
@ -33,7 +30,6 @@ namespace PrecastConcretePlantClientApp.Controllers
}
return View(APIClient.Client);
}
[HttpPost]
public void Privacy(string login, string password, string fio)
{
@ -45,37 +41,37 @@ namespace PrecastConcretePlantClientApp.Controllers
{
throw new Exception("Введите логин, пароль и ФИО");
}
APIClient.PostRequest("api/client/updatedata", new ClientBindingModel
APIClient.PostRequest("api/client/updatedata", new
ClientBindingModel
{
Id = APIClient.Client.Id,
ClientFIO = fio,
Email = login,
Password = password
});
APIClient.Client.ClientFIO = fio;
APIClient.Client.Email = login;
APIClient.Client.Password = password;
Response.Redirect("Index");
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
return View(new ErrorViewModel
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier
});
}
[HttpGet]
public IActionResult Enter()
{
return View();
}
[HttpPost]
public void Enter(string login, string password)
{
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
{
{
throw new Exception("Введите логин и пароль");
}
APIClient.Client = APIClient.GetRequest<ClientViewModel>($"api/client/login?login={login}&password={password}");
@ -85,18 +81,16 @@ namespace PrecastConcretePlantClientApp.Controllers
}
Response.Redirect("Index");
}
[HttpGet]
public IActionResult Register()
{
return View();
}
[HttpPost]
public void Register(string login, string password, string fio)
{
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(fio))
{
{
throw new Exception("Введите логин, пароль и ФИО");
}
APIClient.PostRequest("api/client/register", new ClientBindingModel
@ -108,14 +102,12 @@ namespace PrecastConcretePlantClientApp.Controllers
Response.Redirect("Enter");
return;
}
[HttpGet]
public IActionResult Create()
{
ViewBag.Reinforcedies = APIClient.GetRequest<List<ReinforcedViewModel>>("api/main/getreinforcedlist");
return View();
}
[HttpPost]
public void Create(int reinforced, int count)
{
@ -136,12 +128,11 @@ namespace PrecastConcretePlantClientApp.Controllers
});
Response.Redirect("Index");
}
[HttpPost]
public double Calc(int count, int reinforced)
{
var prod = APIClient.GetRequest<ReinforcedViewModel>($"api/main/getreinforced?reinforcedId={reinforced}");
return count * (prod?.Price ?? 1);
var doc = APIClient.GetRequest<ReinforcedViewModel>($"api/main/getreinforced?reinforcedId={reinforced}");
return count * (doc?.Price ?? 1);
}
}
}

View File

@ -13,7 +13,6 @@ namespace PrecastConcretePlantContracts.BindingModels
public int Id { get; set; }
public int ReinforcedId { get; set; }
public int ClientId { get; set; }
public string ReinforcedName { get; set; } = string.Empty;
public int Count { get; set; }
public double Sum { get; set; }
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;

View File

@ -11,25 +11,32 @@ namespace PrecastConcretePlantContracts.ViewModels
{
public class OrderViewModel : IOrderModel
{
public int ClientId { get; set; }
public int ReinforcedId { get; set; }
[DisplayName("Номер")]
public int Id { get; set; }
[DisplayName("Фамилия клиента")]
public string ClientFIO { get; set; } = string.Empty;
[DisplayName("Изделие")]
public int ReinforcedId { get; set; }
[DisplayName("Документ")]
public string ReinforcedName { get; set; } = string.Empty;
public int ClientId { get; set; }
[DisplayName("ФИО клиента")]
public string ClientFIO { get; set; } = string.Empty;
[DisplayName("Количество")]
public int Count { get; set; }
[DisplayName("Сумма")]
public double Sum { get; set; }
[DisplayName("Статус")]
public OrderStatus Status { get; set; } = OrderStatus.Неизвестен;
[DisplayName("Дата создания")]
public DateTime DateCreate { get; set; } = DateTime.Now;
[DisplayName("Дата выполнения")]
public DateTime? DateImplement { get; set; }
}
}

View File

@ -10,7 +10,7 @@ namespace PrecastConcretePlantDataModels.Enums
public interface IOrderModel : IId
{
int ReinforcedId { get; }
string ReinforcedName { get; }
int ClientId { get; }
int Count { get; }
double Sum { get; }
OrderStatus Status { get; }

View File

@ -1,4 +1,5 @@
using PrecastConcretePlantContracts.BindingModels;
using Microsoft.EntityFrameworkCore;
using PrecastConcretePlantContracts.BindingModels;
using PrecastConcretePlantContracts.SearchModels;
using PrecastConcretePlantContracts.StoragesContracts;
using PrecastConcretePlantContracts.ViewModels;
@ -13,86 +14,80 @@ namespace PrecastConcretePlantDatabaseImplement.Implements
{
public class OrderStorage : IOrderStorage
{
public OrderViewModel? Delete(OrderBindingModel model)
{
using var context = new PrecastConcretePlantDataBase();
var element = context.Orders.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.Orders.Remove(element);
context.SaveChanges();
return element.GetViewModel;
}
return null;
}
public OrderViewModel? GetElement(OrderSearchModel model)
{
if (!model.Id.HasValue)
{
return null;
}
using var context = new PrecastConcretePlantDataBase();
return context.Orders.FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
return context.Orders.Include(x => x.Reinforced).FirstOrDefault(x => (model.Id.HasValue && x.Id == model.Id))?.GetViewModel;
}
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
{
if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue)
if (!model.Id.HasValue && !model.DateFrom.HasValue && !model.DateTo.HasValue && !model.ClientId.HasValue)
{
return new();
}
using var context = new PrecastConcretePlantDataBase();
return context.Orders.Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
if (model.ClientId.HasValue)
{
return context.Orders
.Include(x => x.Client)
.Where(x => x.ClientId == model.ClientId)
.Select(x => x.GetViewModel)
.ToList();
}
return context.Orders
.Include(x => x.Reinforced)
.Where(x => x.Id == model.Id || model.DateFrom <= x.DateCreate && x.DateCreate <= model.DateTo)
.Select(x => x.GetViewModel)
.ToList();
}
public List<OrderViewModel> GetFullList()
{
using var context = new PrecastConcretePlantDataBase();
return context.Orders.Select(x => x.GetViewModel).ToList();
return context.Orders.Include(x => x.Reinforced).Select(x => x.GetViewModel).ToList();
}
public OrderViewModel? Insert(OrderBindingModel model)
{
var newOrder = Order.Create(model);
if (newOrder == null)
{
return null;
}
using var context = new PrecastConcretePlantDataBase();
context.Orders.Add(newOrder);
context.SaveChanges();
return newOrder.GetViewModel;
return context.Orders.Include(x => x.Reinforced).FirstOrDefault(x => x.Id == newOrder.Id)?.GetViewModel;
}
public OrderViewModel? Update(OrderBindingModel model)
{
using var context = new PrecastConcretePlantDataBase();
var order = context.Orders.FirstOrDefault(x => x.Id == model.Id);
if (order == null)
{
return null;
}
order.Update(model);
context.SaveChanges();
return order.GetViewModel;
return context.Orders.Include(x => x.Reinforced).FirstOrDefault(x => x.Id == model.Id)?.GetViewModel;
}
public OrderViewModel? Delete(OrderBindingModel model)
{
using var context = new PrecastConcretePlantDataBase();
var element = context.Orders.FirstOrDefault(rec => rec.Id == model.Id);
if (element != null)
{
context.Orders.Remove(element);
context.SaveChanges();
return element.GetViewModel;
}
return null;
}
}
}

View File

@ -12,7 +12,7 @@ using PrecastConcretePlantDatabaseImplement;
namespace PrecastConcretePlantDatabaseImplement.Migrations
{
[DbContext(typeof(PrecastConcretePlantDataBase))]
[Migration("20230326191118_Restart")]
[Migration("20230327202214_Restart")]
partial class Restart
{
/// <inheritdoc />
@ -78,7 +78,7 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("ClientId")
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<int>("Count")
@ -93,10 +93,6 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
b.Property<int>("ReinforcedId")
.HasColumnType("int");
b.Property<string>("ReinforcedName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
@ -160,9 +156,11 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
modelBuilder.Entity("PrecastConcretePlantDatabaseImplement.Models.Order", b =>
{
b.HasOne("PrecastConcretePlantDatabaseImplement.Models.Client", null)
b.HasOne("PrecastConcretePlantDatabaseImplement.Models.Client", "Client")
.WithMany("Orders")
.HasForeignKey("ClientId");
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PrecastConcretePlantDatabaseImplement.Models.Reinforced", "Reinforced")
.WithMany("Orders")
@ -170,6 +168,8 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
b.Navigation("Reinforced");
});

View File

@ -61,13 +61,12 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ReinforcedId = table.Column<int>(type: "int", nullable: false),
ReinforcedName = table.Column<string>(type: "nvarchar(max)", nullable: false),
ClientId = table.Column<int>(type: "int", nullable: false),
Count = table.Column<int>(type: "int", nullable: false),
Sum = table.Column<double>(type: "float", nullable: false),
Status = table.Column<int>(type: "int", nullable: false),
DateCreate = table.Column<DateTime>(type: "datetime2", nullable: false),
DateImplement = table.Column<DateTime>(type: "datetime2", nullable: true),
ClientId = table.Column<int>(type: "int", nullable: true)
DateImplement = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
@ -76,7 +75,8 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
name: "FK_Orders_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id");
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Orders_Reinforcedies_ReinforcedId",
column: x => x.ReinforcedId,

View File

@ -75,7 +75,7 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int?>("ClientId")
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<int>("Count")
@ -90,10 +90,6 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
b.Property<int>("ReinforcedId")
.HasColumnType("int");
b.Property<string>("ReinforcedName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
@ -157,9 +153,11 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
modelBuilder.Entity("PrecastConcretePlantDatabaseImplement.Models.Order", b =>
{
b.HasOne("PrecastConcretePlantDatabaseImplement.Models.Client", null)
b.HasOne("PrecastConcretePlantDatabaseImplement.Models.Client", "Client")
.WithMany("Orders")
.HasForeignKey("ClientId");
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PrecastConcretePlantDatabaseImplement.Models.Reinforced", "Reinforced")
.WithMany("Orders")
@ -167,6 +165,8 @@ namespace PrecastConcretePlantDatabaseImplement.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
b.Navigation("Reinforced");
});

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
@ -13,26 +14,22 @@ namespace PrecastConcretePlantDatabaseImplement.Models
public class Order : IOrderModel
{
public int Id { get; private set; }
[Required]
public int ReinforcedId { get; private set; }
public string ReinforcedName { get; private set; } = string.Empty;
[Required]
public int ClientId { get; private set; }
[Required]
public int Count { get; private set; }
[Required]
public double Sum { get; private set; }
[Required]
public OrderStatus Status { get; private set; } = OrderStatus.Неизвестен;
[Required]
public DateTime DateCreate { get; private set; } = DateTime.Now;
public DateTime? DateImplement { get; private set; }
public virtual Reinforced Reinforced { get; set; }
public virtual Client Client { get; set; }
public static Order? Create(OrderBindingModel? model)
{
@ -40,17 +37,16 @@ namespace PrecastConcretePlantDatabaseImplement.Models
{
return null;
}
return new Order()
return new Order
{
Id = model.Id,
ReinforcedId = model.ReinforcedId,
ReinforcedName = model.ReinforcedName,
ClientId = model.ClientId,
Count = model.Count,
Sum = model.Sum,
Status = model.Status,
DateCreate = model.DateCreate,
DateImplement = model.DateImplement
DateImplement = model.DateImplement,
Id = model.Id,
};
}
@ -60,26 +56,30 @@ namespace PrecastConcretePlantDatabaseImplement.Models
{
return;
}
ReinforcedId = model.ReinforcedId;
ReinforcedName = model.ReinforcedName;
Count = model.Count;
Sum = model.Sum;
Status = model.Status;
DateCreate = model.DateCreate;
DateImplement = model.DateImplement;
}
public OrderViewModel GetViewModel => new()
public OrderViewModel GetViewModel
{
Id = Id,
ReinforcedId = ReinforcedId,
ReinforcedName = ReinforcedName,
Count = Count,
Sum = Sum,
Status = Status,
DateCreate = DateCreate,
DateImplement = DateImplement
};
get
{
var context = new PrecastConcretePlantDataBase();
return new()
{
ReinforcedId = ReinforcedId,
ClientId = ClientId,
Count = Count,
Sum = Sum,
DateCreate = DateCreate,
DateImplement = DateImplement,
Id = Id,
Status = Status,
ReinforcedName = context.Reinforcedies.FirstOrDefault(x => x.Id == ReinforcedId)?.ReinforcedName ?? string.Empty,
ClientFIO = context.Clients.FirstOrDefault(x => x.Id == ClientId)?.ClientFIO ?? string.Empty
};
}
}
}
}

View File

@ -15,8 +15,6 @@ namespace PrecastConcretePlantFileImplement.Models
public int ReinforcedId { get; private set; }
public int ClientId { get; set; }
public string ReinforcedName { get; private set; } = string.Empty;
public int Count { get; private set; }
public double Sum { get; private set; }
@ -39,7 +37,6 @@ namespace PrecastConcretePlantFileImplement.Models
{
Id = model.Id,
ReinforcedId = model.ReinforcedId,
ReinforcedName = model.ReinforcedName,
ClientId = model.ClientId,
Count = model.Count,
Sum = model.Sum,
@ -61,7 +58,6 @@ namespace PrecastConcretePlantFileImplement.Models
Id = Convert.ToInt32(element.Attribute("Id")!.Value),
ReinforcedId = Convert.ToInt32(element.Element("ReinforcedId")!.Value),
ClientId = Convert.ToInt32(element.Element("ClientId")!.Value),
ReinforcedName = element.Element("ReinforcedName")!.Value,
Count = Convert.ToInt32(element.Element("Count")!.Value),
Sum = Convert.ToDouble(element.Element("Sum")!.Value),
Status = (OrderStatus)Enum.Parse(typeof(OrderStatus), element.Element("Status")!.Value),
@ -81,7 +77,6 @@ namespace PrecastConcretePlantFileImplement.Models
return;
}
ReinforcedId = model.ReinforcedId;
ReinforcedName = model.ReinforcedName;
Count = model.Count;
Sum = model.Sum;
Status = model.Status;
@ -105,7 +100,6 @@ namespace PrecastConcretePlantFileImplement.Models
public XElement GetXElement => new("Order",
new XAttribute("Id", Id),
new XElement("ReinforcedName", ReinforcedName),
new XElement("ReinforcedId", ReinforcedId.ToString()),
new XElement("ClientId", ClientId),
new XElement("Count", Count.ToString()),

View File

@ -15,7 +15,6 @@ namespace PrecastConcretePlantListImplement.Models
{
public int ReinforcedId { get; private set; }
public int ClientId { get; private set; }
public string ReinforcedName { get; private set; }
public int Count { get; private set; }
@ -40,7 +39,6 @@ namespace PrecastConcretePlantListImplement.Models
Id = model.Id,
ReinforcedId = model.ReinforcedId,
ClientId = model.ClientId,
ReinforcedName = model.ReinforcedName,
Count = model.Count,
Sum = model.Sum,
Status = model.Status,
@ -56,7 +54,6 @@ namespace PrecastConcretePlantListImplement.Models
return;
}
ReinforcedId = model.ReinforcedId;
ReinforcedName = model.ReinforcedName;
Count = model.Count;
Sum = model.Sum;
Status = model.Status;
@ -69,7 +66,6 @@ namespace PrecastConcretePlantListImplement.Models
Id = Id,
ReinforcedId = ReinforcedId,
ClientId = ClientId,
ReinforcedName = ReinforcedName,
Count = Count,
Sum = Sum,
Status = Status,

View File

@ -1,23 +1,14 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:43427",
"sslPort": 44365
}
},
{
"profiles": {
"PrecastConcretePlantRestApi": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7197;http://localhost:5197",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7197;http://localhost:5197"
},
"IIS Express": {
"commandName": "IISExpress",
@ -27,5 +18,14 @@
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
},
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:64248/",
"sslPort": 44372
}
}
}
}