diff --git a/TravelCompany/TravelCompany/FormMain.Designer.cs b/TravelCompany/TravelCompany/FormMain.Designer.cs index 8b5a875..11434f7 100644 --- a/TravelCompany/TravelCompany/FormMain.Designer.cs +++ b/TravelCompany/TravelCompany/FormMain.Designer.cs @@ -33,6 +33,7 @@ this.справочникиToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.условияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.путешествияToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.отчетToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.списокУсловийToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.условияПоПоездкамToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -42,7 +43,6 @@ this.ButtonOrderReady = new System.Windows.Forms.Button(); this.ButtonIssuedOrder = new System.Windows.Forms.Button(); this.ButtonRef = new System.Windows.Forms.Button(); - this.клиентыToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); this.menuStrip.SuspendLayout(); this.SuspendLayout(); @@ -51,14 +51,15 @@ // this.dataGridView.BackgroundColor = System.Drawing.Color.White; this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dataGridView.Location = new System.Drawing.Point(4, 45); + this.dataGridView.Location = new System.Drawing.Point(3, 36); + this.dataGridView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.dataGridView.MultiSelect = false; this.dataGridView.Name = "dataGridView"; this.dataGridView.RowHeadersVisible = false; this.dataGridView.RowHeadersWidth = 62; this.dataGridView.RowTemplate.Height = 33; this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridView.Size = new System.Drawing.Size(1201, 520); + this.dataGridView.Size = new System.Drawing.Size(1209, 416); this.dataGridView.TabIndex = 0; // // menuStrip @@ -69,7 +70,8 @@ this.отчетToolStripMenuItem}); this.menuStrip.Location = new System.Drawing.Point(0, 0); this.menuStrip.Name = "menuStrip"; - this.menuStrip.Size = new System.Drawing.Size(1452, 33); + this.menuStrip.Padding = new System.Windows.Forms.Padding(5, 2, 0, 2); + this.menuStrip.Size = new System.Drawing.Size(1408, 28); this.menuStrip.TabIndex = 1; this.menuStrip.Text = "menuStrip1"; // @@ -80,23 +82,30 @@ this.путешествияToolStripMenuItem, this.клиентыToolStripMenuItem}); this.справочникиToolStripMenuItem.Name = "справочникиToolStripMenuItem"; - this.справочникиToolStripMenuItem.Size = new System.Drawing.Size(139, 29); + this.справочникиToolStripMenuItem.Size = new System.Drawing.Size(117, 24); this.справочникиToolStripMenuItem.Text = "Справочники"; // // условияToolStripMenuItem // this.условияToolStripMenuItem.Name = "условияToolStripMenuItem"; - this.условияToolStripMenuItem.Size = new System.Drawing.Size(270, 34); + this.условияToolStripMenuItem.Size = new System.Drawing.Size(182, 26); this.условияToolStripMenuItem.Text = "Условия"; this.условияToolStripMenuItem.Click += new System.EventHandler(this.условияToolStripMenuItem_Click); // // путешествияToolStripMenuItem // this.путешествияToolStripMenuItem.Name = "путешествияToolStripMenuItem"; - this.путешествияToolStripMenuItem.Size = new System.Drawing.Size(270, 34); + this.путешествияToolStripMenuItem.Size = new System.Drawing.Size(182, 26); this.путешествияToolStripMenuItem.Text = "Путешествия"; this.путешествияToolStripMenuItem.Click += new System.EventHandler(this.путешествияToolStripMenuItem_Click); // + // клиентыToolStripMenuItem + // + this.клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem"; + this.клиентыToolStripMenuItem.Size = new System.Drawing.Size(182, 26); + this.клиентыToolStripMenuItem.Text = "Клиенты"; + this.клиентыToolStripMenuItem.Click += new System.EventHandler(this.клиентыToolStripMenuItem_Click); + // // отчетToolStripMenuItem // this.отчетToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -104,35 +113,36 @@ this.условияПоПоездкамToolStripMenuItem, this.списокЗаказовToolStripMenuItem}); this.отчетToolStripMenuItem.Name = "отчетToolStripMenuItem"; - this.отчетToolStripMenuItem.Size = new System.Drawing.Size(75, 29); + this.отчетToolStripMenuItem.Size = new System.Drawing.Size(62, 24); this.отчетToolStripMenuItem.Text = "Отчет"; // // списокУсловийToolStripMenuItem // this.списокУсловийToolStripMenuItem.Name = "списокУсловийToolStripMenuItem"; - this.списокУсловийToolStripMenuItem.Size = new System.Drawing.Size(291, 34); + this.списокУсловийToolStripMenuItem.Size = new System.Drawing.Size(243, 26); this.списокУсловийToolStripMenuItem.Text = "Список путешествий"; this.списокУсловийToolStripMenuItem.Click += new System.EventHandler(this.ConditionsToolStripMenuItem_Click); // // условияПоПоездкамToolStripMenuItem // this.условияПоПоездкамToolStripMenuItem.Name = "условияПоПоездкамToolStripMenuItem"; - this.условияПоПоездкамToolStripMenuItem.Size = new System.Drawing.Size(291, 34); + this.условияПоПоездкамToolStripMenuItem.Size = new System.Drawing.Size(243, 26); this.условияПоПоездкамToolStripMenuItem.Text = "Условия по поездкам"; this.условияПоПоездкамToolStripMenuItem.Click += new System.EventHandler(this.ConditionTravelsToolStripMenuItem_Click); // // списокЗаказовToolStripMenuItem // this.списокЗаказовToolStripMenuItem.Name = "списокЗаказовToolStripMenuItem"; - this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(291, 34); + this.списокЗаказовToolStripMenuItem.Size = new System.Drawing.Size(243, 26); this.списокЗаказовToolStripMenuItem.Text = "Список заказов"; this.списокЗаказовToolStripMenuItem.Click += new System.EventHandler(this.OrdersToolStripMenuItem_Click); // // buttonCreateOrder // - this.buttonCreateOrder.Location = new System.Drawing.Point(1224, 55); + this.buttonCreateOrder.Location = new System.Drawing.Point(1224, 36); + this.buttonCreateOrder.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.buttonCreateOrder.Name = "buttonCreateOrder"; - this.buttonCreateOrder.Size = new System.Drawing.Size(216, 34); + this.buttonCreateOrder.Size = new System.Drawing.Size(173, 27); this.buttonCreateOrder.TabIndex = 2; this.buttonCreateOrder.Text = "Создать заказ"; this.buttonCreateOrder.UseVisualStyleBackColor = true; @@ -140,9 +150,10 @@ // // ButtonTakeOrderInWork // - this.ButtonTakeOrderInWork.Location = new System.Drawing.Point(1224, 124); + this.ButtonTakeOrderInWork.Location = new System.Drawing.Point(1224, 91); + this.ButtonTakeOrderInWork.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.ButtonTakeOrderInWork.Name = "ButtonTakeOrderInWork"; - this.ButtonTakeOrderInWork.Size = new System.Drawing.Size(216, 34); + this.ButtonTakeOrderInWork.Size = new System.Drawing.Size(173, 27); this.ButtonTakeOrderInWork.TabIndex = 3; this.ButtonTakeOrderInWork.Text = "Отдать на выполнение"; this.ButtonTakeOrderInWork.UseVisualStyleBackColor = true; @@ -150,9 +161,10 @@ // // ButtonOrderReady // - this.ButtonOrderReady.Location = new System.Drawing.Point(1224, 203); + this.ButtonOrderReady.Location = new System.Drawing.Point(1224, 154); + this.ButtonOrderReady.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.ButtonOrderReady.Name = "ButtonOrderReady"; - this.ButtonOrderReady.Size = new System.Drawing.Size(216, 34); + this.ButtonOrderReady.Size = new System.Drawing.Size(173, 27); this.ButtonOrderReady.TabIndex = 4; this.ButtonOrderReady.Text = "Заказ готов"; this.ButtonOrderReady.UseVisualStyleBackColor = true; @@ -160,9 +172,10 @@ // // ButtonIssuedOrder // - this.ButtonIssuedOrder.Location = new System.Drawing.Point(1224, 267); + this.ButtonIssuedOrder.Location = new System.Drawing.Point(1224, 206); + this.ButtonIssuedOrder.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.ButtonIssuedOrder.Name = "ButtonIssuedOrder"; - this.ButtonIssuedOrder.Size = new System.Drawing.Size(216, 34); + this.ButtonIssuedOrder.Size = new System.Drawing.Size(173, 27); this.ButtonIssuedOrder.TabIndex = 5; this.ButtonIssuedOrder.Text = "Заказ выдан"; this.ButtonIssuedOrder.UseVisualStyleBackColor = true; @@ -170,26 +183,20 @@ // // ButtonRef // - this.ButtonRef.Location = new System.Drawing.Point(1224, 338); + this.ButtonRef.Location = new System.Drawing.Point(1224, 262); + this.ButtonRef.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.ButtonRef.Name = "ButtonRef"; - this.ButtonRef.Size = new System.Drawing.Size(216, 34); + this.ButtonRef.Size = new System.Drawing.Size(173, 27); this.ButtonRef.TabIndex = 6; this.ButtonRef.Text = "Обновить список"; this.ButtonRef.UseVisualStyleBackColor = true; this.ButtonRef.Click += new System.EventHandler(this.ButtonRef_Click); // - // клиентыToolStripMenuItem - // - this.клиентыToolStripMenuItem.Name = "клиентыToolStripMenuItem"; - this.клиентыToolStripMenuItem.Size = new System.Drawing.Size(270, 34); - this.клиентыToolStripMenuItem.Text = "Клиенты"; - this.клиентыToolStripMenuItem.Click += new System.EventHandler(this.клиентыToolStripMenuItem_Click); - // // FormMain // - this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 25F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1452, 577); + this.ClientSize = new System.Drawing.Size(1408, 462); this.Controls.Add(this.ButtonRef); this.Controls.Add(this.ButtonIssuedOrder); this.Controls.Add(this.ButtonOrderReady); @@ -198,6 +205,7 @@ this.Controls.Add(this.dataGridView); this.Controls.Add(this.menuStrip); this.MainMenuStrip = this.menuStrip; + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Name = "FormMain"; this.Text = "Туристическая фирма"; this.Load += new System.EventHandler(this.FormMain_Load); diff --git a/TravelCompany/TravelCompany/FormMain.cs b/TravelCompany/TravelCompany/FormMain.cs index 73a76e2..bebe43c 100644 --- a/TravelCompany/TravelCompany/FormMain.cs +++ b/TravelCompany/TravelCompany/FormMain.cs @@ -34,6 +34,7 @@ namespace TravelCompany dataGridView.Columns["TravelId"].Visible = false; dataGridView.Columns["ClientId"].Visible = false; dataGridView.Columns["TravelName"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; + dataGridView.Columns["ClientFIO"].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; } } catch (Exception ex) diff --git a/TravelCompany/TravelCompanyClientApp/APIClient.cs b/TravelCompany/TravelCompanyClientApp/APIClient.cs index 150e8cf..a60db7d 100644 --- a/TravelCompany/TravelCompanyClientApp/APIClient.cs +++ b/TravelCompany/TravelCompanyClientApp/APIClient.cs @@ -3,7 +3,7 @@ using Newtonsoft.Json; using System.Net.Http.Headers; using System.Text; -namespace PrecastConcretePlantClientApp +namespace TravelCompanyClientApp { public class APIClient { diff --git a/TravelCompany/TravelCompanyClientApp/Controllers/HomeController.cs b/TravelCompany/TravelCompanyClientApp/Controllers/HomeController.cs index f2a5f26..ec6335d 100644 --- a/TravelCompany/TravelCompanyClientApp/Controllers/HomeController.cs +++ b/TravelCompany/TravelCompanyClientApp/Controllers/HomeController.cs @@ -1,12 +1,12 @@ -using TravelCompanyContracts.BindingModels; -using TravelCompanyContracts.ViewModels; -using TravelCompanyClientApp.Models; -using Microsoft.AspNetCore.Mvc; -using System.Diagnostics; +using Microsoft.AspNetCore.Mvc; using TravelCompanyClientApp; -using PrecastConcretePlantClientApp; +using System.Diagnostics; +using TravelCompanyClientApp.Models; +using TravelCompanyContracts.BindingModels; +using TravelCompanyContracts.ViewModels; -namespace TravelCompanyClientApp.Controllers + +namespace AbstractShowClientApp.Controllers { public class HomeController : Controller { @@ -76,7 +76,8 @@ namespace TravelCompanyClientApp.Controllers [HttpPost] public void Enter(string login, string password) { - if (string.IsNullOrEmpty(login) ||string.IsNullOrEmpty(password)) + if (string.IsNullOrEmpty(login) || +string.IsNullOrEmpty(password)) { throw new Exception("Введите логин и пароль"); } @@ -101,7 +102,8 @@ namespace TravelCompanyClientApp.Controllers { throw new Exception("Введите логин, пароль и ФИО"); } - APIClient.PostRequest("api/client/register", new ClientBindingModel + APIClient.PostRequest("api/client/register", new + ClientBindingModel { ClientFIO = fio, Email = login, @@ -113,8 +115,7 @@ namespace TravelCompanyClientApp.Controllers [HttpGet] public IActionResult Create() { - ViewBag.Products = - APIClient.GetRequest>("api/main/gettravellist"); + ViewBag.Travels = APIClient.GetRequest>("api/main/gettravellist"); return View(); } [HttpPost] diff --git a/TravelCompany/TravelCompanyClientApp/Program.cs b/TravelCompany/TravelCompanyClientApp/Program.cs index 8381094..606dd1c 100644 --- a/TravelCompany/TravelCompanyClientApp/Program.cs +++ b/TravelCompany/TravelCompanyClientApp/Program.cs @@ -1,5 +1,3 @@ -using PrecastConcretePlantClientApp; -using TravelCompanyClientApp; using TravelCompanyClientApp; var builder = WebApplication.CreateBuilder(args); diff --git a/TravelCompany/TravelCompanyClientApp/Views/Home/Create.cshtml b/TravelCompany/TravelCompanyClientApp/Views/Home/Create.cshtml index 9a9f40a..6e5aecf 100644 --- a/TravelCompany/TravelCompanyClientApp/Views/Home/Create.cshtml +++ b/TravelCompany/TravelCompanyClientApp/Views/Home/Create.cshtml @@ -1,51 +1,48 @@ @{ -ViewData["Title"] = "Create"; + ViewData["Title"] = "Create"; }
-

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

