Skip to content

Commit

Permalink
added WebInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterLindi committed Jan 10, 2013
1 parent 1ed7529 commit 622d9cb
Show file tree
Hide file tree
Showing 32 changed files with 1,750 additions and 13 deletions.
1 change: 1 addition & 0 deletions BLInterfaces/Heli.Scada.BLInterfaces.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<ItemGroup>
<Compile Include="ICustomerBL.cs" />
<Compile Include="IEngineerBL.cs" />
<Compile Include="IInstallationBL.cs" />
<Compile Include="IRestServiceBL.cs" />
<Compile Include="IStatisticService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
2 changes: 1 addition & 1 deletion BLInterfaces/ICustomerBL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public interface ICustomerBL
void createCustomer(CustomerModel customer);
CustomerModel getCustomer(int id);
List<InstallationModel> getInstallations(CustomerModel customer);

int validateCustomer(string username, string password);
}
}
2 changes: 1 addition & 1 deletion BLInterfaces/IEngineerBL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public interface IEngineerBL
void createCustomer(CustomerModel customer);
void createInstallation(InstallationModel installation);
List<CustomerModel> showMyCustomers(int engineerid);
bool validateEngineer(string username, string password);
int validateEngineer(string username, string password);
}
}
14 changes: 14 additions & 0 deletions BLInterfaces/IInstallationBL.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Heli.Scada.Entities;

namespace Heli.Scada.BLInterfaces
{
public interface IInstallationBL
{
InstallationModel getInstallation(int installationid);
}
}
13 changes: 12 additions & 1 deletion Heli.Scada.BL/CustomerBL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,18 @@ public List<InstallationModel> getInstallations(CustomerModel customer)
return tmp;

}

public int validateCustomer(string username, string password)
{
try
{
return crepo.validateCustomer(username, password);
}
catch (BLException exp)
{
log.Error("Fehler bei der Authentifikation des Customer.");
throw new BLException("Fehler bei der Authentifikation des Customer.", exp);
}
}

}
}
6 changes: 3 additions & 3 deletions Heli.Scada.BL/EngineerBL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ public List<CustomerModel> showMyCustomers(int engineerid)
return clist;
}

