Data and Services - projects added

This commit is contained in:
Stoyan Zlatev
2023-04-04 09:13:31 +02:00
parent 45808120d9
commit 994af6e7af
30 changed files with 653 additions and 95 deletions
File diff suppressed because one or more lines are too long
@@ -0,0 +1,120 @@
.scrollable, .scrollable-sm {
overflow-y: auto !important;
overflow-x: hidden !important;
}
.scrollable::-webkit-scrollbar {
width: 1rem;
}
.scrollable::-webkit-scrollbar-track {
background: var(--bs-light);
}
.scrollable::-webkit-scrollbar-thumb {
background: var(--bs-gray-500);
border: .3rem solid var(--bs-light);
border-radius: .5rem;
}
.scrollable::-webkit-scrollbar-thumb:hover {
background: var(--bs-gray-800);
}
.scrollable-sm::-webkit-scrollbar {
width: .8rem;
}
.scrollable-sm::-webkit-scrollbar-track {
background: var(--bs-light);
}
.scrollable-sm::-webkit-scrollbar-thumb {
background: var(--bs-gray-500);
border: .2rem solid var(--bs-light);
border-radius: .4rem;
}
.scrollable-sm::-webkit-scrollbar-thumb:hover {
background: var(--bs-gray-800);
}
.text-smallcaps {
font-variant: small-caps;
}
.white-space-break {
white-space: pre-wrap;
}
.white-space-nowrap {
white-space: nowrap;
}
.dropdown-menu.show:empty {
display: none;
}
.dropdown-item:hover {
cursor: pointer;
}
.print-page {
width: 21cm;
min-height: 29.7cm;
}
.form-control-success:focus {
border-color: rgba(25, 135, 84, .5);
box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, .25);
}
.va-middle {
vertical-align: middle;
}
tr {
position: relative;
}
tr.is_scaned_0::after {
position: absolute;
display: block;
content: '';
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.a-4 {
width: 21cm;
min-height: 29.7cm;
}
table.table table.table {
margin-bottom: 0 !important;
}
table.table table.table tr:first-child {
border-top: 0 !important;
}
table.table table.table tr:last-child {
border-bottom: 0 !important;
}
table.table table.table th:first-child,
table.table table.table td:first-child {
border-left: 0 !important;
}
table.table table.table th:last-child,
table.table table.table td:last-child {
border-right: 0 !important;
}
.text-teal {
color: var(--bs-teal);
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
(function () {
let href = location.href;
document
.querySelectorAll('.nav-link')
.forEach(x => {
if (href.startsWith(x.href)) {
x.classList.add('active');
} else {
x.classList.remove('active');
}
})
})();
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 275.27 123.65"><defs><style>.cls-1{fill:#71d54c;}.cls-2{fill:#003895;}.cls-3{fill:#078ab1;}</style></defs><title>sensus_xylem_logo</title><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><rect class="cls-1" x="47.04" width="37.99" height="7.14"/><rect class="cls-1" x="47.04" y="11.65" width="37.99" height="7.14"/><rect class="cls-1" x="47.04" y="23.29" width="37.99" height="7.14"/><path class="cls-2" d="M124.94,35h-22.3c-7.14,0-9.31,2.08-9.31,8.9v27.5h9.14V42.71h22.64V71.36h9.14V43.86c0-6.82-2.18-8.9-9.31-8.9"/><path class="cls-2" d="M219.87,35V63.61H197.23V35h-9.14v27.5c0,6.82,2.18,8.9,9.31,8.9h22.3c7.14,0,9.31-2.08,9.31-8.9V35Z"/><path class="cls-2" d="M55.38,35c-6.82,0-8.91,2.18-8.91,9.31V62.05c0,7.14,2.08,9.31,8.91,9.31H85V63.61H55v-7H85V49.2H55v-7H85V35Z"/><path class="cls-2" d="M38.4,42.23V35H9.31C2.18,35,0,37,0,43.86v3.89c0,6.82,2.18,8.9,9.31,8.9H30.78v7H0v7.75H29.76c7.1,0,9.38-2.16,9.38-8.9V57.61c0-6.74-2.28-8.9-9.38-8.9H8.3V42.23Z"/><path class="cls-2" d="M179.92,42.23V35H150.83c-7.14,0-9.32,2.08-9.32,8.9v3.89c0,6.82,2.18,8.9,9.32,8.9h21.46v7H141.52v7.75h29.76c7.1,0,9.38-2.16,9.38-8.9V57.61c0-6.74-2.28-8.9-9.38-8.9H149.82V42.23Z"/><path class="cls-2" d="M274.53,42.23V35H245.44c-7.14,0-9.31,2.08-9.31,8.9v3.89c0,6.82,2.17,8.9,9.31,8.9H266.9v7H236.13v7.75h29.75c7.1,0,9.39-2.16,9.39-8.9V57.61c0-6.74-2.28-8.9-9.39-8.9H244.43V42.23Z"/><path class="cls-3" d="M68.21,103.11c0-3-1.66-4.54-4.69-4.54a7.49,7.49,0,0,0-5.23,2.07l-1.42-1.7a9.79,9.79,0,0,1,6.9-2.51c3.8,0,6.84,2.1,6.84,6.38v7.7a23.25,23.25,0,0,0,.3,4h-2.3a19,19,0,0,1-.26-2.86h-.06a7,7,0,0,1-6.38,3.31c-2.67,0-6.1-1.43-6.1-5.33,0-5.42,6-5.9,12.4-5.9Zm-.75,2.55c-4.16,0-9,.46-9,3.8,0,2.51,2.13,3.33,4.13,3.33A5.48,5.48,0,0,0,68.21,107v-1.31Z"/><path class="cls-3" d="M190.39,111.47v3h-2.55V86.07h2.55V99.92h.07a8,8,0,0,1,6.65-3.49c5.49,0,9.09,4.05,9.09,9.23s-3.6,9.24-9.09,9.24a8.08,8.08,0,0,1-6.65-3.43Zm6.47-12.91a7.09,7.09,0,0,0,0,14.16c4.22,0,6.64-3.15,6.64-7.06s-2.41-7.09-6.64-7.09"/><path class="cls-3" d="M209.09,96.87h2.46c.06.95.15,2.25.15,3h.07a6.25,6.25,0,0,1,5.64-3.45,6.58,6.58,0,0,1,1.68.18l-.34,2.4a6.89,6.89,0,0,0-1.8-.22c-2.7,0-5.15,2-5.15,6.65v9h-2.55V100.74c0-.94,0-2.66-.16-3.87"/><path class="cls-3" d="M232.09,103.11c0-3-1.66-4.54-4.69-4.54a7.46,7.46,0,0,0-5.23,2.07l-1.41-1.7a9.74,9.74,0,0,1,6.89-2.51c3.8,0,6.84,2.1,6.84,6.38v7.7a24.22,24.22,0,0,0,.31,4h-2.3a18.26,18.26,0,0,1-.26-2.86h-.07a7.05,7.05,0,0,1-6.39,3.31c-2.66,0-6.07-1.43-6.07-5.33,0-5.42,6-5.9,12.39-5.9Zm-.75,2.55c-4.18,0-9,.46-9,3.8,0,2.51,2.14,3.33,4.13,3.33a5.48,5.48,0,0,0,5.64-5.82v-1.31Z"/><path class="cls-3" d="M241.1,96.87c.06.95.16,2.25.16,3h.07a6.85,6.85,0,0,1,6-3.45c4.47,0,6.68,2.89,6.68,7.25v10.78h-2.55v-9.73c0-3.67-1.08-6.16-4.77-6.16-2.69,0-5.33,2.18-5.33,6.87v9h-2.55V100.74c0-.94,0-2.66-.14-3.87Z"/><path class="cls-3" d="M266,114.9c-5.49,0-9.09-4.06-9.09-9.24s3.59-9.23,9.09-9.23a8,8,0,0,1,6.65,3.49h.07V86.07h2.55v28.39h-2.55v-3h-.07A8.1,8.1,0,0,1,266,114.9m.27-2.18a6.71,6.71,0,0,0,6.75-7.06c0-4-2.81-7.09-6.75-7.09-4.24,0-6.64,3.19-6.64,7.09s2.4,7.06,6.64,7.06"/><path class="cls-3" d="M176.07,111.18v3.28h-1.85c-3.13,0-4.65-1.63-4.65-5.28v-5.72c0-1.79-.56-3.63-2.82-3.63s-3,1.84-3,3.63v11h-4v-11c0-1.79-.78-3.63-3.09-3.63s-3.06,1.84-3.06,3.63v11h-3.92V103.32c0-4.35,2.8-7,7-7a6.78,6.78,0,0,1,5.09,2.06,6.77,6.77,0,0,1,5.08-2.06c3.85,0,6.59,2.48,6.59,7v5.91c0,1.35.62,1.95,1.76,1.95Zm-30.61.47a11.42,11.42,0,0,1-7.74,3.07c-5.88,0-9.35-3.82-9.35-9.22s3.73-9.23,9-9.23c5.48,0,8.82,4.25,8.82,9.53,0,.66-.05,1.33-.05,1.33h-13.7c.51,2.59,2.1,4.22,5.28,4.22a7.37,7.37,0,0,0,5.21-2.17Zm-13-7.63h9.73c-.45-2.66-2.2-4.39-4.78-4.39s-4.39,1.79-5,4.39M120,109c0,3.83,1.58,5.42,4.83,5.42h1.78v-3.37h-.84c-1.2,0-1.87-.59-1.87-2.05V86.95H120Zm-10.95,2H109c-1,0-1.55-1.49-2.54-4.18l-1.64-4.52c-1.54-4.21-3.1-6.11-6.66-6.11-3,0-4.52,1.81-6.38,4.32L90.4,102.4,86,96.56H81.39l6.69,8.77-2.61,3.51c-1.34,1.8-2.16,2.34-3.31,2.34h-.78v3.28h1.67a4.91,4.91,0,0,0,4.41-2.27l2.86-4,4.6,6.29h4.69l-7-9.21,1.74-2.3c1.58-2.11,2.33-3.12,3.67-3.12s2.12,1.31,3.32,4.36l2,5.09c1.15,3,2.26,5.17,4.29,5.17h.26l-1,2.58c-.8,2-1.56,3.28-3.67,3.28h-.92v3.33h1.34c3.13,0,5.36-1.54,6.81-5.59l7.73-21.51H114Z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

@@ -0,0 +1,9 @@
namespace LaaProductionWeb.App_Infrastructure
{
using System.Configuration;
public class ApplicationSettings
{
public static string ConnectionString => ConfigurationManager.AppSettings.Get(nameof(ConnectionString));
}
}
@@ -0,0 +1,36 @@
namespace LaaProductionWeb.App_Infrastructure
{
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Linq;
using System.Web.Mvc;
public static class ControllersExtensions
{
public static IServiceCollection AddControllers(this IServiceCollection services)
{
var controllers = typeof(ControllersExtensions)
.Assembly
.GetTypes()
.Where(x => !x.IsAbstract
&& typeof(IController).IsAssignableFrom(x));
foreach (var controller in controllers)
{
services.AddTransient(controller);
}
return services;
}
public static IServiceProvider BuildControllerFactory(this IServiceProvider serviceProvider)
{
var controllerFactory = new ControllerFactory(serviceProvider);
ControllerBuilder.Current.SetControllerFactory(controllerFactory);
return serviceProvider;
}
}
}
@@ -1,6 +0,0 @@
namespace LaaProductionWeb.App_Infrastructure.Interfaces
{
public interface ITransient
{
}
}
@@ -6,8 +6,29 @@
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles
.Add(new StyleBundle("~/bootstrap_css")
.Include("~/App_Content/css/bootstrap.min.css"));
bundles
.Add(new StyleBundle("~/bootstrap_icons")
.Include("~/App_Content/font/bootstrap-icons.min.css"));
bundles
.Add(new StyleBundle("~/styles_css")
.Include("~/App_Content/css/styles.css"));
bundles
.Add(new Bundle("~/bootstrap_js")
.Include("~/App_Content/js/bootstrap.bundle.min.js"));
bundles
.Add(new Bundle("~/barcodes_js")
.Include("~/App_Content/js/jsbarcode.all.min.js"));
bundles
.Add(new Bundle("~/scripts_js")
.Include("~/App_Content/js/scripts.js"));
}
}
}
@@ -1,15 +1,11 @@
namespace LaaProductionWeb.App_Start
{
using LaaProductionWeb.App_Infrastructure;
using LaaProductionWeb.App_Infrastructure.Interfaces;
using LaaProductionWeb.Data;
using LaaProductionWeb.Services;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
public static class ServicesConfig
{
public static void RegisterServices()
@@ -20,61 +16,12 @@
static IServiceCollection ConfigureServices(this IServiceCollection services)
{
var assembly = typeof(ServicesConfig).Assembly;
var types = assembly.GetTypes();
services
.AddControllers(types)
.AddTransients<ITransient>(types);
.AddControllers()
.AddTransientServices()
.AddDbContext(ApplicationSettings.ConnectionString);
return services;
}
static IServiceCollection AddControllers(this IServiceCollection services, IEnumerable<Type> assemblyTypes)
{
var controllers = assemblyTypes.Where(x => !x.IsAbstract && typeof(IController).IsAssignableFrom(x));
foreach (var controller in controllers)
{
services.AddTransient(controller);
}
return services;
}
static IServiceCollection AddTransients<TInterface>(this IServiceCollection services, IEnumerable<Type> assemblyTypes)
{
var assemblyServices = assemblyTypes.Where(x => !x.IsAbstract && typeof(TInterface).IsAssignableFrom(x));
foreach (var service in assemblyServices)
{
var interfaces = service
.GetInterfaces()
.Where(x => x != typeof(TInterface));
if (!interfaces.Any())
{
services.AddTransient(service);
}
else
{
foreach (var @interface in interfaces)
{
services.AddTransient(@interface, service);
}
}
}
return services;
}
static IServiceProvider BuildControllerFactory(this IServiceProvider serviceProvider)
{
var controllerFactory = new ControllerFactory(serviceProvider);
ControllerBuilder.Current.SetControllerFactory(controllerFactory);
return serviceProvider;
}
}
}
@@ -136,8 +136,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="App_Infrastructure\ApplicationSettings.cs" />
<Compile Include="App_Infrastructure\ControllerFactory.cs" />
<Compile Include="App_Infrastructure\Interfaces\ITransient.cs" />
<Compile Include="App_Infrastructure\ControllersExtensions.cs" />
<Compile Include="App_Start\BundleConfig.cs" />
<Compile Include="App_Start\FilterConfig.cs" />
<Compile Include="App_Start\RouteConfig.cs" />
@@ -150,6 +151,13 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Content\css\bootstrap.min.css" />
<Content Include="App_Content\css\styles.css" />
<Content Include="App_Content\font\bootstrap-icons.min.css" />
<Content Include="App_Content\js\bootstrap.bundle.min.js" />
<Content Include="App_Content\js\jsbarcode.all.min.js" />
<Content Include="App_Content\js\scripts.js" />
<Content Include="App_Content\svg\sensus_xylem_logo.svg" />
<Content Include="favicon.ico" />
<Content Include="Global.asax" />
<Content Include="Web.config" />
@@ -162,8 +170,20 @@
<Folder Include="Models\" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Content\font\fonts\bootstrap-icons.woff" />
<Content Include="App_Content\font\fonts\bootstrap-icons.woff2" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LaaProductionWeb.Data\LaaProductionWeb.Data.csproj">
<Project>{4b5bf112-d3be-4e84-9a8e-74a0e314bba7}</Project>
<Name>LaaProductionWeb.Data</Name>
</ProjectReference>
<ProjectReference Include="..\LaaProductionWeb.Services\LaaProductionWeb.Services.csproj">
<Project>{ff167011-431a-41a7-a7db-560e08860388}</Project>
<Name>LaaProductionWeb.Services</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
@@ -2,30 +2,36 @@
ViewBag.Title = "Home Page";
}
<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a href="https://asp.net" class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>
<div class="container my-5 py-5">
<div class="row">
<div class="col-12">
<div class="jumbotron">
<h1>ASP.NET</h1>
<p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS and JavaScript.</p>
<p><a class="btn btn-primary btn-lg">Learn more &raquo;</a></p>
</div>
<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
enables a clean separation of concerns and gives you full control over markup
for enjoyable, agile development.
</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301865">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301866">Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301867">Learn more &raquo;</a></p>
<div class="row">
<div class="col-md-4">
<h2>Getting started</h2>
<p>
ASP.NET MVC gives you a powerful, patterns-based way to build dynamic websites that
enables a clean separation of concerns and gives you full control over markup
for enjoyable, agile development.
</p>
<p><a class="btn btn-default" >Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Get more libraries</h2>
<p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
<p><a class="btn btn-default" >Learn more &raquo;</a></p>
</div>
<div class="col-md-4">
<h2>Web Hosting</h2>
<p>You can easily find a web hosting company that offers the right mix of features and price for your applications.</p>
<p><a class="btn btn-default" >Learn more &raquo;</a></p>
</div>
</div>
</div>
</div>
</div>
@@ -1,12 +1,55 @@
<!DOCTYPE html>
@{
var user = this.User
?.Identity
?.Name
?.Split('\\')
?.LastOrDefault()
?.ToLower();
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@Styles.Render("~/bootstrap_css")
@Styles.Render("~/bootstrap_icons")
@Styles.Render("~/styles_css")
<title>Laatzen Production Web</title>
</head>
<body>
@RenderBody()
@RenderSection("scripts", required: false)
<body class="d-flex flex-column vh-100 overflow-hidden">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark shadow-sm">
<div class="container-fluid">
<button class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#mainnav" aria-controls="mainnav" aria-expanded="false">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mainnav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link text-smallcaps" href="/Shipments">Paletten Scan</a>
</li>
<li class="nav-item">
<a class="nav-link text-smallcaps" href="/Protocol">Prüfprotokoll</a>
</li>
</ul>
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<span class="nav-link text-smallcaps">Benutzer: @user</span>
</li>
</ul>
</div>
</div>
</nav>
<main class="h-100 scrollable">
@this.RenderBody()
</main>
@Scripts.Render("~/bootstrap_js")
@Scripts.Render("~/barcodes_js")
@Scripts.Render("~/scripts_js")
@this.RenderSection("scripts", required: false)
</body>
</html>