+

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

-
-
Изделие:
-
- -
-
-
-
Количество:
-
-
-
-
Сумма:
-
-
-
-
-
-
+
+
Путешествие:
+
+ +
+
+
+
Количество:
+
+
+
+
Сумма:
+
+
+
+
+
+
\ No newline at end of file diff --git a/TravelCompany/TravelCompanyClientApp/Views/Home/Index.cshtml b/TravelCompany/TravelCompanyClientApp/Views/Home/Index.cshtml index d2d19bd..85544a2 100644 --- a/TravelCompany/TravelCompanyClientApp/Views/Home/Index.cshtml +++ b/TravelCompany/TravelCompanyClientApp/Views/Home/Index.cshtml @@ -1,8 +1,57 @@ -@{ - ViewData["Title"] = "Home Page"; +@using TravelCompanyContracts.ViewModels +@model List +@{ + ViewData["Title"] = "Home Page"; } -
-

Welcome

-

Learn about building Web apps with ASP.NET Core.

+

Заказы

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

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

+ return; + } +

+ Создать заказ +

+ + + + + + + + + + + + + @foreach (var item in Model) + { + + + + + + + + + } + +
НомерИзделиеДата созданияКоличествоСуммаСтатус
+ @Html.DisplayFor(modelItem => item.Id) + + @Html.DisplayFor(modelItem => item.TravelName) + + @Html.DisplayFor(modelItem => item.DateCreate) + + @Html.DisplayFor(modelItem => item.Count) + + @Html.DisplayFor(modelItem => item.Sum) + + @Html.DisplayFor(modelItem => item.Status) +
+ } +
\ No newline at end of file diff --git a/TravelCompany/TravelCompanyClientApp/Views/Shared/_Layout.cshtml b/TravelCompany/TravelCompanyClientApp/Views/Shared/_Layout.cshtml index 6eae214..075e74a 100644 --- a/TravelCompany/TravelCompanyClientApp/Views/Shared/_Layout.cshtml +++ b/TravelCompany/TravelCompanyClientApp/Views/Shared/_Layout.cshtml @@ -3,7 +3,7 @@ -@ViewData["Title"] - AbstractShowClientApp +@ViewData["Title"] - TravelCompanyClientApp @@ -13,7 +13,7 @@