Вроде работает
This commit is contained in:
parent
a460ea0308
commit
e1e37a6611
@ -8,6 +8,7 @@ using ComputerShopDataModels.Models;
|
|||||||
using ComputerShopContracts.SearchModels;
|
using ComputerShopContracts.SearchModels;
|
||||||
using ComputerShopContracts.BusinessLogicContracts;
|
using ComputerShopContracts.BusinessLogicContracts;
|
||||||
using DocumentFormat.OpenXml.Bibliography;
|
using DocumentFormat.OpenXml.Bibliography;
|
||||||
|
using Microsoft.AspNetCore.DataProtection.Repositories;
|
||||||
|
|
||||||
namespace ComputerShopImplementerApp.Controllers
|
namespace ComputerShopImplementerApp.Controllers
|
||||||
{
|
{
|
||||||
@ -46,9 +47,11 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public OrderViewModel GetOrder(int orderId)
|
public OrderViewModel GetOrder(int orderId)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Необходима авторизация");
|
Response.Redirect("Enter");
|
||||||
}
|
}
|
||||||
var result = APIUser.GetRequest<OrderViewModel>($"api/order/getorder?id={orderId}");
|
var result = APIUser.GetRequest<OrderViewModel>($"api/order/getorder?id={orderId}");
|
||||||
if (result == null)
|
if (result == null)
|
||||||
@ -56,6 +59,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -81,6 +85,9 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
//{
|
//{
|
||||||
// throw new Exception("Количество и сумма должны быть больше 0");
|
// throw new Exception("Количество и сумма должны быть больше 0");
|
||||||
//}
|
//}
|
||||||
|
//if ()
|
||||||
|
if (date != DateTime.MinValue)
|
||||||
|
{
|
||||||
APIUser.PostRequest("api/order/createorder", new OrderBindingModel
|
APIUser.PostRequest("api/order/createorder", new OrderBindingModel
|
||||||
{
|
{
|
||||||
UserId = APIUser.User.Id,
|
UserId = APIUser.User.Id,
|
||||||
@ -88,7 +95,17 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
DateCreate = date,
|
DateCreate = date,
|
||||||
Sum = 0
|
Sum = 0
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Orders");
|
Response.Redirect("Orders");
|
||||||
|
//try
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
//catch (Exception)
|
||||||
|
//{
|
||||||
|
// Response.Redirect("CreateOrder");
|
||||||
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -111,20 +128,18 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
Response.Redirect("~/Home/Entry");
|
||||||
}
|
}
|
||||||
if (order == null)
|
//if (order == null)
|
||||||
{
|
|
||||||
throw new Exception("Выберите заказ для изменения");
|
|
||||||
}
|
|
||||||
if (status == null)
|
|
||||||
{
|
|
||||||
throw new Exception("Выберите статус для заказа");
|
|
||||||
}
|
|
||||||
//if (count <= 0)
|
|
||||||
//{
|
//{
|
||||||
// throw new Exception("Количество и сумма должны быть больше 0");
|
// throw new Exception("Выберите заказ для изменения");
|
||||||
//}
|
//}
|
||||||
|
//if (status == null)
|
||||||
|
//{
|
||||||
|
// throw new Exception("Выберите статус для заказа");
|
||||||
|
//}
|
||||||
|
if (order > 0 && date != DateTime.MinValue)
|
||||||
|
{
|
||||||
APIUser.PostRequest("api/order/updateorder", new OrderBindingModel
|
APIUser.PostRequest("api/order/updateorder", new OrderBindingModel
|
||||||
{
|
{
|
||||||
Id = order,
|
Id = order,
|
||||||
@ -133,6 +148,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
DateCreate = date,
|
DateCreate = date,
|
||||||
Sum = sum
|
Sum = sum
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Orders");
|
Response.Redirect("Orders");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,16 +170,17 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
Redirect("~/Home/Enter");
|
||||||
|
//throw new Exception("Вход только авторизованным");
|
||||||
}
|
}
|
||||||
//if (count <= 0)
|
|
||||||
//{
|
if (order > 0)
|
||||||
// throw new Exception("Количество и сумма должны быть больше 0");
|
{
|
||||||
//}
|
|
||||||
APIUser.PostRequest("api/order/deleteorder", new OrderBindingModel
|
APIUser.PostRequest("api/order/deleteorder", new OrderBindingModel
|
||||||
{
|
{
|
||||||
Id = order
|
Id = order
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Orders");
|
Response.Redirect("Orders");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +206,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Необходима авторизация");
|
Redirect("~/Home/Enter");
|
||||||
|
//throw new Exception("Вход только авторизованным");
|
||||||
}
|
}
|
||||||
//GetRequestShipmentAsync
|
//GetRequestShipmentAsync
|
||||||
var result = await APIUser.GetRequestShipmentAsync<ShipmentViewModel>($"api/shipment/getshipment?id={shipmentId}");
|
var result = await APIUser.GetRequestShipmentAsync<ShipmentViewModel>($"api/shipment/getshipment?id={shipmentId}");
|
||||||
@ -198,6 +216,15 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
//try
|
||||||
|
//{
|
||||||
|
|
||||||
|
//}
|
||||||
|
//catch (Exception)
|
||||||
|
//{
|
||||||
|
// Response.Redirect("Shipments");
|
||||||
|
// return default;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -206,7 +233,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
||||||
return View();
|
return View();
|
||||||
@ -218,7 +245,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
// Создаем словарь из выбранных заказов
|
// Создаем словарь из выбранных заказов
|
||||||
var selectedOrders = new Dictionary<int, IOrderModel>();
|
var selectedOrders = new Dictionary<int, IOrderModel>();
|
||||||
@ -228,7 +255,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
//var orderModel = APIUser.GetRequest<OrderViewModel>($"api/order/getorder?id={orderId}");
|
//var orderModel = APIUser.GetRequest<OrderViewModel>($"api/order/getorder?id={orderId}");
|
||||||
//selectedOrders.Add(orderId, orderModel);
|
//selectedOrders.Add(orderId, orderModel);
|
||||||
}
|
}
|
||||||
|
if (!string.IsNullOrEmpty(providerName) && date != DateTime.MinValue && APIUser.User != null)
|
||||||
|
{
|
||||||
APIUser.PostRequest("api/shipment/createshipment", new ShipmentBindingModel
|
APIUser.PostRequest("api/shipment/createshipment", new ShipmentBindingModel
|
||||||
{
|
{
|
||||||
UserId = APIUser.User.Id,
|
UserId = APIUser.User.Id,
|
||||||
@ -236,6 +264,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
DateShipment = date,
|
DateShipment = date,
|
||||||
ShipmentOrders = selectedOrders
|
ShipmentOrders = selectedOrders
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Shipments");
|
Response.Redirect("Shipments");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,7 +275,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
return Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
ViewBag.Shipments = await APIUser.GetRequestShipmentAsync<List<ShipmentViewModel>>($"api/shipment/getshipments?userId={APIUser.User.Id}");
|
ViewBag.Shipments = await APIUser.GetRequestShipmentAsync<List<ShipmentViewModel>>($"api/shipment/getshipments?userId={APIUser.User.Id}");
|
||||||
ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
||||||
@ -258,15 +287,15 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
// Создаем словарь из выбранных заказов
|
|
||||||
var selectedOrders = new Dictionary<int, IOrderModel>();
|
var selectedOrders = new Dictionary<int, IOrderModel>();
|
||||||
foreach (var orderId in orders)
|
foreach (var orderId in orders)
|
||||||
{
|
{
|
||||||
selectedOrders.Add(orderId, new OrderSearchModel { Id = orderId } as IOrderModel);
|
selectedOrders.Add(orderId, new OrderSearchModel { Id = orderId } as IOrderModel);
|
||||||
}
|
}
|
||||||
|
if (shipment > 0 && !string.IsNullOrEmpty(providerName) && date != DateTime.MinValue && APIUser.User != null)
|
||||||
|
{
|
||||||
APIUser.PostRequest("api/shipment/updateshipment", new ShipmentBindingModel
|
APIUser.PostRequest("api/shipment/updateshipment", new ShipmentBindingModel
|
||||||
{
|
{
|
||||||
Id = shipment,
|
Id = shipment,
|
||||||
@ -275,6 +304,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
DateShipment = date,
|
DateShipment = date,
|
||||||
ShipmentOrders = selectedOrders
|
ShipmentOrders = selectedOrders
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Shipments");
|
Response.Redirect("Shipments");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,7 +313,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
return Redirect("~/Home/Enter");
|
||||||
|
//throw new Exception("Вход только авторизованным");
|
||||||
}
|
}
|
||||||
ViewBag.Shipments = await APIUser.GetRequestShipmentAsync<List<ShipmentViewModel>>($"api/shipment/getshipments?userId={APIUser.User.Id}");
|
ViewBag.Shipments = await APIUser.GetRequestShipmentAsync<List<ShipmentViewModel>>($"api/shipment/getshipments?userId={APIUser.User.Id}");
|
||||||
return View();
|
return View();
|
||||||
@ -310,14 +341,18 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
return Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
|
if (shipment > 0)
|
||||||
|
{
|
||||||
await APIUser.PostRequestAsync("api/shipment/deleteshipment", new ShipmentBindingModel
|
await APIUser.PostRequestAsync("api/shipment/deleteshipment", new ShipmentBindingModel
|
||||||
{
|
{
|
||||||
Id = shipment
|
Id = shipment
|
||||||
});
|
});
|
||||||
return RedirectToAction("Shipments");
|
|
||||||
}
|
}
|
||||||
|
return Redirect("Shipments");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -354,7 +389,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Необходима авторизация");
|
Response.Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
//GetRequestShipmentAsync
|
//GetRequestShipmentAsync
|
||||||
var result = await APIUser.GetRequestRequestAsync<RequestViewModel>($"api/request/getrequest?id={requestId}");
|
var result = await APIUser.GetRequestRequestAsync<RequestViewModel>($"api/request/getrequest?id={requestId}");
|
||||||
@ -372,7 +407,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
return Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
||||||
return View();
|
return View();
|
||||||
@ -384,7 +419,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
Redirect("~/Home/Enter");
|
||||||
|
//throw new Exception("Вход только авторизованным");
|
||||||
}
|
}
|
||||||
// Создаем словарь из выбранных заказов
|
// Создаем словарь из выбранных заказов
|
||||||
var selectedOrders = new Dictionary<int, IOrderModel>();
|
var selectedOrders = new Dictionary<int, IOrderModel>();
|
||||||
@ -392,7 +428,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
selectedOrders.Add(orderId, new OrderSearchModel { Id = orderId } as IOrderModel);
|
selectedOrders.Add(orderId, new OrderSearchModel { Id = orderId } as IOrderModel);
|
||||||
}
|
}
|
||||||
|
if (!string.IsNullOrEmpty(clientFIO) && date != DateTime.MinValue)
|
||||||
|
{
|
||||||
APIUser.PostRequest("api/request/createrequest", new RequestBindingModel
|
APIUser.PostRequest("api/request/createrequest", new RequestBindingModel
|
||||||
{
|
{
|
||||||
UserId = APIUser.User.Id,
|
UserId = APIUser.User.Id,
|
||||||
@ -400,6 +437,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
DateRequest = date,
|
DateRequest = date,
|
||||||
RequestOrders = selectedOrders
|
RequestOrders = selectedOrders
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Requests");
|
Response.Redirect("Requests");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,7 +447,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
return Redirect("~/Home/Enter");
|
||||||
|
//throw new Exception("Вход только авторизованным");
|
||||||
}
|
}
|
||||||
ViewBag.Requests = await APIUser.GetRequestRequestAsync<List<RequestViewModel>>($"api/request/getrequests?userId={APIUser.User.Id}");
|
ViewBag.Requests = await APIUser.GetRequestRequestAsync<List<RequestViewModel>>($"api/request/getrequests?userId={APIUser.User.Id}");
|
||||||
ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
||||||
@ -421,15 +460,16 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
Response.Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
// Создаем словарь из выбранных заказов
|
|
||||||
var selectedOrders = new Dictionary<int, IOrderModel>();
|
var selectedOrders = new Dictionary<int, IOrderModel>();
|
||||||
foreach (var orderId in orders)
|
foreach (var orderId in orders)
|
||||||
{
|
{
|
||||||
selectedOrders.Add(orderId, new OrderSearchModel { Id = orderId } as IOrderModel);
|
selectedOrders.Add(orderId, new OrderSearchModel { Id = orderId } as IOrderModel);
|
||||||
}
|
}
|
||||||
|
if (request > 0 && !string.IsNullOrEmpty(clientFIO) && date != DateTime.MinValue)
|
||||||
|
{
|
||||||
APIUser.PostRequest("api/request/updaterequest", new RequestBindingModel
|
APIUser.PostRequest("api/request/updaterequest", new RequestBindingModel
|
||||||
{
|
{
|
||||||
Id = request,
|
Id = request,
|
||||||
@ -438,6 +478,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
DateRequest = date,
|
DateRequest = date,
|
||||||
RequestOrders = selectedOrders
|
RequestOrders = selectedOrders
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Requests");
|
Response.Redirect("Requests");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +488,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
return Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
ViewBag.Requests = await APIUser.GetRequestRequestAsync<List<RequestViewModel>>($"api/request/getrequests?userId={APIUser.User.Id}");
|
ViewBag.Requests = await APIUser.GetRequestRequestAsync<List<RequestViewModel>>($"api/request/getrequests?userId={APIUser.User.Id}");
|
||||||
//ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
//ViewBag.Orders = APIUser.GetRequest<List<OrderViewModel>>($"api/order/getorders?userId={APIUser.User.Id}");
|
||||||
@ -460,14 +501,16 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
Redirect("~/Home/Enter");
|
||||||
}
|
}
|
||||||
|
if (request > 0 && assembly > 0)
|
||||||
|
{
|
||||||
APIUser.PostRequest("api/request/connectRequestAssembly", new RequestBindingModel
|
APIUser.PostRequest("api/request/connectRequestAssembly", new RequestBindingModel
|
||||||
{
|
{
|
||||||
Id = request,
|
Id = request,
|
||||||
AssemblyId = assembly
|
AssemblyId = assembly
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Requests");
|
Response.Redirect("Requests");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,10 +535,13 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
throw new Exception("Вход только авторизованным");
|
||||||
}
|
}
|
||||||
|
if (request > 0)
|
||||||
|
{
|
||||||
await APIUser.PostRequestAsync("api/request/deleterequest", new RequestBindingModel
|
await APIUser.PostRequestAsync("api/request/deleterequest", new RequestBindingModel
|
||||||
{
|
{
|
||||||
Id = request
|
Id = request
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return RedirectToAction("Requests");
|
return RedirectToAction("Requests");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -520,17 +566,9 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
Redirect("Index");
|
Redirect("Index");
|
||||||
throw new Exception("Вход только авторизованным");
|
|
||||||
}
|
}
|
||||||
if (orders.Length <= 0)
|
if (orders.Length > 0 && !string.IsNullOrEmpty(type))
|
||||||
{
|
{
|
||||||
throw new Exception("Выберите хотя бы 1 заказ");
|
|
||||||
}
|
|
||||||
if (string.IsNullOrEmpty(type))
|
|
||||||
{
|
|
||||||
throw new Exception("Неверный тип отчета");
|
|
||||||
}
|
|
||||||
|
|
||||||
//Преобразование массива в список
|
//Преобразование массива в список
|
||||||
List<int> ids = new List<int>();
|
List<int> ids = new List<int>();
|
||||||
foreach (var item in orders)
|
foreach (var item in orders)
|
||||||
@ -558,6 +596,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
Response.Redirect("Index");
|
Response.Redirect("Index");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Response.Redirect("Index");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
@ -579,21 +619,15 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
{
|
{
|
||||||
throw new Exception("Вход только авторизованным");
|
throw new Exception("Вход только авторизованным");
|
||||||
}
|
}
|
||||||
List<ReportOrdersViewModel> result;
|
if (dateFrom != DateTime.MinValue && dateTo != DateTime.MinValue)
|
||||||
try
|
|
||||||
{
|
{
|
||||||
|
List<ReportOrdersViewModel> result;
|
||||||
result = _logic.GetReportOrdersByDates(new ReportBindingModel
|
result = _logic.GetReportOrdersByDates(new ReportBindingModel
|
||||||
{
|
{
|
||||||
UserId = APIUser.User.Id,
|
UserId = APIUser.User.Id,
|
||||||
DateFrom = dateFrom,
|
DateFrom = dateFrom,
|
||||||
DateTo = dateTo
|
DateTo = dateTo
|
||||||
});
|
});
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
_logger.LogError(ex, "Ошибка создания отчета");
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
string table = "";
|
string table = "";
|
||||||
//МБ НЕ НДО ПРИСВАИВАТЬ КЛАСС u-table-entity
|
//МБ НЕ НДО ПРИСВАИВАТЬ КЛАСС u-table-entity
|
||||||
table += $"<table class=\"u-table-entity\">";
|
table += $"<table class=\"u-table-entity\">";
|
||||||
@ -677,6 +711,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
table += "</table>";
|
table += "</table>";
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void ReportOrdersByDates(DateTime dateFrom, DateTime dateTo)
|
public void ReportOrdersByDates(DateTime dateFrom, DateTime dateTo)
|
||||||
@ -689,6 +725,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
//{
|
//{
|
||||||
// throw new Exception("Email пуст");
|
// throw new Exception("Email пуст");
|
||||||
//}
|
//}
|
||||||
|
if (dateFrom != DateTime.MinValue && dateTo != DateTime.MinValue)
|
||||||
|
{
|
||||||
APIUser.PostRequest("api/order/CreateReportToPDFFile", new ReportBindingModel
|
APIUser.PostRequest("api/order/CreateReportToPDFFile", new ReportBindingModel
|
||||||
{
|
{
|
||||||
FileName = "C:\\!КУРСОВАЯ\\Отчёт за период.pdf",
|
FileName = "C:\\!КУРСОВАЯ\\Отчёт за период.pdf",
|
||||||
@ -703,6 +741,7 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
Subject = "Отчет за период",
|
Subject = "Отчет за период",
|
||||||
Text = "Отчет по заказам с " + dateFrom.ToShortDateString() + " по " + dateTo.ToShortDateString()
|
Text = "Отчет по заказам с " + dateFrom.ToShortDateString() + " по " + dateTo.ToShortDateString()
|
||||||
});
|
});
|
||||||
|
}
|
||||||
Response.Redirect("Index");
|
Response.Redirect("Index");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,6 +760,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Privacy(string login, string password, string email)
|
public void Privacy(string login, string password, string email)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (APIUser.User == null)
|
if (APIUser.User == null)
|
||||||
{
|
{
|
||||||
@ -743,6 +784,11 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
APIUser.User.Email = email;
|
APIUser.User.Email = email;
|
||||||
Response.Redirect("Index");
|
Response.Redirect("Index");
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Response.Redirect("Index");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
public IActionResult Error()
|
public IActionResult Error()
|
||||||
@ -759,6 +805,16 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Enter(string login, string password)
|
public void Enter(string login, string password)
|
||||||
{
|
{
|
||||||
|
//if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
|
||||||
|
//{
|
||||||
|
// Response.Redirect("Enter");
|
||||||
|
//}
|
||||||
|
//APIUser.User = APIUser.GetRequest<UserViewModel>($"api/user/loginimplementer?login={login}&password={password}");
|
||||||
|
//if (APIUser.User == null)
|
||||||
|
//{
|
||||||
|
// Response.Redirect("Enter");
|
||||||
|
//}
|
||||||
|
//Response.Redirect("Index");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
|
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password))
|
||||||
@ -786,6 +842,8 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public void Register(string login, string password, string email)
|
public void Register(string login, string password, string email)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email))
|
if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(email))
|
||||||
{
|
{
|
||||||
@ -800,5 +858,10 @@ namespace ComputerShopImplementerApp.Controllers
|
|||||||
Response.Redirect("Enter");
|
Response.Redirect("Enter");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
Response.Redirect("Register");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -10,11 +10,11 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Выберите завку:</label>
|
<label class="mb-3">Выберите завку:</label>
|
||||||
<select id="request" name="request" class="form-control">
|
<select id="request" name="request" class="form-control mb-3">
|
||||||
<option selected disabled>Выберите заявку</option>
|
<option selected disabled>Выберите заявку</option>
|
||||||
@foreach (var request in ViewBag.Requests)
|
@foreach (var request in ViewBag.Requests)
|
||||||
{
|
{
|
||||||
<option value="@request.Id">@request.DateRequest</option>
|
<option value="@request.Id">@request.Id) @request.DateRequest</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -23,7 +23,7 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Выберите сборку:</label>
|
<label class="mb-3">Выберите сборку:</label>
|
||||||
<select id="assembly" name="assembly" class="form-control">
|
<select id="assembly" name="assembly" class="form-control mb-3">
|
||||||
<option selected disabled>Выберите сборку</option>
|
<option selected disabled>Выберите сборку</option>
|
||||||
@foreach (var assembly in ViewBag.Assemblies)
|
@foreach (var assembly in ViewBag.Assemblies)
|
||||||
{
|
{
|
||||||
@ -87,9 +87,10 @@
|
|||||||
if (result.requestOrders.hasOwnProperty(orderId)) {
|
if (result.requestOrders.hasOwnProperty(orderId)) {
|
||||||
var order = result.requestOrders[orderId];
|
var order = result.requestOrders[orderId];
|
||||||
var localDate = formatDate(order.dateCreate);
|
var localDate = formatDate(order.dateCreate);
|
||||||
|
var optionText = orderId + ') ' + localDate;
|
||||||
$('#currentOrders').append($('<option>', {
|
$('#currentOrders').append($('<option>', {
|
||||||
value: orderId,
|
value: orderId,
|
||||||
text: localDate
|
text: optionText
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4 mb-3">Статус заказа:</div>
|
<div class="mb-3">Статус заказа:</div>
|
||||||
<div class="col-8 mb-3">
|
<div class="mb-3">
|
||||||
<select id="status" name="status" class="form-control">
|
<select id="status" name="status" class="form-control">
|
||||||
@{
|
@{
|
||||||
foreach (var status in Enum.GetValues(typeof(OrderStatus)))
|
foreach (var status in Enum.GetValues(typeof(OrderStatus)))
|
||||||
@ -22,12 +22,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4 mb-3">Дата создания:</div>
|
<div class="mb-3">Дата создания:</div>
|
||||||
<div class="col-8 mb-3"><input type="datetime-local" id="date" name="date" step="1"></div>
|
<div class="mb-3"><input type="datetime-local" id="date" name="date" step="1"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-3">
|
<div class="row">
|
||||||
<div class="col-4">Сумма:</div>
|
<div class="mb-3">Сумма:</div>
|
||||||
<div class="col-8"><input type="text" id="sum" name="sum" readonly /></div>
|
<div class="mb-3"><input type="text" id="sum" name="sum" readonly /></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8"></div>
|
<div class="col-8"></div>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
@{
|
@{
|
||||||
foreach (var order in ViewBag.Orders)
|
foreach (var order in ViewBag.Orders)
|
||||||
{
|
{
|
||||||
<option value="@order.Id">@order.DateCreate</option>
|
<option value="@order.Id">@order.Id) @order.DateCreate</option>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
|
@ -13,46 +13,22 @@
|
|||||||
<option selected disabled>Выберите заказ</option>
|
<option selected disabled>Выберите заказ</option>
|
||||||
@foreach (var order in ViewBag.Orders)
|
@foreach (var order in ViewBag.Orders)
|
||||||
{
|
{
|
||||||
<option value="@order.Id">@order.DateCreate</option>
|
<option value="@order.Id">@order.Id) @order.DateCreate</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
@*<select id="order" name="order" class="form-control" asp-items="@(new SelectList(ViewBag.Orders, "Id", "DateCreate"))"> <option selected disabled>Выберите заказ</option> </select>*@
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Текущий статус заказа:</label>
|
<label class="mb-3">Текущий статус заказа:</label>
|
||||||
@* <input class="mb-3" type="text" id="currentStatus" name="currentStatus" readonly /> *@
|
<span id="currentStatus" style="font-weight: bold;" class="mb-3"></span>
|
||||||
<span id="currentStatus" style="font-weight: bold;"></span>
|
|
||||||
</div>
|
</div>
|
||||||
@* <div class="row">
|
|
||||||
<div class="col-4 mb-3">Статус заказа:</div>
|
|
||||||
<div class="col-8 mb-3">
|
|
||||||
<select id="status" name="status" class="form-control">
|
|
||||||
@{
|
|
||||||
foreach (var status in Enum.GetValues(typeof(OrderStatus)))
|
|
||||||
{
|
|
||||||
<option value="@status">@status</option>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div> *@
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Дата создания:</label>
|
<label class="mb-3">Дата создания:</label>
|
||||||
@* <div class="col-8 mb-3"> *@<input type="datetime-local" id="date" name="date" class="mb-3 form-control">@* </div> *@
|
<input type="datetime-local" id="date" name="date" class="mb-3 form-control">
|
||||||
</div>
|
</div>
|
||||||
@* <div class="row">
|
|
||||||
<div class="col-4 mb-3">Дата создания:</div>
|
|
||||||
<div class="col-8 mb-3"><input type="datetime-local" id="date" name="date"></div>
|
|
||||||
</div> *@
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Сумма:</label>
|
<label>Сумма:</label>
|
||||||
@* <div class="col-8"><input type="text" id="sum" name="sum" readonly /></div> *@
|
|
||||||
<input type="number" id="sum" name="sum" readonly />
|
<input type="number" id="sum" name="sum" readonly />
|
||||||
</div>
|
</div>
|
||||||
@* <div class="row mb-3">
|
|
||||||
<div class="col-4">Сумма:</div>
|
|
||||||
<div class="col-8"><input type="text" id="sum" name="sum" readonly /></div>
|
|
||||||
</div> *@
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8"></div>
|
<div class="col-8"></div>
|
||||||
<div class="col-4"><input type="submit" value="Удалить" class="btn btn-primary" /></div>
|
<div class="col-4"><input type="submit" value="Удалить" class="btn btn-primary" /></div>
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Выберите завку для удаления:</label>
|
<label class="mb-3">Выберите завку для удаления:</label>
|
||||||
<select id="request" name="request" class="form-control">
|
<select id="request" name="request" class="form-control mb-3">
|
||||||
<option selected disabled>Выберите заявку</option>
|
<option selected disabled>Выберите заявку</option>
|
||||||
@foreach (var request in ViewBag.Requests)
|
@foreach (var request in ViewBag.Requests)
|
||||||
{
|
{
|
||||||
<option value="@request.Id">@request.DateRequest</option>
|
<option value="@request.Id">@request.Id) @request.DateRequest</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -67,9 +67,10 @@
|
|||||||
if (result.requestOrders.hasOwnProperty(orderId)) {
|
if (result.requestOrders.hasOwnProperty(orderId)) {
|
||||||
var order = result.requestOrders[orderId];
|
var order = result.requestOrders[orderId];
|
||||||
var localDate = formatDate(order.dateCreate);
|
var localDate = formatDate(order.dateCreate);
|
||||||
|
var optionText = orderId + ') ' + localDate;
|
||||||
$('#currentOrders').append($('<option>', {
|
$('#currentOrders').append($('<option>', {
|
||||||
value: orderId,
|
value: orderId,
|
||||||
text: localDate
|
text: optionText
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Партия товаров для удаления:</label>
|
<label class="mb-3">Партия товаров для удаления:</label>
|
||||||
<select id="shipment" name="shipment" class="form-control">
|
<select id="shipment" name="shipment" class="form-control mb-3">
|
||||||
<option selected disabled>Выберите партию товаров</option>
|
<option selected disabled>Выберите партию товаров</option>
|
||||||
@foreach (var shipment in ViewBag.Shipments)
|
@foreach (var shipment in ViewBag.Shipments)
|
||||||
{
|
{
|
||||||
<option value="@shipment.Id">@shipment.DateShipment</option>
|
<option value="@shipment.Id">@shipment.Id) @shipment.DateShipment</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -67,9 +67,10 @@
|
|||||||
if (result.shipmentOrders.hasOwnProperty(orderId)) {
|
if (result.shipmentOrders.hasOwnProperty(orderId)) {
|
||||||
var order = result.shipmentOrders[orderId];
|
var order = result.shipmentOrders[orderId];
|
||||||
var localDate = formatDate(order.dateCreate);
|
var localDate = formatDate(order.dateCreate);
|
||||||
|
var optionText = orderId + ') ' + localDate;
|
||||||
$('#currentOrders').append($('<option>', {
|
$('#currentOrders').append($('<option>', {
|
||||||
value: orderId,
|
value: orderId,
|
||||||
text: localDate
|
text: optionText
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h1 class="display-4">Welcome</h1>
|
<h1 class="display-4">Приветствуем Вас на сайте компьютерной техники "Ты ж программист" для исполнителя</h1>
|
||||||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
<p>Выберите необходимое действие в шапке страницы</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -21,7 +21,9 @@
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
<a asp-action="CreateOrder">Создать заказ</a>
|
<a asp-action="CreateOrder">Создать заказ</a>
|
||||||
|
<span style="margin-left: 20px;"></span>
|
||||||
<a asp-action="UpdateOrder">Обновить заказ</a>
|
<a asp-action="UpdateOrder">Обновить заказ</a>
|
||||||
|
<span style="margin-left: 20px;"></span>
|
||||||
<a asp-action="DeleteOrder">Удалить заказ</a>
|
<a asp-action="DeleteOrder">Удалить заказ</a>
|
||||||
</p>
|
</p>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Выберите заказы для отчёта:</label>
|
<label class="mb-3">Выберите заказы для отчёта:</label>
|
||||||
<select multiple id="orders" name="orders" class="form-control">
|
<select multiple id="orders" name="orders" class="form-control mb-3">
|
||||||
@* !!!ЕСЛИ НЕ БУДЕТ РАБОТАТЬ, УБРАТЬ ОТСЮДА @order.Sum *@
|
@* !!!ЕСЛИ НЕ БУДЕТ РАБОТАТЬ, УБРАТЬ ОТСЮДА @order.Sum *@
|
||||||
@foreach (var order in ViewBag.Orders)
|
@foreach (var order in ViewBag.Orders)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button class="mt-5" type="button" id="show">Вывести здесь</button>
|
<button class="mt-4 btn btn-primary" type="button" id="show">Вывести здесь</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-3" id="report">
|
<div class="mt-3" id="report">
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,8 +22,11 @@
|
|||||||
// !!!ДОБАВИТЬ ЭТИ МЕТОДЫ В HOME КОНТРОЛЛЕР И ТАКИЕ ЖЕ СТРАНИЦЫ
|
// !!!ДОБАВИТЬ ЭТИ МЕТОДЫ В HOME КОНТРОЛЛЕР И ТАКИЕ ЖЕ СТРАНИЦЫ
|
||||||
<p>
|
<p>
|
||||||
<a asp-action="CreateRequest">Создать заявку</a>
|
<a asp-action="CreateRequest">Создать заявку</a>
|
||||||
|
<span style="margin-left: 20px;"></span>
|
||||||
<a asp-action="ConnectRequestAssembly">Связать заявку со сборкой</a>
|
<a asp-action="ConnectRequestAssembly">Связать заявку со сборкой</a>
|
||||||
|
<span style="margin-left: 20px;"></span>
|
||||||
<a asp-action="UpdateRequest">Обновить заявку</a>
|
<a asp-action="UpdateRequest">Обновить заявку</a>
|
||||||
|
<span style="margin-left: 20px;"></span>
|
||||||
<a asp-action="DeleteRequest">Удалить заявку</a>
|
<a asp-action="DeleteRequest">Удалить заявку</a>
|
||||||
</p>
|
</p>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
|
@ -22,7 +22,9 @@
|
|||||||
// !!!ДОБАВИТЬ ЭТИ МЕТОДЫ В HOME КОНТРОЛЛЕР И ТАКИЕ ЖЕ СТРАНИЦЫ
|
// !!!ДОБАВИТЬ ЭТИ МЕТОДЫ В HOME КОНТРОЛЛЕР И ТАКИЕ ЖЕ СТРАНИЦЫ
|
||||||
<p>
|
<p>
|
||||||
<a asp-action="CreateShipment">Создать партию товаров</a>
|
<a asp-action="CreateShipment">Создать партию товаров</a>
|
||||||
|
<span style="margin-left: 20px;"></span>
|
||||||
<a asp-action="UpdateShipment">Обновить партию товаров</a>
|
<a asp-action="UpdateShipment">Обновить партию товаров</a>
|
||||||
|
<span style="margin-left: 20px;"></span>
|
||||||
<a asp-action="DeleteShipment">Удалить партию товаров</a>
|
<a asp-action="DeleteShipment">Удалить партию товаров</a>
|
||||||
</p>
|
</p>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Выберите заказ для изменения:</label>
|
<label class="mb-3">Выберите заказ для изменения:</label>
|
||||||
<select id="order" name="order" class="form-control">
|
<select id="order" name="order" class="form-control mb-3">
|
||||||
<option selected disabled>Выберите заказ</option>
|
<option selected disabled>Выберите заказ</option>
|
||||||
@foreach (var order in ViewBag.Orders)
|
@foreach (var order in ViewBag.Orders)
|
||||||
{
|
{
|
||||||
<option value="@order.Id">@order.DateCreate</option>
|
<option value="@order.Id">@order.Id) @order.DateCreate</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
@*<select id="order" name="order" class="form-control" asp-items="@(new SelectList(ViewBag.Orders, "Id", "DateCreate"))"> <option selected disabled>Выберите заказ</option> </select>*@
|
@*<select id="order" name="order" class="form-control" asp-items="@(new SelectList(ViewBag.Orders, "Id", "DateCreate"))"> <option selected disabled>Выберите заказ</option> </select>*@
|
||||||
@ -35,38 +35,17 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Текущий статус заказа:</label>
|
<label class="mb-3">Текущий статус заказа:</label>
|
||||||
@* <input class="mb-3" type="text" id="currentStatus" name="currentStatus" readonly /> *@
|
@* <input class="mb-3" type="text" id="currentStatus" name="currentStatus" readonly /> *@
|
||||||
<span id="currentStatus" style="font-weight: bold;"></span>
|
<span id="currentStatus" name="currentStatus" style="font-weight: bold;" class="mb-3"></span>
|
||||||
</div>
|
</div>
|
||||||
@* <div class="row">
|
|
||||||
<div class="col-4 mb-3">Статус заказа:</div>
|
|
||||||
<div class="col-8 mb-3">
|
|
||||||
<select id="status" name="status" class="form-control">
|
|
||||||
@{
|
|
||||||
foreach (var status in Enum.GetValues(typeof(OrderStatus)))
|
|
||||||
{
|
|
||||||
<option value="@status">@status</option>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div> *@
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Дата создания:</label>
|
<label class="mb-3">Дата создания:</label>
|
||||||
<input type="datetime-local" id="date" name="date" class="mb-3 form-control" step="1">
|
<input type="datetime-local" id="date" name="date" class="mb-3 form-control" step="1">
|
||||||
</div>
|
</div>
|
||||||
@* <div class="row">
|
|
||||||
<div class="col-4 mb-3">Дата создания:</div>
|
|
||||||
<div class="col-8 mb-3"><input type="datetime-local" id="date" name="date"></div>
|
|
||||||
</div> *@
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Сумма:</label>
|
<label>Сумма:</label>
|
||||||
@* <div class="col-8"><input type="text" id="sum" name="sum" readonly /></div> *@
|
<input type="number" id="sum" name="sum" readonly class="mb-3"/>
|
||||||
<input type="number" id="sum" name="sum" readonly />
|
|
||||||
</div>
|
</div>
|
||||||
@* <div class="row mb-3">
|
|
||||||
<div class="col-4">Сумма:</div>
|
|
||||||
<div class="col-8"><input type="text" id="sum" name="sum" readonly /></div>
|
|
||||||
</div> *@
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-8"></div>
|
<div class="col-8"></div>
|
||||||
<div class="col-4"><input type="submit" value="Обновить" class="btn btn-primary" /></div>
|
<div class="col-4"><input type="submit" value="Обновить" class="btn btn-primary" /></div>
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Выберите завку для изменения:</label>
|
<label class="mb-3">Выберите завку для изменения:</label>
|
||||||
<select id="request" name="request" class="form-control">
|
<select id="request" name="request" class="form-control mb-3">
|
||||||
<option selected disabled>Выберите заявку</option>
|
<option selected disabled>Выберите заявку</option>
|
||||||
@foreach (var request in ViewBag.Requests)
|
@foreach (var request in ViewBag.Requests)
|
||||||
{
|
{
|
||||||
<option value="@request.Id">@request.DateRequest</option>
|
<option value="@request.Id">@request.Id) @request.DateRequest</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
@{
|
@{
|
||||||
foreach (var order in ViewBag.Orders)
|
foreach (var order in ViewBag.Orders)
|
||||||
{
|
{
|
||||||
<option value="@order.Id">@order.DateCreate</option>
|
<option value="@order.Id">@order.Id) @order.DateCreate</option>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
@ -83,9 +83,11 @@
|
|||||||
if (result.requestOrders.hasOwnProperty(orderId)) {
|
if (result.requestOrders.hasOwnProperty(orderId)) {
|
||||||
var order = result.requestOrders[orderId];
|
var order = result.requestOrders[orderId];
|
||||||
var localDate = formatDate(order.dateCreate);
|
var localDate = formatDate(order.dateCreate);
|
||||||
|
var optionText = orderId + ') ' + localDate;
|
||||||
|
//!!!ВОТ ТУТ ОШИБКА
|
||||||
$('#currentOrders').append($('<option>', {
|
$('#currentOrders').append($('<option>', {
|
||||||
value: orderId,
|
value: orderId,
|
||||||
text: localDate
|
text: optionText
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
<form method="post">
|
<form method="post">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Выберите заказ для изменения:</label>
|
<label class="mb-3">Выберите заказ для изменения:</label>
|
||||||
<select id="shipment" name="shipment" class="form-control">
|
<select id="shipment" name="shipment" class="form-control mb-3">
|
||||||
<option selected disabled>Выберите партию товаров</option>
|
<option selected disabled>Выберите партию товаров</option>
|
||||||
@foreach (var shipment in ViewBag.Shipments)
|
@foreach (var shipment in ViewBag.Shipments)
|
||||||
{
|
{
|
||||||
<option value="@shipment.Id">@shipment.DateShipment</option>
|
<option value="@shipment.Id">@shipment.Id) @shipment.DateShipment</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -31,7 +31,7 @@
|
|||||||
@{
|
@{
|
||||||
foreach (var order in ViewBag.Orders)
|
foreach (var order in ViewBag.Orders)
|
||||||
{
|
{
|
||||||
<option value="@order.Id">@order.DateCreate</option>
|
<option value="@order.Id">@order.Id) @order.DateCreate</option>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="mb-3">Текущие заказы партии:</label>
|
<label class="mb-3">Текущие заказы партии:</label>
|
||||||
@* !!!МБ УБРАТЬ disabled *@
|
|
||||||
<select multiple disabled size="6" id="currentOrders" name="currentOrders" class="form-control">
|
<select multiple disabled size="6" id="currentOrders" name="currentOrders" class="form-control">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row mt-3">
|
||||||
<div class="col-8"></div>
|
<div class="col-8"></div>
|
||||||
<div class="col-4"><input type="submit" value="Изменить" class="btn btn-primary" /></div>
|
<div class="col-4"><input type="submit" value="Изменить" class="btn btn-primary" /></div>
|
||||||
</div>
|
</div>
|
||||||
@ -90,9 +90,10 @@
|
|||||||
if (result.shipmentOrders.hasOwnProperty(orderId)) {
|
if (result.shipmentOrders.hasOwnProperty(orderId)) {
|
||||||
var order = result.shipmentOrders[orderId];
|
var order = result.shipmentOrders[orderId];
|
||||||
var localDate = formatDate(order.dateCreate);
|
var localDate = formatDate(order.dateCreate);
|
||||||
|
var optionText = orderId + ') ' + localDate;
|
||||||
$('#currentOrders').append($('<option>', {
|
$('#currentOrders').append($('<option>', {
|
||||||
value: orderId,
|
value: orderId,
|
||||||
text: localDate
|
text: optionText
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user