public bool validateEngineer(string username, string password)
public int validateEngineer(string username, string password)
{
try
{
return erepo.validateEngineer(username, password);
}
catch (BLException exp)
{
log.Error("Fehler bei der Authentifikation des Engineer via Soap.");
throw new BLException("Fehler bei der Authentifikation des Engineer via Soap.", exp);
log.Error("Fehler bei der Authentifikation des Engineer.");
throw new BLException("Fehler bei der Authentifikation des Engineer.", exp);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions Heli.Scada.BL/Heli.Scada.BL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<ItemGroup>
<Compile Include="CustomerBL.cs" />
<Compile Include="EngineerBL.cs" />
<Compile Include="InstallationBL.cs" />
<Compile Include="RestServiceBL.cs" />
<Compile Include="StatisticService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
38 changes: 38 additions & 0 deletions Heli.Scada.BL/InstallationBL.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Heli.Scada.BLInterfaces;
using Heli.Scada.DalInterfaces;
using Heli.Scada.Entities;
using Heli.Scada.Exceptions;
using log4net;

namespace Heli.Scada.BL
{
public class InstallationBL : IInstallationBL
{

IInstallationRepository<InstallationModel> irepo;

public static readonly ILog log = LogManager.GetLogger(typeof(CustomerBL));

public InstallationBL(IInstallationRepository<InstallationModel> irepo)
{
this.irepo = irepo;
}
public InstallationModel getInstallation(int installationid)
{
try
{
return irepo.GetById(installationid);
}
catch (DalException exp)
{
log.Error("Installation kann nicht geladen werden.");
throw new BLException("Installation konnte nicht geladen werden.", exp);
}
}
}
}
1 change: 1 addition & 0 deletions Heli.Scada.DalInterfaces/ICustomerRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ namespace Heli.Scada.DalInterfaces
{
public interface ICustomerRepository<T>:IRepository<T> where T:class
{
int validateCustomer(string username, string password);
}
}
2 changes: 1 addition & 1 deletion Heli.Scada.DalInterfaces/IEngineerRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ namespace Heli.Scada.DalInterfaces
public interface IEngineerRepository<T> :IRepository<T> where T:class
{
List<CustomerModel> GetMyCustomers(int id);
bool validateEngineer(string username, string password);
int validateEngineer(string username, string password);
}
}
2 changes: 1 addition & 1 deletion Heli.Scada.SoapService/CustomUsernameValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public override void Validate(string userName, string password)
section.Configure(container);
IEngineerBL rservicebl = container.Resolve<IEngineerBL>();

if (!rservicebl.validateEngineer(userName, password))
if (rservicebl.validateEngineer(userName, password) >=0)
{
throw new FaultException("Incorrect Username or Password");
}
Expand Down
168 changes: 168 additions & 0 deletions Heli.Scada.WebUI/Heli.Scada.WebUI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5EDA1D96-A379-4BA3-88C9-E5033C58CE9B}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Heli.Scada.WebUI</RootNamespace>
<AssemblyName>Heli.Scada.WebUI</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\log4net.2.0.0\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Practices.ServiceLocation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity, Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.Unity.Configuration, Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.Configuration.dll</HintPath>
</Reference>
<Reference Include="System.Web.DynamicData" />
<Reference Include="System.Web.Entity" />
<Reference Include="System.Web.ApplicationServices" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Core" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
<Reference Include="System.Web.Services" />
<Reference Include="System.EnterpriseServices" />
</ItemGroup>
<ItemGroup>
<Content Include="InstallationList.aspx" />
<Content Include="InstallationDetail.aspx" />
<Content Include="Login.aspx" />
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="InstallationList.aspx.cs">
<DependentUpon>InstallationList.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="InstallationList.aspx.designer.cs">
<DependentUpon>InstallationList.aspx</DependentUpon>
</Compile>
<Compile Include="InstallationDetail.aspx.cs">
<DependentUpon>InstallationDetail.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="InstallationDetail.aspx.designer.cs">
<DependentUpon>InstallationDetail.aspx</DependentUpon>
</Compile>
<Compile Include="Login.aspx.cs">
<DependentUpon>Login.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Login.aspx.designer.cs">
<DependentUpon>Login.aspx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
<None Include="Web.Debug.config">
<DependentUpon>Web.config</DependentUpon>
</None>
<None Include="Web.Release.config">
<DependentUpon>Web.config</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BLInterfaces\Heli.Scada.BLInterfaces.csproj">
<Project>{ac429c89-6ffe-42b8-a518-751184008361}</Project>
<Name>Heli.Scada.BLInterfaces</Name>
</ProjectReference>
<ProjectReference Include="..\Heli.Scada.BL\Heli.Scada.BL.csproj">
<Project>{8c14a250-2967-4f18-a241-00270a865f95}</Project>
<Name>Heli.Scada.BL</Name>
</ProjectReference>
<ProjectReference Include="..\Heli.Scada.DalInterfaces\Heli.Scada.DalInterfaces.csproj">
<Project>{9115ff08-75ad-4146-bdb0-680c0f1969f1}</Project>
<Name>Heli.Scada.DalInterfaces</Name>
</ProjectReference>
<ProjectReference Include="..\Heli.Scada.dal\Heli.Scada.dal.csproj">
<Project>{ee54d739-51bc-4d28-8446-05647bc9fb04}</Project>
<Name>Heli.Scada.dal</Name>
</ProjectReference>
<ProjectReference Include="..\Heli.Scada.Entities\Heli.Scada.Entities.csproj">
<Project>{caac6784-edad-4054-81ed-fd87bc775620}</Project>
<Name>Heli.Scada.Entities</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:1699/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
32 changes: 32 additions & 0 deletions Heli.Scada.WebUI/InstallationDetail.aspx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InstallationDetail.aspx.cs" Inherits="Heli.Scada.WebUI.InstallationDetail" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<h4>Anlagenzustand</h4>
<div runat="server" id="anlagenzustand">

</div>

<h4>Statistikauswahl</h4>
<div runat="server" id="statistikauswahl">
<asp:Button ID="daystat" runat="server" Text="Tagesstatistik" OnClick="daystat_Click" />
<asp:Button ID="monthstat" runat="server" Text="Monatsstatistik" OnClick="monthstat_Click" />
<asp:Button ID="yearstat" runat="server" Text="Jahresstatistik" OnClick="yearstat_Click" />
</div>
<h4>Statistikanzeige</h4>
<div runat="server" id="statistikanzeige">

</div>

<asp:Button ID="btnback" Text="Zurück" OnClick="btnback_Click" runat="server" />
</form>

</body>
</html>
Loading

0 comments on commit 622d9cb

Please sign in to comment.