доработка

This commit is contained in:
Stepan 2024-04-30 22:46:35 +04:00
parent f25f7c1f2f
commit 9021ed8c13
7 changed files with 307 additions and 185 deletions

View File

@ -38,7 +38,7 @@ namespace ImplementerApp.Controllers
public IActionResult IndexCompletions()
{
List<CompletionsViewModel> completions = new List<CompletionsViewModel>();
new CompletionsViewModel
completions.Add(new CompletionsViewModel
{
Id = 1,
СompletionName = "Name1",
@ -46,27 +46,18 @@ namespace ImplementerApp.Controllers
СompletionPrice = 500.0M,
AdministratorId = 1,
СompletionCars = new()
};
new CompletionsViewModel
});
completions.Add(new CompletionsViewModel
{
Id = 2,
СompletionName = "Name2",
СompletionFeatures = "Feature2",
СompletionPrice = 1000.0M,
AdministratorId = 2
};
});
return View(completions);
}
public IActionResult CreateCompletions()
{
return View();
}
public IActionResult IndexCarSales()
{
return View(new List<CarSalesViewModel>());
}
public IActionResult CreateCarSales()
{
var cars = new List<CarSalesViewModel>();
cars.Add(new CarSalesViewModel
@ -87,14 +78,36 @@ namespace ImplementerApp.Controllers
});
return View(cars);
}
public IActionResult IndexCarSales()
{
var cars = new List<CarSalesViewModel>();
cars.Add(new CarSalesViewModel
{
Id = 1,
CarBrand = "Brand1",
CarModel = "Model1",
CarCost = 50000.9M,
AdministratorId = 1
});
cars.Add(new CarSalesViewModel
{
Id = 2,
CarBrand = "Brand2",
CarModel = "Model2",
CarCost = 100000.9M,
AdministratorId = 2
});
return View(cars);
}
public IActionResult CreateCarSales()
{
return View();
}
public IActionResult IndexInspection()
{
return View(new List<InspectionViewModel>());
}
public IActionResult CreateInspection()
{
List<InspectionViewModel> inspections = new List<InspectionViewModel>();
new InspectionViewModel
inspections.Add(new InspectionViewModel
{
Id = 1,
InspectionName = "Inspection1",
@ -103,8 +116,8 @@ namespace ImplementerApp.Controllers
AdministratorId = 1,
EmployeeId = 1,
InspectionCars = new()
};
new InspectionViewModel
});
inspections.Add(new InspectionViewModel
{
Id = 2,
InspectionName = "Inspection2",
@ -113,9 +126,30 @@ namespace ImplementerApp.Controllers
AdministratorId = 2,
EmployeeId = 2,
InspectionCars = new()
};
});
return View(inspections);
}
public IActionResult CreateInspection()
{
var cars = new List<CarSalesViewModel>();
cars.Add(new CarSalesViewModel
{
Id = 1,
CarBrand = "Brand1",
CarModel = "Model1",
CarCost = 50000.9M,
AdministratorId = 1
});
cars.Add(new CarSalesViewModel
{
Id = 2,
CarBrand = "Brand2",
CarModel = "Model2",
CarCost = 100000.9M,
AdministratorId = 2
});
return View(cars);
}
public IActionResult Privacy()
{
return View();
@ -128,11 +162,39 @@ namespace ImplementerApp.Controllers
public IActionResult CarsPreSaleWorkReport()
{
return View(new List<CarsPreSaleWorkReportViewModel>());
List<CarsPreSaleWorkReportViewModel> CarsPreSaleWork = new List<CarsPreSaleWorkReportViewModel>
{
new CarsPreSaleWorkReportViewModel
{
CarBrand = "CarBrand1",
PreSaleWork = new List<string> { "PreSaleWork1", "PreSaleWork2" },
},
new CarsPreSaleWorkReportViewModel
{
CarBrand = "CarBrand2",
PreSaleWork = new List<string> { "PreSaleWork3", "PreSaleWork4" },
}
};
return View(CarsPreSaleWork);
}
public IActionResult EmployeeCompletionsReport()
public IActionResult CarsPeriodReport()
{
return View(new List<CarsPeriodReportViewModel>());
List<CarsPeriodReportViewModel> CarsPeriod = new List<CarsPeriodReportViewModel>
{
new CarsPeriodReportViewModel
{
CarBrand = "CarBrand1",
Completions = new List<string> { "Completions1", "Completions2" },
Employees = new List<string> { "Employees1", "Employees2" },
},
new CarsPeriodReportViewModel
{
CarBrand = "CarBrand2",
Completions = new List<string> { "Completions3", "Completions4" },
Employees = new List<string> { "Employees3", "Employees4" },
}
};
return View(CarsPeriod);
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]

View File

@ -3,16 +3,16 @@
@model List<CarSalesViewModel>
@{
ViewData["Title"] = "CreateCompletions";
ViewData["Title"] = "CreateCompletions";
}
<div class="text-center">
<h2 class="display-4">Создание изделия</h2>
<h2 class="display-4">Создание изделия</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" name="title" id="title" /></div>
</div>
<div class="row">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" name="title" id="title" /></div>
</div>
<div class="container">
<div>Completions</div>
<div class="table-responsive-lg">
@ -31,19 +31,12 @@
<input type="checkbox" name="cars" value="@cars.Id" />
</td>
<td>@cars.CarBrand</td>
<td>
<input type="number" name="count" value="0" min="0" class="form-control" />
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-4">Сумма:</div>
<div class="col-8"><input type="text" id="sum" name="sum" readonly /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>

View File

@ -24,23 +24,19 @@
</tr>
</thead>
<tbody>
@foreach (var CarSales in Model)
@foreach (var cars in Model)
{
<tr>
<td>
<input type="checkbox" name="carcales" value="@CarSales.Id" />
<input type="checkbox" name="cars" value="@cars.Id" />
</td>
<td>@CarSales.CarBrand</td>
<td>@cars.CarBrand</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-4">Сумма:</div>
<div class="col-8"><input type="text" id="sum" name="sum" readonly /></div>
</div>
<div class="row">
<div class="col-8"></div>
<div class="col-4"><input type="submit" value="Сохранить" class="btn btn-primary" /></div>

View File

@ -9,136 +9,200 @@ using CarCenterDataBaseImplement.Models;
namespace ImplementerApp.Controllers
{
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly IEmployeeLogic _employeeLogic;
private readonly IManagerLogic _managerLogic;
private readonly IPreSaleWorkLogic _presaleworkLogic;
private readonly ISaleLogic _saleLogic;
public class HomeController : Controller
{
private readonly ILogger<HomeController> _logger;
private readonly IEmployeeLogic _employeeLogic;
private readonly IManagerLogic _managerLogic;
private readonly IPreSaleWorkLogic _presaleworkLogic;
private readonly ISaleLogic _saleLogic;
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public HomeController(ILogger<HomeController> logger)
{
_logger = logger;
}
public IActionResult Index()
{
return View();
}
public IActionResult Enter()
{
return View();
}
public IActionResult Register()
{
return View();
}
public IActionResult IndexEmployee()
{
List<EmployeeViewModel> Employee = new List<EmployeeViewModel>();
new EmployeeViewModel
{
Id = 1,
EmployeeFIO = "EmployeeFIO1",
EmployeePost = "EmployeePost1",
EmployeeSalary = 500.0M,
ManagerId = 1,
EmployeeSales = new()
};
new EmployeeViewModel
{
Id = 2,
EmployeeFIO = "EmployeeFIO2",
EmployeePost = "EmployeePost2",
EmployeeSalary = 5100.0M,
ManagerId = 2,
EmployeeSales = new()
};
return View(Employee);
}
public IActionResult CreateEmployee()
{
return View();
}
public IActionResult Index()
{
return View();
}
public IActionResult Enter()
{
return View();
}
public IActionResult Register()
{
return View();
}
public IActionResult IndexEmployee()
{
List<EmployeeViewModel> Employee = new List<EmployeeViewModel>();
Employee.Add(new EmployeeViewModel
{
Id = 1,
EmployeeFIO = "EmployeeFIO1",
EmployeePost = "EmployeePost1",
EmployeeSalary = 500.0M,
ManagerId = 1,
EmployeeSales = new()
});
Employee.Add(new EmployeeViewModel
{
Id = 2,
EmployeeFIO = "EmployeeFIO2",
EmployeePost = "EmployeePost2",
EmployeeSalary = 5100.0M,
ManagerId = 2,
EmployeeSales = new()
});
return View(Employee);
}
public IActionResult IndexPreSaleWork()
{
return View(new List<PreSaleWorkViewModel>());
}
public IActionResult CreatePreSaleWork()
{
var work = new List<PreSaleWorkViewModel>();
work.Add(new PreSaleWorkViewModel
{
Id = 1,
PreSaleWorkType = "PreSaleWork1",
PreSaleWorkDate = DateTime.Now,
PreSaleWorkPrice = 50000.9M,
ManagerId = 1,
CompletionsId = 1,
PreSaleWorkSales = new()
});
work.Add(new PreSaleWorkViewModel
{
Id = 2,
PreSaleWorkType = "PreSaleWork2",
PreSaleWorkDate = DateTime.Now,
PreSaleWorkPrice = 100000.9M,
ManagerId = 2,
CompletionsId = 2,
PreSaleWorkSales = new()
});
return View(work);
}
public IActionResult IndexSale()
{
return View(new List<SaleViewModel>());
}
public IActionResult CreateSale()
{
List<SaleViewModel> Sales = new List<SaleViewModel>();
new SaleViewModel
{
Id = 1,
SaleName = "Sale1",
SalePrice = 100.5M,
SaleDate = DateTime.Now,
ManagerId = 1,
};
new SaleViewModel
{
Id = 2,
SaleName = "Sale2",
SalePrice = 600.0M,
SaleDate = DateTime.Now,
ManagerId = 2,
};
return View(Sales);
}
public IActionResult Privacy()
{
return View();
}
public IActionResult CreateEmployee()
{
List<SaleViewModel> Sales = new List<SaleViewModel>();
Sales.Add(new SaleViewModel
{
Id = 1,
SaleName = "Sale1",
SalePrice = 100.5M,
SaleDate = DateTime.Now,
ManagerId = 1,
});
Sales.Add(new SaleViewModel
{
Id = 2,
SaleName = "Sale2",
SalePrice = 600.0M,
SaleDate = DateTime.Now,
ManagerId = 2,
});
return View(Sales);
}
public IActionResult ReportsMenu()
{
return View();
}
public IActionResult IndexPreSaleWork()
{
List<PreSaleWorkViewModel> work = new List<PreSaleWorkViewModel>();
work.Add(new PreSaleWorkViewModel
{
Id = 1,
PreSaleWorkType = "PreSaleWork1",
PreSaleWorkDate = DateTime.Now,
PreSaleWorkPrice = 50000.9M,
ManagerId = 1,
CompletionsId = 1,
PreSaleWorkSales = new()
});
work.Add(new PreSaleWorkViewModel
{
Id = 2,
PreSaleWorkType = "PreSaleWork2",
PreSaleWorkDate = DateTime.Now,
PreSaleWorkPrice = 100000.9M,
ManagerId = 2,
CompletionsId = 2,
PreSaleWorkSales = new()
});
return View(work);
}
public IActionResult CreatePreSaleWork()
{
List<SaleViewModel> Sales = new List<SaleViewModel>();
Sales.Add(new SaleViewModel
{
Id = 1,
SaleName = "Sale1",
SalePrice = 100.5M,
SaleDate = DateTime.Now,
ManagerId = 1,
});
Sales.Add(new SaleViewModel
{
Id = 2,
SaleName = "Sale2",
SalePrice = 600.0M,
SaleDate = DateTime.Now,
ManagerId = 2,
});
return View(Sales);
}
public IActionResult IndexSale()
{
List<SaleViewModel> Sales = new List<SaleViewModel>();
Sales.Add(new SaleViewModel
{
Id = 1,
SaleName = "Sale1",
SalePrice = 100.5M,
SaleDate = DateTime.Now,
ManagerId = 1,
});
Sales.Add(new SaleViewModel
{
Id = 2,
SaleName = "Sale2",
SalePrice = 600.0M,
SaleDate = DateTime.Now,
ManagerId = 2,
});
return View(Sales);
}
public IActionResult CreateSale()
{
return View();
}
public IActionResult Privacy()
{
return View();
}
public IActionResult ReportsMenu()
{
return View();
}
public IActionResult SalesInspectionsReport()
{
return View(new List<SalesInspectionsReportViewModel>());
List<SalesInspectionsReportViewModel> SaleInspectionReports = new List<SalesInspectionsReportViewModel>
{
new SalesInspectionsReportViewModel
{
SaleName = "SaleName1",
Inspections = new List<string> { "Inspections1", "Inspections2" },
},
new SalesInspectionsReportViewModel
{
SaleName = "SaleName2",
Inspections = new List<string> { "Inspections3", "Inspections4" },
}
};
return View(SaleInspectionReports);
}
public IActionResult SalesPeriodReport()
{
return View(new List<SalesPeriodReportViewModel>());
List<SalesPeriodReportViewModel> SalePeriodReports = new List<SalesPeriodReportViewModel>
{
new SalesPeriodReportViewModel
{
SaleName = "SaleName1",
Completions = new List<string> { "Completions1", "Completions2" },
Employee = new List<string> { "Employee1", "Employee2"},
},
new SalesPeriodReportViewModel
{
SaleName = "SaleName2",
Completions = new List<string> { "Completions3", "Completions4" },
Employee = new List<string> { "Employee3", "Employee4"},
}
};
return View(SalePeriodReports);
}
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
public IActionResult Error()
{
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
}
}
}

View File

@ -9,16 +9,16 @@
<h2 class="display-4">Создание сотрудника</h2>
</div>
<form method="post">
<div class="row">
<div class="row mb-3">
<div class="col-4">ФИО сотрудника:</div>
<div class="col-8"><input type="text" name="employeefio" id="employeefio" /></div>
</div>
<div class="row">
<div class="row mb-3">
<div class="col-4">Должность сотрудника:</div>
<div class="col-8"><input type="text" name="employeepost" id="employeepost" /></div>
</div>
<div class="row">
<div class="col-4">Стоимость продажи:</div>
<div class="row mb-3">
<div class="col-4">Заработная плата:</div>
<div class="col-8"><input type="text" name="employeesalary" id="employeesalary" /></div>
</div>
<div class="container">

View File

@ -3,16 +3,16 @@
@model List<SaleViewModel>
@{
ViewData["Title"] = "CreatePreSaleWork";
ViewData["Title"] = "CreatePreSaleWork";
}
<div class="text-center">
<h2 class="display-4">Создание предпродажной работы</h2>
<h2 class="display-4">Создание предпродажной работы</h2>
</div>
<form method="post">
<div class="row">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" name="title" id="title" /></div>
</div>
<div class="row">
<div class="col-4">Название:</div>
<div class="col-8"><input type="text" name="title" id="title" /></div>
</div>
<div class="container">
<div>PreSaleWork</div>
<div class="table-responsive-lg">
@ -24,17 +24,24 @@
</tr>
</thead>
<tbody>
@foreach (var sales in Model)
@if (Model != null && Model.Any())
{
<tr>
<td>
<input type="checkbox" name="cars" value="@sales.Id" />
</td>
<td>@sales.SaleName</td>
<td>
<input type="number" name="count" value="0" min="0" class="form-control" />
</td>
</tr>
@foreach (var sales in Model)
{
<tr>
<td>
<input type="checkbox" name="sale" value="@sales.Id" />
</td>
<td>@sales.SaleName</td>
</tr>
}
}
else
{
<td>
<input type="checkbox" name="sale" value="none" />
</td>
<td>none</td>
}
</tbody>
</table>

View File

@ -9,10 +9,10 @@
<h1 class="display-4">Список осмотров по продажам </h1>
</div>
<form asp-controller="Report" method="post">
<form asp-controller="Report" method="post" class="mb-3">
<button type="submit" class="btn btn-primary">Сгенерировать отчет в Word</button>
</form>
<form asp-controller="Report" method="post">
<form asp-controller="Report" method="post" class="mb-3">
<button type="submit" class="btn btn-primary">Сгенерировать отчет в Excel</button>
</form>