-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
722 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using ResearchersWPF.Data.Managers; | ||
|
||
namespace ResearchersWPF.Business.Logic | ||
{ | ||
public class Request | ||
{ | ||
public int GetPresentationRequest(DateTime dateTime) | ||
{ | ||
var manager = new FactoryManager(); | ||
return manager.GetRequestManager().GetPresentation(dateTime); | ||
} | ||
|
||
public int GetReportRequest(int departmentNumber) | ||
{ | ||
var manager = new FactoryManager(); | ||
return manager.GetRequestManager().GetReport(departmentNumber); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
|
||
namespace ResearchersWPF.Data.IManagers | ||
{ | ||
public interface IRequestManager | ||
{ | ||
int GetPresentation(DateTime dateTime); | ||
int GetReport(int departmentNumber); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Linq; | ||
using Microsoft.EntityFrameworkCore; | ||
using ResearchersWPF.Data.IManagers; | ||
using ResearchersWPF.Data.Model; | ||
|
||
namespace ResearchersWPF.Data.Managers | ||
{ | ||
public class RequestManager : IRequestManager | ||
{ | ||
public int GetPresentation(DateTime dateTime) | ||
{ | ||
using (var context = new ResDbContext()) | ||
{ | ||
return context.Presentations.Count(i => i.PresentationDate < dateTime); | ||
} | ||
} | ||
|
||
public int GetReport(int departmentNumber) | ||
{ | ||
using (var context = new ResDbContext()) | ||
{ | ||
return context.Reports.Where(i => i.Researcher.DepartmentNumber == departmentNumber) | ||
.Sum(i => i.PageCount); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Runtime.Serialization; | ||
|
||
namespace ResearchersWPF.Service.DataContracts | ||
{ | ||
[DataContract] | ||
public class Request | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.ServiceModel; | ||
|
||
namespace ResearchersWPF.Service.IServices | ||
{ | ||
[ServiceContract] | ||
public interface IRequestService | ||
{ | ||
[OperationContract] | ||
int GetPresentationRequest(DateTime dateTime); | ||
|
||
[OperationContract] | ||
int GetReportRequest(int departmentNumber); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%@ ServiceHost Language="C#" Debug="true" Service="ResearchersWPF.Service.Services.RequestService" CodeBehind="RequestService.svc.cs" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.Serialization; | ||
using System.ServiceModel; | ||
using System.Text; | ||
using ResearchersWPF.Service.IServices; | ||
|
||
namespace ResearchersWPF.Service.Services | ||
{ | ||
// ПРИМЕЧАНИЕ. Команду "Переименовать" в меню "Рефакторинг" можно использовать для одновременного изменения имени класса "RequestService" в коде, SVC-файле и файле конфигурации. | ||
// ПРИМЕЧАНИЕ. Чтобы запустить клиент проверки WCF для тестирования службы, выберите элементы RequestService.svc или RequestService.svc.cs в обозревателе решений и начните отладку. | ||
public class RequestService : IRequestService | ||
{ | ||
public int GetPresentationRequest(DateTime dateTime) | ||
{ | ||
return new Business.Logic.Request().GetPresentationRequest(dateTime); | ||
} | ||
|
||
public int GetReportRequest(int departmentNumber) | ||
{ | ||
return new Business.Logic.Request().GetReportRequest(departmentNumber); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.