diff --git a/TaskTracker/BusinessLogic/BusinessLogic.csproj b/TaskTracker/BusinessLogic/BusinessLogic.csproj index 132c02c..9241764 100644 --- a/TaskTracker/BusinessLogic/BusinessLogic.csproj +++ b/TaskTracker/BusinessLogic/BusinessLogic.csproj @@ -6,4 +6,13 @@ enable + + + + + + + + + diff --git a/TaskTracker/BusinessLogic/BusinessLogic/CommentLogic.cs b/TaskTracker/BusinessLogic/BusinessLogic/CommentLogic.cs new file mode 100644 index 0000000..490b960 --- /dev/null +++ b/TaskTracker/BusinessLogic/BusinessLogic/CommentLogic.cs @@ -0,0 +1,95 @@ +using Contracts.BindingModels; +using Contracts.BusinessLogicContracts; +using Contracts.SearchModels; +using Contracts.StoragesContracts; +using Contracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BusinessLogic.BusinessLogic +{ + public class CommentLogic : ICommentLogic + { + private readonly ICommentStorage _projectStorage; + public CommentLogic(ICommentStorage projectStorage) + { + _projectStorage = projectStorage; + } + public List? ReadList(CommentSearchModel? model) + { + var list = model == null ? _projectStorage.GetFullList() : _projectStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + public CommentViewModel? ReadElement(CommentSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _projectStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + public bool Create(CommentBindingModel model) + { + CheckModel(model); + if (_projectStorage.Insert(model) == null) + { + return false; + } + return true; + } + public bool Update(CommentBindingModel model) + { + CheckModel(model); + if (_projectStorage.Update(model) == null) + { + return false; + } + return true; + } + public bool Delete(CommentBindingModel model) + { + CheckModel(model, false); + if (_projectStorage.Delete(model) == null) + { + return false; + } + return true; + } + private void CheckModel(CommentBindingModel model, bool withParams = + true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.TEXT)) + { + throw new ArgumentNullException("Нет текста комментария", nameof(model.TEXT)); + } + var element = _projectStorage.GetElement(new CommentSearchModel + { + TEXT = model.TEXT + }); + if (element != null && element.Id != model.Id && element.PerformerId == model.PerformerId && element.TaskId == model.TaskId) + { + throw new InvalidOperationException("Такой комментарий уже существует"); + } + } + } +} diff --git a/TaskTracker/BusinessLogic/BusinessLogic/PerformerLogic.cs b/TaskTracker/BusinessLogic/BusinessLogic/PerformerLogic.cs new file mode 100644 index 0000000..2912549 --- /dev/null +++ b/TaskTracker/BusinessLogic/BusinessLogic/PerformerLogic.cs @@ -0,0 +1,98 @@ +using Contracts.BindingModels; +using Contracts.BusinessLogicContracts; +using Contracts.SearchModels; +using Contracts.StoragesContracts; +using Contracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BusinessLogic.BusinessLogic +{ + public class PerformerLogic : IPerformerLogic + { + private readonly IPerformerStorage _performerStorage; + public PerformerLogic(IPerformerStorage performerStorage) + { + _performerStorage = performerStorage; + } + public List? ReadList(PerformerSearchModel? model) + { + var list = model == null ? _performerStorage.GetFullList() : _performerStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + public PerformerViewModel? ReadElement(PerformerSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _performerStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + public bool Create(PerformerBindingModel model) + { + CheckModel(model); + if (_performerStorage.Insert(model) == null) + { + return false; + } + return true; + } + public bool Update(PerformerBindingModel model) + { + CheckModel(model); + if (_performerStorage.Update(model) == null) + { + return false; + } + return true; + } + public bool Delete(PerformerBindingModel model) + { + CheckModel(model, false); + if (_performerStorage.Delete(model) == null) + { + return false; + } + return true; + } + private void CheckModel(PerformerBindingModel model, bool withParams = + true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.NAME_PF)) + { + throw new ArgumentNullException("Отсутствует имя", + nameof(model.NAME_PF)); + } + if (string.IsNullOrEmpty(model.login)) + { + throw new ArgumentNullException("Отсутствует логин", + nameof(model.login)); + } + if (string.IsNullOrEmpty(model.password)) + { + throw new ArgumentNullException("Отсутствует пароль", + nameof(model.password)); + } + } + } +} diff --git a/TaskTracker/BusinessLogic/BusinessLogic/ProjectLogic.cs b/TaskTracker/BusinessLogic/BusinessLogic/ProjectLogic.cs new file mode 100644 index 0000000..1c58ed4 --- /dev/null +++ b/TaskTracker/BusinessLogic/BusinessLogic/ProjectLogic.cs @@ -0,0 +1,96 @@ +using Contracts.BindingModels; +using Contracts.BusinessLogicContracts; +using Contracts.SearchModels; +using Contracts.StoragesContracts; +using Contracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BusinessLogic.BusinessLogic +{ + public class ProjectLogic : IProjectLogic + { + private readonly IProjectStorage _projectStorage; + public ProjectLogic(IProjectStorage projectStorage) + { + _projectStorage = projectStorage; + } + public List? ReadList(ProjectSearchModel? model) + { + var list = model == null ? _projectStorage.GetFullList() : _projectStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + public ProjectViewModel? ReadElement(ProjectSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _projectStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + public bool Create(ProjectBindingModel model) + { + CheckModel(model); + if (_projectStorage.Insert(model) == null) + { + return false; + } + return true; + } + public bool Update(ProjectBindingModel model) + { + CheckModel(model); + if (_projectStorage.Update(model) == null) + { + return false; + } + return true; + } + public bool Delete(ProjectBindingModel model) + { + CheckModel(model, false); + if (_projectStorage.Delete(model) == null) + { + return false; + } + return true; + } + private void CheckModel(ProjectBindingModel model, bool withParams = + true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.NAME_PJ)) + { + throw new ArgumentNullException("Нет названия", + nameof(model.NAME_PJ)); + } + var element = _projectStorage.GetElement(new ProjectSearchModel + { + NAME_PJ = model.NAME_PJ + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("Проект с таким названием уже есть"); + } + } + } +} diff --git a/TaskTracker/BusinessLogic/BusinessLogic/TagGroupLogic.cs b/TaskTracker/BusinessLogic/BusinessLogic/TagGroupLogic.cs new file mode 100644 index 0000000..f6cd493 --- /dev/null +++ b/TaskTracker/BusinessLogic/BusinessLogic/TagGroupLogic.cs @@ -0,0 +1,96 @@ +using Contracts.BindingModels; +using Contracts.BusinessLogicContracts; +using Contracts.SearchModels; +using Contracts.StoragesContracts; +using Contracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BusinessLogic.BusinessLogic +{ + public class TagGroupLogic : ITagGroupLogic + { + private readonly ITagGroupStorage _projectStorage; + public TagGroupLogic(ITagGroupStorage projectStorage) + { + _projectStorage = projectStorage; + } + public List? ReadList(TagGroupSearchModel? model) + { + var list = model == null ? _projectStorage.GetFullList() : _projectStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + public TagGroupViewModel? ReadElement(TagGroupSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _projectStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + public bool Create(TagGroupBindingModel model) + { + CheckModel(model); + if (_projectStorage.Insert(model) == null) + { + return false; + } + return true; + } + public bool Update(TagGroupBindingModel model) + { + CheckModel(model); + if (_projectStorage.Update(model) == null) + { + return false; + } + return true; + } + public bool Delete(TagGroupBindingModel model) + { + CheckModel(model, false); + if (_projectStorage.Delete(model) == null) + { + return false; + } + return true; + } + private void CheckModel(TagGroupBindingModel model, bool withParams = + true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.NAME_TG)) + { + throw new ArgumentNullException("Нет названия", + nameof(model.NAME_TG)); + } + var element = _projectStorage.GetElement(new TagGroupSearchModel + { + NAME_TG = model.NAME_TG + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("такой тег уже есть"); + } + } + } +} diff --git a/TaskTracker/BusinessLogic/BusinessLogic/TaskLogic.cs b/TaskTracker/BusinessLogic/BusinessLogic/TaskLogic.cs new file mode 100644 index 0000000..199f488 --- /dev/null +++ b/TaskTracker/BusinessLogic/BusinessLogic/TaskLogic.cs @@ -0,0 +1,96 @@ +using Contracts.BindingModels; +using Contracts.BusinessLogicContracts; +using Contracts.SearchModels; +using Contracts.StoragesContracts; +using Contracts.ViewModels; +using DataModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BusinessLogic.BusinessLogic +{ + public class TaskLogic : ITaskLogic + { + + private readonly ITaskStorage _taskStorage; + + public TaskLogic(ITaskStorage taskStorage) + { + _taskStorage = taskStorage; + } + + public bool CreateTask(TaskBindingModel model) + { + CheckModel(model); + if (model.Status != MyTaskStatus.Неизвестен) + { + return false; + } + model.Status = MyTaskStatus.Новый; + if (_taskStorage.Insert(model) == null) + { + return false; + } + return true; + } + + public List? ReadList(TaskSearchModel? model) + { + var list = _taskStorage.GetFullList(); + if (list == null) + { + return null; + } + return list; + } + + public bool TakeTaskInWork(TaskBindingModel model) + { + return ChangeStatus(model, MyTaskStatus.Выполняется); + } + + public bool FinishTask(TaskBindingModel model) + { + return ChangeStatus(model, MyTaskStatus.Готово); + } + + private void CheckModel(TaskBindingModel model, bool withParams = true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + } + + private bool ChangeStatus(TaskBindingModel model, MyTaskStatus newStatus) + { + CheckModel(model, false); + var task = _taskStorage.GetElement(new TaskSearchModel { Id = model.Id }); + if (task == null) + { + return false; + } + if (task.Status + 1 != newStatus) + { + return false; + } + model.Status = newStatus; + if (model.Status != MyTaskStatus.Готово && task.DEADLINE > DateTime.Now) + { + model.Status += 1; + } + if (_taskStorage.Update(model) == null) + { + return false; + } + return true; + } + } +} diff --git a/TaskTracker/BusinessLogic/BusinessLogic/TeamLogic.cs b/TaskTracker/BusinessLogic/BusinessLogic/TeamLogic.cs new file mode 100644 index 0000000..32f6bb4 --- /dev/null +++ b/TaskTracker/BusinessLogic/BusinessLogic/TeamLogic.cs @@ -0,0 +1,96 @@ +using Contracts.BindingModels; +using Contracts.BusinessLogicContracts; +using Contracts.SearchModels; +using Contracts.StoragesContracts; +using Contracts.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BusinessLogic.BusinessLogic +{ + public class TeamLogic : ITeamLogic + { + private readonly ITeamStorage _projectStorage; + public TeamLogic(ITeamStorage projectStorage) + { + _projectStorage = projectStorage; + } + public List? ReadList(TeamSearchModel? model) + { + var list = model == null ? _projectStorage.GetFullList() : _projectStorage.GetFilteredList(model); + if (list == null) + { + return null; + } + return list; + } + public TeamViewModel? ReadElement(TeamSearchModel model) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + var element = _projectStorage.GetElement(model); + if (element == null) + { + return null; + } + return element; + } + public bool Create(TeamBindingModel model) + { + CheckModel(model); + if (_projectStorage.Insert(model) == null) + { + return false; + } + return true; + } + public bool Update(TeamBindingModel model) + { + CheckModel(model); + if (_projectStorage.Update(model) == null) + { + return false; + } + return true; + } + public bool Delete(TeamBindingModel model) + { + CheckModel(model, false); + if (_projectStorage.Delete(model) == null) + { + return false; + } + return true; + } + private void CheckModel(TeamBindingModel model, bool withParams = + true) + { + if (model == null) + { + throw new ArgumentNullException(nameof(model)); + } + if (!withParams) + { + return; + } + if (string.IsNullOrEmpty(model.NAME_TM)) + { + throw new ArgumentNullException("Нет названия", + nameof(model.NAME_TM)); + } + var element = _projectStorage.GetElement(new TeamSearchModel + { + TeamName = model.NAME_TM + }); + if (element != null && element.Id != model.Id) + { + throw new InvalidOperationException("команда с таким названием уже есть"); + } + } + } +} diff --git a/TaskTracker/BusinessLogic/Class1.cs b/TaskTracker/BusinessLogic/Class1.cs deleted file mode 100644 index 441a75f..0000000 --- a/TaskTracker/BusinessLogic/Class1.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace BusinessLogic -{ - public class Class1 - { - - } -} diff --git a/TaskTracker/ClientApp/APIClient.cs b/TaskTracker/ClientApp/APIClient.cs new file mode 100644 index 0000000..b446818 --- /dev/null +++ b/TaskTracker/ClientApp/APIClient.cs @@ -0,0 +1,46 @@ +using Contracts.ViewModels; +using Newtonsoft.Json; +using System.Net.Http.Headers; +using System.Text; + +namespace ClientApp +{ + public static class APIClient + { + private static readonly HttpClient _client = new(); + public static PerformerViewModel? Client { get; set; } = null; + public static void Connect(IConfiguration configuration) + { + _client.BaseAddress = new Uri(configuration["IPAddress"]); + _client.DefaultRequestHeaders.Accept.Clear(); + _client.DefaultRequestHeaders.Accept.Add(new + MediaTypeWithQualityHeaderValue("application/json")); + } + public static T? GetRequest(string requestUrl) + { + var response = _client.GetAsync(requestUrl); + var result = response.Result.Content.ReadAsStringAsync().Result; + if (response.Result.IsSuccessStatusCode) + { + return JsonConvert.DeserializeObject(result); + } + else + { + throw new Exception(result); + } + } + public static void PostRequest(string requestUrl, T model) + { + var json = JsonConvert.SerializeObject(model); + var data = new StringContent(json, Encoding.UTF8, + "application/json"); + var response = _client.PostAsync(requestUrl, data); + var result = response.Result.Content.ReadAsStringAsync().Result; + if (!response.Result.IsSuccessStatusCode) + { + throw new Exception(result); + } + } + } +} + diff --git a/TaskTracker/ClientApp/ClientApp.csproj b/TaskTracker/ClientApp/ClientApp.csproj index c78c9c7..5cb4ae1 100644 --- a/TaskTracker/ClientApp/ClientApp.csproj +++ b/TaskTracker/ClientApp/ClientApp.csproj @@ -6,4 +6,15 @@ enable + + + + + + + + + + + diff --git a/TaskTracker/ClientApp/Controllers/HomeController.cs b/TaskTracker/ClientApp/Controllers/HomeController.cs index 3c16158..a130091 100644 --- a/TaskTracker/ClientApp/Controllers/HomeController.cs +++ b/TaskTracker/ClientApp/Controllers/HomeController.cs @@ -1,6 +1,10 @@ using ClientApp.Models; using Microsoft.AspNetCore.Mvc; using System.Diagnostics; +using Contracts.BindingModels; +using Contracts.ViewModels; +using DataModels; +using Microsoft.AspNetCore.Mvc.Rendering; namespace ClientApp.Controllers { @@ -13,20 +17,226 @@ namespace ClientApp.Controllers _logger = logger; } - public IActionResult Index() + public IActionResult Index() + { + if (APIClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + // Передача имени пользователя в представление + ViewData["UserName"] = APIClient.Client.NAME_PF; + + return View(); + } + + [HttpGet] + public IActionResult Privacy() + { + if (APIClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + return View(APIClient.Client); + } + + + [HttpPost] + public void Privacy(string login, string password, string fio) + { + if (APIClient.Client == null) + { + throw new Exception("Вы как суда попали? Суда вход только авторизованным"); + } + if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(fio)) + { + throw new Exception("Введите логин, пароль и ФИО"); + } + APIClient.PostRequest("api/client/updatedata", new PerformerBindingModel + { + Id = APIClient.Client.Id, + NAME_PF = fio, + login = login, + password = password + }); + + APIClient.Client.NAME_PF = fio; + APIClient.Client.login = login; + APIClient.Client.password = password; + Response.Redirect("Index"); + } + + [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] + public IActionResult Error() + { + return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + } + + [HttpGet] + public IActionResult Enter() + { + return View(); + } + + [HttpPost] + public void Enter(string login, string password) + { + if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password)) + { + throw new Exception("Введите логин и пароль"); + } + APIClient.Client = APIClient.GetRequest($"api/client/login?login={login}&password={password}"); + if (APIClient.Client == null) + { + throw new Exception("Неверный логин/пароль"); + } + Response.Redirect("Index"); + } + + [HttpGet] + public IActionResult Register() + { + return View(); + } + + [HttpPost] + public void Register(string login, string password, string fio, string specialty) + { + if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(fio) || string.IsNullOrEmpty(specialty)) + { + throw new Exception("Введите логин, пароль и ФИО"); + } + APIClient.PostRequest("api/client/register", new PerformerBindingModel + { + NAME_PF = fio, + login = login, + password = password, + SPECIALTY = specialty + }); + Response.Redirect("Enter"); + return; + } + + [HttpGet] + public IActionResult CreateProject() + { + ViewBag.Teams = + APIClient.GetRequest>("api/main/getteamlist"); + return View(); + } + [HttpPost] + public void CreateProject(int Team, string name, string description) { - return View(); + if (APIClient.Client == null) + { + throw new Exception("Вы как сюда попали? Сюда вход только авторизованным"); + } + APIClient.PostRequest("api/main/createproject", new ProjectBindingModel + { + TeamId = Team, + NAME_PJ = name, + DESCRIPTION_PJ = description + }); + Response.Redirect("Index"); } - public IActionResult Privacy() + [HttpGet] + public IActionResult CreateTask() + { + ViewBag.Projects = + APIClient.GetRequest>("api/main/getprojectlist"); + ViewBag.TagGroups = + APIClient.GetRequest>("api/main/gettagslist"); + return View(); + } + [HttpPost] + public void CreateTask(string shortDesc, string description, DateTime deadline, int Project, int Tag) { - return View(); + if (APIClient.Client == null) + { + throw new Exception("Вы как сюда попали? Сюда вход только авторизованным"); + } + APIClient.PostRequest("api/main/createtask", new TaskBindingModel + { + SHORT_DESC = shortDesc, + DESCRIPTION = description, + DEADLINE = deadline, + ProjectId = Project, + TagGroupId = Tag, + Status = MyTaskStatus.Неизвестен + }); + Response.Redirect("Index"); } - [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] - public IActionResult Error() + [HttpGet] + public IActionResult CreateComment() + { + ViewBag.Tasks = + APIClient.GetRequest>("api/main/gettasklist"); + return View(); + } + [HttpPost] + public void CreateComment(int Task, string Text) + { + if (APIClient.Client == null) + { + throw new Exception("Вы как суда попали? Суда вход только авторизованным"); + } + APIClient.PostRequest("api/main/createcomment", new CommentBindingModel + { + PerformerId = APIClient.Client.Id, + TaskId = Task, + TEXT = Text + }); + Response.Redirect("Index"); + } + + public IActionResult ViewComments() + { + if (APIClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + return View(APIClient.GetRequest>($"api/main/getcomments?PerformerId={APIClient.Client.Id}")); + } + + [HttpGet] + public IActionResult ViewTasks() + { + if (APIClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + + var tasks = APIClient.GetRequest>($"api/main/gettasklist"); + + var tasksForPerformer = tasks.Where(task => task.TaskPerformers.Any(tp => tp.Key == APIClient.Client.Id)).ToList(); + + return View(tasksForPerformer); + } + + [HttpGet] + public IActionResult ViewProjects() + { + if (APIClient.Client == null) + { + return Redirect("~/Home/Enter"); + } + return View(APIClient.GetRequest>("api/main/getprojectlist")); + } + + [HttpPost] + public void AssignPerformerToTask(int taskId, int performerId) { - return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); + if (APIClient.Client == null) + { + throw new Exception("Вы как сюда попали? Сюда вход только авторизованным"); + } + APIClient.PostRequest("api/main/assigntaskperformer", new TaskPerformerBindingModel + { + TaskId = taskId, + PerformerId = performerId + }); + Response.Redirect("Index"); } } } diff --git a/TaskTracker/ClientApp/Program.cs b/TaskTracker/ClientApp/Program.cs index 559dd3a..fd177f6 100644 --- a/TaskTracker/ClientApp/Program.cs +++ b/TaskTracker/ClientApp/Program.cs @@ -1,3 +1,5 @@ +using ClientApp; + var builder = WebApplication.CreateBuilder(args); // Add services to the container. @@ -5,12 +7,14 @@ builder.Services.AddControllersWithViews(); var app = builder.Build(); +APIClient.Connect(builder.Configuration); + // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { - app.UseExceptionHandler("/Home/Error"); - // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. - app.UseHsts(); + app.UseExceptionHandler("/Home/Error"); + // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. + app.UseHsts(); } app.UseHttpsRedirection(); @@ -21,7 +25,7 @@ app.UseRouting(); app.UseAuthorization(); app.MapControllerRoute( - name: "default", - pattern: "{controller=Home}/{action=Index}/{id?}"); + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); app.Run(); diff --git a/TaskTracker/ClientApp/Views/Home/CreateComment.cshtml b/TaskTracker/ClientApp/Views/Home/CreateComment.cshtml new file mode 100644 index 0000000..19e886f --- /dev/null +++ b/TaskTracker/ClientApp/Views/Home/CreateComment.cshtml @@ -0,0 +1,30 @@ +@using Contracts.ViewModels +@model CommentViewModel + +@{ + ViewData["Title"] = "Create"; +} +
+

Комментарий

+
+
+
+
Задача:
+
+ +
+
+
+
Текст комментария:
+
+ +
+
+ +
+
+
+ +
+
+
\ No newline at end of file diff --git a/TaskTracker/ClientApp/Views/Home/CreateProject.cshtml b/TaskTracker/ClientApp/Views/Home/CreateProject.cshtml new file mode 100644 index 0000000..3b7ed11 --- /dev/null +++ b/TaskTracker/ClientApp/Views/Home/CreateProject.cshtml @@ -0,0 +1,35 @@ +@using Contracts.ViewModels +@model ProjectViewModel + +@{ + ViewData["Title"] = "Create Project"; +} +
+

Проект

+
+
+
+
Команда:
+
+ +
+
+
+
Название:
+
+ +
+
+
+
Описание:
+
+ +
+
+
+
+
+ +
+
+
\ No newline at end of file diff --git a/TaskTracker/ClientApp/Views/Home/CreateTask.cshtml b/TaskTracker/ClientApp/Views/Home/CreateTask.cshtml new file mode 100644 index 0000000..5b5e62a --- /dev/null +++ b/TaskTracker/ClientApp/Views/Home/CreateTask.cshtml @@ -0,0 +1,50 @@ +@using Contracts.ViewModels +@model TaskViewModel + +@{ + ViewData["Title"] = "Create"; +} +
+

Создание задачи

+
+
+
+
Проект:
+
+ +
+
+
+
Тег:
+
+ +
+
+
+
Краткое описание:
+
+ +
+
+
+
Описание:
+
+ +
+
+
+
Дедлайн:
+
+ +
+
+ +
+
+
+ +
+
+
+ + diff --git a/TaskTracker/ClientApp/Views/Home/Enter.cshtml b/TaskTracker/ClientApp/Views/Home/Enter.cshtml new file mode 100644 index 0000000..06edc6c --- /dev/null +++ b/TaskTracker/ClientApp/Views/Home/Enter.cshtml @@ -0,0 +1,20 @@ +@{ + ViewData["Title"] = "Enter"; +} +
+

Вход в приложение

+
+
+
+
Логин:
+
+
+
+
Пароль:
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/TaskTracker/ClientApp/Views/Home/Index.cshtml b/TaskTracker/ClientApp/Views/Home/Index.cshtml index d2d19bd..60e8a6d 100644 --- a/TaskTracker/ClientApp/Views/Home/Index.cshtml +++ b/TaskTracker/ClientApp/Views/Home/Index.cshtml @@ -1,8 +1,17 @@ -@{ +@using ClientApp.Models + +@{ ViewData["Title"] = "Home Page"; }
-

Welcome

-

Learn about building Web apps with ASP.NET Core.

+

Добро пожаловать, @ViewData["UserName"]!

+ + \ No newline at end of file diff --git a/TaskTracker/ClientApp/Views/Home/Privacy.cshtml b/TaskTracker/ClientApp/Views/Home/Privacy.cshtml index af4fb19..7234c9a 100644 --- a/TaskTracker/ClientApp/Views/Home/Privacy.cshtml +++ b/TaskTracker/ClientApp/Views/Home/Privacy.cshtml @@ -1,6 +1,46 @@ -@{ +@using Contracts.ViewModels + +@model PerformerViewModel +@{ ViewData["Title"] = "Privacy Policy"; } -

@ViewData["Title"]

-

Use this page to detail your site's privacy policy.

+
+

Личные данные

+
+
+
+
Логин:
+
+ +
+
+
+
Пароль:
+
+ +
+
+
+
ФИО:
+
+ +
+
+
+
Специальность:
+
+ +
+
+
+
+
+ +
+
+
\ No newline at end of file diff --git a/TaskTracker/ClientApp/Views/Home/Register.cshtml b/TaskTracker/ClientApp/Views/Home/Register.cshtml new file mode 100644 index 0000000..a0e3db4 --- /dev/null +++ b/TaskTracker/ClientApp/Views/Home/Register.cshtml @@ -0,0 +1,31 @@ +@{ + ViewData["Title"] = "Register"; +} +
+

Регистрация

+
+
+
+
Логин:
+
+
+
+
Пароль:
+
+
+
+
ФИО:
+
+
+
+
Специальность:
+
+
+
+
+
+ +
+
+
diff --git a/TaskTracker/ClientApp/Views/Home/ViewComments.cshtml b/TaskTracker/ClientApp/Views/Home/ViewComments.cshtml new file mode 100644 index 0000000..34fec9f --- /dev/null +++ b/TaskTracker/ClientApp/Views/Home/ViewComments.cshtml @@ -0,0 +1,63 @@ +@using Contracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "View Comments"; +} + +
+

Комментарии

+
+ +
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } + } + +

+ Создать комментарий +

+ + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + } + +
+ Номер + + Задача + + Автор + + Текст +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.TaskName) + + @Html.DisplayFor(modelItem => item.PerformerName) + + @Html.DisplayFor(modelItem => item.TEXT) +
+
\ No newline at end of file diff --git a/TaskTracker/ClientApp/Views/Home/ViewProjects.cshtml b/TaskTracker/ClientApp/Views/Home/ViewProjects.cshtml new file mode 100644 index 0000000..587a0be --- /dev/null +++ b/TaskTracker/ClientApp/Views/Home/ViewProjects.cshtml @@ -0,0 +1,61 @@ +@using Contracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "View Projects"; +} + +
+

Проекты

+
+ +
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } +

+ Создать проект +

+ + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + } + +
+ Номер + + Название + + Описание + + Команда +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.NAME_PJ) + + @Html.DisplayFor(modelItem => item.DESCRIPTION_PJ) + + @Html.DisplayFor(modelItem => item.TeamId) +
+ } +
\ No newline at end of file diff --git a/TaskTracker/ClientApp/Views/Home/ViewTasks.cshtml b/TaskTracker/ClientApp/Views/Home/ViewTasks.cshtml new file mode 100644 index 0000000..4f4b5d7 --- /dev/null +++ b/TaskTracker/ClientApp/Views/Home/ViewTasks.cshtml @@ -0,0 +1,79 @@ +@using Contracts.ViewModels + +@model List + +@{ + ViewData["Title"] = "View Tasks"; +} + +
+

Задачи

+
+ +
+ @{ + if (Model == null) + { +

Авторизируйтесь

+ return; + } +

+ Создать задачу +

+ + + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + + + } + +
+ Номер + + Задача + + Описание + + Статус + + Дедлайн + + Проект + + Тег +
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.SHORT_DESC) + + @Html.DisplayFor(modelItem => item.DESCRIPTION) + + @Html.DisplayFor(modelItem => item.Status) + + @Html.DisplayFor(modelItem => item.DEADLINE) + + @Html.DisplayFor(modelItem => item.ProjectId) + + @Html.DisplayFor(modelItem => item.TagGroupId) +
+ } +
\ No newline at end of file diff --git a/TaskTracker/ClientApp/Views/Shared/_Layout.cshtml b/TaskTracker/ClientApp/Views/Shared/_Layout.cshtml index 1967da7..2117fa9 100644 --- a/TaskTracker/ClientApp/Views/Shared/_Layout.cshtml +++ b/TaskTracker/ClientApp/Views/Shared/_Layout.cshtml @@ -3,27 +3,39 @@ - @ViewData["Title"] - ClientApp + @ViewData["Title"] - TaskTrackerClientApp - +
-