介绍 (Introduction)

In this article, we will be creating a personal expense manager using ASP.NET Core 2.1 and Entity Framework (EF) core Code First approach. This expense manager tracks your daily expenses and provides comparative charts to show your expense summary. We are using modal dialog to handle user inputs and to show monthly and weekly expense summary chart using Highcharts. Hence, this will be a Single Page Application (SPA).

在本文中,我们将使用ASP.NET Core 2.1和Entity Framework(EF)核心代码优先方法创建个人费用管理器。 该费用经理跟踪您的日常费用并提供比较图表以显示您的费用摘要。 我们正在使用模式对话框来处理用户输入,并使用Highcharts显示每月和每周的费用摘要表。 因此,这将是一个单页应用程序(SPA)。

We will be using Visual Studio 2017 and SQL Server 2017 for our demo.

我们将在演示中使用Visual Studio 2017和SQL Server 2017。

Let us look at the final application:

让我们看一下最终的应用程序:

先决条件 (Prerequisites)

  • Install .NET Core 2.1 SDK from here

    从此处安装.NET Core 2.1 SDK

  • Install the latest version of Visual Studio 2017 from here

    从此处安装最新版本的Visual Studio 2017

  • SQL Server 2008 or above

    SQL Server 2008或以上

源代码 (Source Code)

Before proceeding, I recommend you get the source code from GitHub.

在继续之前,建议您从GitHub获取源代码。

创建ASP.NET Core项目 (Create the ASP.NET Core project)

Open Visual Studio and select “File” > “New” > “Project”.

打开Visual Studio,然后选择“文件”>“新建”>“项目”。

After selecting the project, a “New Project” dialog will open. Select “.NET Core” in the left panel inside the Visual C# menu.

选择项目后,将打开“新建项目”对话框。 在Visual C#菜单内的左侧面板中选择“ .NET Core”。

Then, select “ASP.NET Core Web Application” from the available project types. Put the name of the project as “ExpenseManager” and press “OK” to create the ASP.NET Core Project.

然后,从可用的项目类型中选择“ ASP.NET Core Web应用程序”。 将项目名称命名为“ ExpenseManager”,然后按“确定”以创建ASP.NET Core项目。

After clicking on OK, a new dialog will open asking you to select the project template.

单击确定后,将打开一个新对话框,要求您选择项目模板。

You will see two drop-down menus at the top left of the template window. Select “.NET Core” and “ASP.NET Core 2.1” from these dropdowns. Then, select “Web application (Model-View-Controller)” template and press “OK”.

您将在模板窗口的左上方看到两个下拉菜单。 从这些下拉列表中选择“ .NET Core”和“ ASP.NET Core 2.1”。 然后,选择“ Web应用程序(模型-视图-控制器)”模板,然后按“确定”。

将模型添加到应用程序 (Adding the model to the application)

Since we are using the EF core Code First approach, first we will create our model class. Then we will generate our database tables using the model.

由于我们使用的是EF核心代码优先方法,因此首先我们将创建模型类。 然后,我们将使用该模型生成数据库表。

Right click on the “Models” folder and select “Add” > “Class”. Name your class “ExpenseReport.cs”. This class will contain our “Employee” model properties.

右键单击“模型”文件夹,然后选择“添加”>“类”。 将您的班级命名为“ ExpenseReport。 cs ”。 该类将包含我们的“ Employee”模型属性。

Open the “ExpenseReport.cs” file and put in the following code:

打开“ ExpenseReport.cs”文件,并输入以下代码:

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;namespace ExpenseManager.Models
{public class ExpenseReport{[Key]public int ItemId { get; set; }[Required]public string ItemName { get; set; }[Required][DataType(DataType.Currency)][Column(TypeName = "decimal(10, 2)")]public decimal Amount { get; set; }[DataType(DataType.Date)][DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)][Required]public DateTime ExpenseDate { get; set; } = DateTime.Now;[Required]public string Category { get; set; }}
}

We have used the [Key] attribute with ItemId to make it the primary key while creating the database table.

在创建数据库表时,我们已将[Key]属性与ItemId一起用作主键。

使用EF Core Code First方法创建数据库表 (Creating the database table using the EF Core Code First approach)

In order to create our tables using EF Core Code First approach, we need to install few NuGet packages.

为了使用EF Core Code First方法创建表,我们需要安装一些NuGet软件包。

Navigate to “Tools” > “NuGet Package Manager” > “Package Manager Console”.

导航到“工具”>“ NuGet软件包管理器”>“软件包管理器控制台”。

We have to install the package for the database provider that we are targeting. In this case, it is SQL Server. Hence, run the following command:

我们必须为目标数据库安装程序安装软件包。 在这种情况下,它是SQL Server。 因此,运行以下命令:

Install-Package Microsoft.EntityFrameworkCore.SqlServer

Since we are using EF Tools to create a table from the existing model, we will install the Tools package as well. Run the following command:

由于我们使用EF Tools从现有模型创建表,因此我们还将安装Tools软件包。 运行以下命令:

Install-Package Microsoft.EntityFrameworkCore.Tools

After the package installations are successful, we will create a dbcontext class. Add a file “ExpenseDBContext.cs” in the Models folder and put in the following code:

软件包安装成功后,我们将创建一个dbcontext类。 在“模型”文件夹中添加文件“ ExpenseDBContext.cs”,并输入以下代码:

using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;namespace ExpenseManager.Models
{public class ExpenseDBContext : DbContext{public virtual DbSet<ExpenseReport> ExpenseReport { get; set; }protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder){if (!optionsBuilder.IsConfigured){
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. See http://go.microsoft.com/fwlink/?LinkId=723263 for guidance on storing connection strings.optionsBuilder.UseSqlServer("Your connection string");}}}
}

Do not forget to put your own connection string (inside “”).

不要忘记在连接字符串中放入“”

We will create a dataset migration which is used to keep the database schema in sync with the model. There is no database at this moment, so the first migration will create it, and add tables for the entities represented by the DbSet properties on the ExpenseDBContext that we have created.

我们将创建一个数据集迁移,用于使数据库架构与模型保持同步。 目前没有数据库,因此第一次迁移将创建数据库, 在我们创建的DbSet上为ExpenseDBContext属性表示的实体添加表。

To create the dataset migration, navigate to the project folder and open the PowerShell window. Execute the following command in it:

要创建数据集迁移,请导航到项目文件夹并打开PowerShell窗口。 在其中执行以下命令:

dotnet ef  migrations add ExpenseMigration

Refer to the image below:

请参考下图:

This will create a folder named “Migrations” into our project, which contains the code for the migration and a model snapshot. Refer to the image below:

这将在我们的项目中创建一个名为“ Migrations”的文件夹,其中包含迁移代码模型快照。 请参考下图:

Enter the following command in the PowerShell window to execute the migration:

在PowerShell窗口中输入以下命令以执行迁移:

dotnet ef database update

Refer to the image below:

请参考下图:

This will create the table “ExpenseReport” in our database that we have mentioned in the connection string. You can see that the column ItemId is the primary key here.

这将在连接字符串中提到的数据库中创建表“ ExpenseReport”。 您可以在此处看到ItemId列是主键。

Hence, the database creation is completed successfully using the EF Code First approach.

因此,使用EF Code First方法成功完成了数据库创建。

将数据访问层添加到我们的应用程序 (Adding the Data Access layer to our application)

Add a class file “ExpensesDataAcessLayer.cs” into the “Models” folder and put in the following code:

将类文件“ ExpensesDataAcessLayer.cs”添加到“ Models”文件夹中,并输入以下代码:

using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;namespace ExpenseManager.Models
{public class ExpensesDataAcessLayer{ExpenseDBContext db = new ExpenseDBContext();public IEnumerable<ExpenseReport> GetAllExpenses(){try{return db.ExpenseReport.ToList();}catch{throw;}}// To filter out the records based on the search string public IEnumerable<ExpenseReport> GetSearchResult(string searchString){List<ExpenseReport> exp = new List<ExpenseReport>();try{exp = GetAllExpenses().ToList();return exp.Where(x => x.ItemName.IndexOf(searchString, StringComparison.OrdinalIgnoreCase) != -1);}catch{throw;}}//To Add new Expense record       public void AddExpense(ExpenseReport expense){try{db.ExpenseReport.Add(expense);db.SaveChanges();}catch{throw;}}//To Update the records of a particluar expense  public int UpdateExpense(ExpenseReport expense){try{db.Entry(expense).State = EntityState.Modified;db.SaveChanges();return 1;}catch{throw;}}//Get the data for a particular expense  public ExpenseReport GetExpenseData(int id){try{ExpenseReport expense = db.ExpenseReport.Find(id);return expense;}catch{throw;}}//To Delete the record of a particular expense  public void DeleteExpense(int id){try{ExpenseReport emp = db.ExpenseReport.Find(id);db.ExpenseReport.Remove(emp);db.SaveChanges();}catch{throw;}}// To calculate last six months expensepublic Dictionary<string, decimal> CalculateMonthlyExpense(){ExpensesDataAcessLayer objexpense = new ExpensesDataAcessLayer();List<ExpenseReport> lstEmployee = new List<ExpenseReport>();Dictionary<string, decimal> dictMonthlySum = new Dictionary<string, decimal>();decimal foodSum = db.ExpenseReport.Where(cat => cat.Category == "Food" && (cat.ExpenseDate > DateTime.Now.AddMonths(-7))).Select(cat => cat.Amount).Sum();decimal shoppingSum = db.ExpenseReport.Where(cat => cat.Category == "Shopping" && (cat.ExpenseDate > DateTime.Now.AddMonths(-7))).Select(cat => cat.Amount).Sum();decimal travelSum = db.ExpenseReport.Where(cat => cat.Category == "Travel" && (cat.ExpenseDate > DateTime.Now.AddMonths(-7))).Select(cat => cat.Amount).Sum();decimal healthSum = db.ExpenseReport.Where(cat => cat.Category == "Health" && (cat.ExpenseDate > DateTime.Now.AddMonths(-7))).Select(cat => cat.Amount).Sum();dictMonthlySum.Add("Food", foodSum);dictMonthlySum.Add("Shopping", shoppingSum);dictMonthlySum.Add("Travel", travelSum);dictMonthlySum.Add("Health", healthSum);return dictMonthlySum;}// To calculate last four weeks expensepublic Dictionary<string, decimal> CalculateWeeklyExpense(){ExpensesDataAcessLayer objexpense = new ExpensesDataAcessLayer();List<ExpenseReport> lstEmployee = new List<ExpenseReport>();Dictionary<string, decimal> dictWeeklySum = new Dictionary<string, decimal>();decimal foodSum = db.ExpenseReport.Where(cat => cat.Category == "Food" && (cat.ExpenseDate > DateTime.Now.AddDays(-7))).Select(cat => cat.Amount).Sum();decimal shoppingSum = db.ExpenseReport.Where(cat => cat.Category == "Shopping" && (cat.ExpenseDate > DateTime.Now.AddDays(-28))).Select(cat => cat.Amount).Sum();decimal travelSum = db.ExpenseReport.Where(cat => cat.Category == "Travel" && (cat.ExpenseDate > DateTime.Now.AddDays(-28))).Select(cat => cat.Amount).Sum();decimal healthSum = db.ExpenseReport.Where(cat => cat.Category == "Health" && (cat.ExpenseDate > DateTime.Now.AddDays(-28))).Select(cat => cat.Amount).Sum();dictWeeklySum.Add("Food", foodSum);dictWeeklySum.Add("Shopping", shoppingSum);dictWeeklySum.Add("Travel", travelSum);dictWeeklySum.Add("Health", healthSum);return dictWeeklySum;}}
}

This file will have methods to handle CRUD operations on our database. We are also calculating the totals for the last six months’ expenses and the last four weeks’ expenses for each category.

该文件将具有处理数据库上的CRUD操作的方法。 我们还在计算每个类别的最近六个月的支出和最近四个星期的支出的总计。

将控制器添加到应用程序 (Adding the controller to the application)

Right click on the “Controllers” folder and select “Add” > “New Item”. An “Add New Item” dialog box will open. Select “ASP.NET Core” from the left panel, then select “Controller Class” from the templates panel, and put the name as “ExpenseController.cs”. Press “Add”.

右键单击“ Controllers”文件夹,然后选择“ Add”>“ New Item”。 “添加新项”对话框将打开。 从左侧面板中选择“ ASP.NET Core”,然后从模板面板中选择“ Controller Class”,然后将名称命名为“ ExpenseController.cs”。 按“添加”。

This will create our controller ExpenseController inside the Controllers” folder. Open the “ExpenseController.cs” file and put in the following code:

这将创建我们的控制器ExpenseController 控制器”文件夹。 打开“ ExpenseController.cs”文件,并输入以下代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ExpenseManager.Models;
using Microsoft.AspNetCore.Mvc;namespace ExpenseManager.Controllers
{public class ExpenseController : Controller{ExpensesDataAcessLayer objexpense = new ExpensesDataAcessLayer();public IActionResult Index(string searchString){List<ExpenseReport> lstEmployee = new List<ExpenseReport>();lstEmployee = objexpense.GetAllExpenses().ToList();if (!String.IsNullOrEmpty(searchString)){lstEmployee = objexpense.GetSearchResult(searchString).ToList();}return View(lstEmployee);}public ActionResult AddEditExpenses(int itemId){ExpenseReport model = new ExpenseReport();if (itemId > 0){model = objexpense.GetExpenseData(itemId);}return PartialView("_expenseForm", model);}[HttpPost]public ActionResult Create(ExpenseReport newExpense){if (ModelState.IsValid){if (newExpense.ItemId > 0){objexpense.UpdateExpense(newExpense);}else{objexpense.AddExpense(newExpense);}}return RedirectToAction("Index");}[HttpPost]public IActionResult Delete(int id){objexpense.DeleteExpense(id);return RedirectToAction("Index");}public ActionResult ExpenseSummary(){return PartialView("_expenseReport");}public JsonResult GetMonthlyExpense(){Dictionary<string, decimal> monthlyExpense = objexpense.CalculateMonthlyExpense();return new JsonResult(monthlyExpense);}public JsonResult GetWeeklyExpense(){Dictionary<string, decimal> weeklyExpense = objexpense.CalculateWeeklyExpense();return new JsonResult(weeklyExpense);}}
}

The Controller will have the methods to call our data access layer methods to handle database operations.

Controller将具有调用我们的数据访问层方法的方法来处理数据库操作。

向应用程序添加视图 (Adding views to the application)

We will create three view files:

我们将创建三个视图文件:

  1. “Index.cshtml” — this view will display all the expense data, and contains a search box to search for a particular item.

    “ Index.cshtml”-此视图将显示所有费用数据,并包含一个搜索框以搜索特定项目。
  2. “_expenseForm.cshtml” — this is a partial view, which contains the form to handle user inputs. This is used for both add and edit functionality, and will be rendered in a modal dialog.

    “ _expenseForm.cshtml”-这是局部视图,其中包含用于处理用户输入的表单。 这用于添加和编辑功能,并将在模式对话框中呈现。
  3. “_expenseReport.cshtml”:— this is also a partial view, which will show the expense summary in a bar chart using Highcharts. It is also rendered as a modal dialog.

    “ _expenseReport.cshtml”:这也是局部视图,它将使用Highcharts在条形图中显示费用摘要。 它还呈现为模式对话框。

索引检视 (Index view)

To create the view file, right click on the “Index” method in our controller and select “Add View…”. This will open an “Add MVC View” dialog box. Put in the name of view as “Index” and click “Add”. Make sure that the “Create as a partial view” check box is not checked. Refer to the image below:

要创建视图文件,请在控制器中右键单击“索引”方法,然后选择“添加视图…”。 这将打开“添加MVC视图”对话框。 在视图名称中输入“索引”,然后单击“添加”。 确保 选中“创建为局部视图”复选框。 请参考下图:

This will create the “Index.cshtml” file inside the “Expense” folder, under the “Views” folder. Open the “Index.cshtml” file and put in the following code:

这将在“视图”文件夹下的“费用”文件夹中创建“ Index.cshtml”文件。 打开“ Index.cshtml”文件,并输入以下代码:

@model IEnumerable<ExpenseManager.Models.ExpenseReport>@{ViewData["Title"] = "Personal Expense Manager";
}
<link href="~/lib/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/js/bootstrap-datepicker.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/css/bootstrap-datepicker.css" rel="stylesheet"><h2>Personal Expense Manager</h2>
<br />
<div><div style="float:left"><button class="btn btn-primary" onclick="AddEditExpenses(0)">Add Expense</button><button class="btn btn-success" onclick="ReportExpense()">Expense Report</button></div><div style="float:right; width:40%;"><form asp-controller="Expense" asp-action="Index" class="form-group"><div class="col-sm-6"><input class="form-control" type="text" name="SearchString" placeholder="Search"></div><button type="submit" class="btn btn-default btn-info">Filter</button></form></div>
</div>
<br />
<br />
<table class="table"><thead><tr><th>@Html.DisplayNameFor(model => model.ItemId)</th><th>@Html.DisplayNameFor(model => model.ItemName)</th><th>@Html.DisplayNameFor(model => model.Amount)</th><th>@Html.DisplayNameFor(model => model.ExpenseDate)</th><th>@Html.DisplayNameFor(model => model.Category)</th><th>Action Item</th></tr></thead><tbody>@foreach (var item in Model){<tr><td>@Html.DisplayFor(modelItem => item.ItemId)</td><td>@Html.DisplayFor(modelItem => item.ItemName)</td><td>@Html.DisplayFor(modelItem => item.Amount)</td><td>@Html.DisplayFor(modelItem => item.ExpenseDate)</td><td>@Html.DisplayFor(modelItem => item.Category)</td><td><button class="btn btn-default" onclick="AddEditExpenses(@item.ItemId)">Edit</button><button class="btn btn-danger" onclick="DeleteExpense(@item.ItemId)">Delete</button></td></tr>}</tbody>
</table><div class="modal fade" id="expenseFormModel" role="dialog"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">&times;</a><h3 id="title" class="modal-title">Add Expense</h3></div><div class="modal-body" id="expenseFormModelDiv"></div></div></div>
</div><div class="modal fade" id="expenseReportModal" role="dialog"><div class="modal-dialog modal-lg"><div class="modal-content"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">&times;</a><h3 class="modal-title">Expense Report</h3></div><div class="modal-body" id="expenseReportModalDiv"></div></div></div>
</div><script>var AddEditExpenses = function (itemId) {var url = "/Expense/AddEditExpenses?itemId=" + itemId;if (itemId > 0)$('#title').html("Edit Expense");$("#expenseFormModelDiv").load(url, function () {$("#expenseFormModel").modal("show");});$('#expenseFormModel').on('shown.bs.modal', function () {$('#calender-container .input-group.date').datepicker({todayBtn: true,calendarWeeks: true,todayHighlight: true,autoclose: true,container: '#expenseFormModel modal-body'});});}var ReportExpense = function () {var url = "/Expense/ExpenseSummary";$("#expenseReportModalDiv").load(url, function () {$("#expenseReportModal").modal("show");})}var DeleteExpense = function (itemId) {var ans = confirm("Do you want to delete item with Item Id: " + itemId);if (ans) {$.ajax({type: "POST",url: "/Expense/Delete/" + itemId,success: function () {window.location.href = "/Expense/Index";}})}}
</script><script>$('body').on('click', "#btnSubmit", function () {var myformdata = $("#expenseForm").serialize();$.ajax({type: "POST",url: "/Expense/Create",data: myformdata,success: function () {$("#myModal").modal("hide");window.location.href = "/Expense/Index";},error: function (errormessage) {alert(errormessage.responseText);}})})
</script>

Let us understand this code.

让我们了解这段代码。

At the top, we have included the bootstrap and jQuery references.

在顶部,我们包括了引导程序和jQuery参考。

After that, we have added two buttons for adding a new expense, and for creating the expense summary.

之后,我们添加了两个按钮,用于添加新费用和创建费用摘要。

We have also included a form containing a search box to filter out the records. On clicking of “Filter” button, the form is submitted and it invokes the Index method in our controller — which will return the items matching the search criteria. The search functionality is provided only on the item name field.

我们还提供了一个表格,其中包含一个用于过滤记录的搜索框。 单击“过滤器”按钮后,将提交表单,并在我们的控制器中调用Index方法-该方法将返回与搜索条件匹配的项目。 搜索功能仅在项目名称字段上提供。

We are using a table to display all the expense records in our database. Each record has two action buttons corresponding to it — “Edit” and “Delete”.

我们正在使用一个表来显示数据库中的所有费用记录。 每个记录都有两个与之对应的操作按钮-“编辑”和“删除”。

We have also created two modal dialogs. One is for adding/editing the expense data, and the other for displaying the expense summary report.

我们还创建了两个模式对话框。 一种用于添加/编辑费用数据,另一种用于显示费用摘要报告。

In the script section, we have defined anAddEditExpenses function. This function will be invoked when the “Add Expense” or “Edit” button is clicked. We are passing the itemId as the parameter in this method. If the ItemId value is not set, then it is considered an Add function. If the ItemId is set, then it is an Edit function.

在脚本部分,我们定义了一个AddEditExpenses函数。 单击“添加费用”或“编辑”按钮时,将调用此功能。 在此方法中,我们将itemId作为参数传递。 如果未设置 ItemId值,则将其视为Add函数。 如果设置ItemId 则它是一个Edit函数。

We will call AddEditExpenses in our controller which will return the partial view “_expenseForm” and bind it to the ExpenseReport model. The modal dialog will be empty for an Add call and will contain the expense item data in case of an Edit call. We are using a bootstrap datepicker to select the expense date, hence we have set the datepicker properties on modal dialog load.

我们将在控制器中调用AddEditExpenses ,它将返回部分视图“ _expenseForm”并将其绑定到ExpenseReport模型。 对于“ Add呼叫,模式对话框将为空,并且在“ Edit呼叫的情况下将包含费用项目数据。 我们正在使用引导日期选择器来选择费用日期,因此我们在模式对话框加载中设置了日期选择器属性。

The ReportExpense function will call the ExpenseSummary method in our controller. This will return the partial view “_expenseReport” to be displayed as a modal dialog. This partial view will display the monthly and weekly expense summary chart using Highcharts.

ReportExpense函数将在我们的控制器中调用ExpenseSummary方法。 这将返回部分视图“ _expenseReport”,以显示为模式对话框。 此局部视图将使用Highcharts显示每月和每周费用摘要图表。

The DeleteExpense function is used to delete the record of a particular expense. This will invoke the Delete method in our controller to remove the expense record from our database.

DeleteExpense函数用于删除特定费用的记录。 这将在我们的控制器中调用Delete方法,以从我们的数据库中删除费用记录。

We are also using dynamic binding to bind the submit event of the “expenseForm” modal. This form is defined in the “_expenseForm.cshtml” view. On submitting the form, we are invoking an ajax call to the Create method in our controller class.

我们还使用动态绑定来绑定“ expenseForm”模式的Submit事件。 此表单在“ _expenseForm.cshtml”视图中定义。 在提交表单时,我们正在对控制器类中的Create方法进行ajax调用。

Since we are using the same form for both the Edit and Add functionality, we need to distinguish between both using the ItemId value. In the Create method of the controller, if the ItemId is set, then we will invoke the UpdateExpense method. Otherwise, the AddExpense method is invoked. After a successful submit, we will close the modal and redirect to the Index view to show the updated list of expenses.

由于我们为“ Edit和“ Add功能使用的表单相同,因此我们需要使用ItemId值来区分两者。 在控制器的Create方法中,如果设置了ItemId ,则将调用UpdateExpense方法。 否则,将调用AddExpense方法。 成功提交后,我们将关闭模式并重定向到“索引”视图以显示更新的费用列表。

ExpenseForm视图 (ExpenseForm view)

This is a partial view that will be displayed in a modal dialog on clicking the “Add Expense” button in the “Index” view.

单击“索引”视图中的“添加费用”按钮后,将在模式对话框中显示该局部视图。

To create the view file, right click anywhere inside our controller file and select “Add View…”. This will open an “Add MVC View” dialog box. Put in the name of the view as “_expenseForm” and click “Add”. Make sure that the “Create as a partial view” check box is selected. Refer to the image below:

要创建视图文件,请在我们的控制器文件中的任意位置单击鼠标右键,然后选择“添加视图…”。 这将打开“添加MVC视图”对话框。 在视图名称中输入“ _expenseForm”,然后单击“添加”。 确保 “创建的局部视图”复选框选中。 请参考下图:

Open the “_expenseForm.cshtml file” and put in the following code:

打开“ _expenseForm.cshtml文件”,然后输入以下代码:

@model ExpenseManager.Models.ExpenseReport<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/css/bootstrap-datepicker.css" rel="stylesheet"><div><div class="row"><div class="col-md-8"><form id="expenseForm"><input type="hidden" asp-for="ItemId" /><div class="form-group"><label asp-for="ItemName" class="control-label"></label><input asp-for="ItemName" class="form-control" /></div><div class="form-group"><label asp-for="Category" class="control-label"></label><select asp-for="Category" class="form-control"><option value="">-- Select Category --</option><option value="Food">Food</option><option value="Shopping">Shopping</option><option value="Travel">Travel</option><option value="Health">Health</option></select></div><div class="form-group"><label asp-for="Amount" class="control-label"></label><input asp-for="Amount" class="form-control" /></div><div class="form-group" id="calender-container"><label asp-for="ExpenseDate" class="control-label"></label><div class="input-group date"><input asp-for="ExpenseDate" type="text" class="form-control"><span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span></div></div><div class="form-group"><button type="button" id="btnSubmit" class="btn btn-block btn-info">Save</button></div></form></div></div>
</div>

At the top, we are including the cdn reference to the bootstrap-datepicker so that we can use it in our modal dialog. Then we have a <form> element, which binds to our model. We also have a submit button which will post the form data to the Create method in our controller using an ajax call.

在顶部,我们包括对bootstrap- cdn引用,以便我们可以在模态对话框中使用它。 然后,我们有一个<fo rm>元素,该元素绑定到我们的模型。 我们还ave a提交按钮,它将使用ajax调用将表单数据发布到控制器中o the Create方法中。

ExpenseReport视图 (ExpenseReport view)

This is a partial view that is displayed in the modal dialog on clicking the “Expense Report” button in the “Index” view.

单击“索引”视图中的“费用报告”按钮时,这是显示在模式对话框中的局部视图。

Create a new partial view “_expenseReport.cshtml” and put in the following code:

创建一个新的局部视图“ _expenseReport.cshtml”,并输入以下代码:

<script src="https://code.highcharts.com/highcharts.js"></script><button id="btnMonthlyReport" class="btn btn-info">Monthly Report</button>
<button id="btnWeeklyReport" class="btn btn-warning">Weekly Report</button>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div><script>$(document).ready(function () {$("#btnWeeklyReport").click(function () {var titleMessage = "Expenses in last four weeks is : ";$.ajax({type: "GET",url: "/Expense/GetWeeklyExpense",contentType: "application/json",dataType: "json",success: function (result) {var keys = Object.keys(result);var weeklydata = new Array();var totalspent = 0.0;for (var i = 0; i < keys.length; i++) {var arrL = new Array();arrL.push(keys[i]);arrL.push(result[keys[i]]);totalspent += result[keys[i]];weeklydata.push(arrL);}createCharts(weeklydata, titleMessage, totalspent.toFixed(2));}})})$("#btnMonthlyReport").click(function () {var titleMessage = "Expenses in last six months is : ";$.ajax({type: "GET",url: "/Expense/GetMonthlyExpense",contentType: "application/json",dataType: "json",success: function (result) {var keys = Object.keys(result);var monthlydata = new Array();var totalspent = 0.0;for (var i = 0; i < keys.length; i++) {var arrL = new Array();arrL.push(keys[i]);arrL.push(result[keys[i]]);totalspent += result[keys[i]];monthlydata.push(arrL);}createCharts(monthlydata, titleMessage, totalspent.toFixed(2));}})})})function createCharts(sum, titleText, totalspent) {Highcharts.chart('container', {chart: {type: 'column'},title: {text: titleText + ' ' + totalspent},xAxis: {type: 'category',labels: {rotation: -45,style: {fontSize: '13px',fontFamily: 'Verdana, sans-serif'}}},yAxis: {min: 0,title: {text: 'Money spent'}},legend: {enabled: false},tooltip: {pointFormat: 'Total money spent: <b>{point.y:.2f} </b>'},series: [{type: 'column',data: sum,}]});}</script>

At the top, we included the cdn reference to Highcharts. We have also provided two buttons. One is used to view a monthly report of the last six months. The other is to view a weekly report for the last four weeks. The report will be generated as a bar chart to provide a comparative study of expense summaries.

在顶部,我们包括对Highcharts的cdn引用。 我们还提供了两个按钮。 一个用于查看最近六个月的月度报告。 另一种是查看过去四个星期的每周报告。 该报告将以条形图的形式生成,以提供费用摘要的比较研究。

On clicking the weekly report button, we will invoke the GetWeeklyExpense method of our controller. This will return the data in JSON format. We will pass this data to the createCharts function to create the weekly expense bar chart using Highcharts.

单击每周报告按钮时,我们将调用控制器的GetWeeklyExpense方法。 这将以JSON格式返回数据。 我们会将这些数据传递给createCharts函数,以使用Highcharts创建每周费用条形图。

Similarly, we will invoke the GetMonthlyExpense method of our controller on clicking the “Monthly Report” button. The JSON result will be passed to the createCharts function to create the monthly expense bar chart using Highcharts.

同样,我们将在单击“每月报告”按钮时调用控制器的GetMonthlyExpense方法。 JSON结果将传递到createCharts函数,以使用Highcharts创建月度支出条形图。

配置路由URL (Configure route URL)

Open the “Startup.cs” file to set the format for app routes. Scroll down to the app.UseMvc method where you can set the route URL.

打开“ Startup.cs”文件以设置应用程序路由的格式。 向下滚动到app.UseMvc方法,您可以在其中设置路由URL。

Make sure that your route URL is set like this:

确保您的路线网址设置如下:

app.UseMvc(routes =>
{routes.MapRoute(name: "default",template: "{controller=Expense}/{action=Index}");
});

This URL pattern sets ExpenseController as the default controller and the Index method as the default action method. Default route parameters need not be present in the URL path for a match.

此URL模式将ExpenseController设置为默认控制器,并将Index方法设置为默认操作方法。 默认路由参数不需要在URL路径中进行匹配。

If we do not append any controller name in the URL, then it will take ExpenseController as the default controller and the Index method of ExpenseController as default action method.

如果我们在U​​RL中未添加任何控制器名称,则它将ExpenseController作为默认控制器,而ExpenseControllerIndex方法作为默认操作方法。

Similarly, if we append only /Expense to the URL, it will navigate to the Index action method of the Expense controller.

同样,如果仅将/Expense附加到URL,它将导航到Expense控制器的Index操作方法。

执行演示 (Execution demo)

Press F5 to launch the application. You can see a page similar to the one shown below:

按F5启动应用程序。 您会看到类似于以下内容的页面:

Here we have an “Add Expense” button to add a new expense report. The “Expense Report” button will open a dialog box to show the bar chart of monthly and weekly expense data. On the top right corner, we have a search box to search the records using item name.

在这里,我们有一个“添加费用”按钮来添加新的费用报告。 “费用报告”按钮将打开一个对话框,以显示每月和每周费用数据的条形图。 在右上角,我们有一个搜索框,用于使用项目名称搜索记录。

Look at the below GIF image for the demo of application:

在下面的GIF图片中查看应用程序演示:

结论 (Conclusion)

We created a personal expense manager application using ASP.NET Core and Entity Framework Core with the help of Visual Studio 2017 and SQL Server 2017. We have also used Highcharts to create a bar chart for monthly and weekly expense summary.

我们在Visual Studio 2017和SQL Server 2017的帮助下,使用ASP.NET Core和Entity Framework Core创建了个人费用管理器应用程序。我们还使用Highcharts创建了每月和每周费用汇总的条形图。

Please download the source code from GitHub and play around to get a better understanding.

请从GitHub下载源代码,然后试玩以获得更好的理解。

You can read my other articles on ASP .NET Core here.

您可以在此处阅读有关ASP.NET Core的其他文章。

Are you preparing for interviews? Read my article on C# Coding Questions For Technical Interviews.

您准备面试吗? 阅读有关技术面试的C#编码问题的文章。

其他有用的资源 (Other useful resources)

  • CRUD Operation With ASP.NET Core MVC Using Visual Studio Code and EF

    使用Visual Studio Code和EF使用ASP.NET Core MVC进行CRUD操作

  • ASP.NET Core — CRUD With React.js And Entity Framework Core

    ASP.NET Core —使用React.js和实体框架Core的CRUD

  • ASP.NET Core — CRUD Using Angular 5 And Entity Framework Core

    ASP.NET Core —使用Angular 5和实体框架Core的CRUD

  • CRUD Operation With ASP.NET Core MVC Using ADO.NET and Visual Studio 2017

    使用ADO.NET和Visual Studio 2017的ASP.NET Core MVC进行CRUD操作

  • CRUD Operation With ASP.NET Core MVC using Visual Studio Code and ADO.NET

    使用Visual Studio Code和ADO.NET的ASP.NET Core MVC进行CRUD操作

  • ASP.NET Core — Using Highcharts With Angular 5

    ASP.NET Core —在Angular 5中使用Highcharts

Originally published at https://ankitsharmablogs.com/

最初发布在https://ankitsharmablogs.com/

翻译自: https://www.freecodecamp.org/news/how-to-create-an-expense-manager-using-entity-framework-core-and-highcharts-32f3b1ad0dbc/

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 你们这些阿猫

    缘起 考完 Final 又是一个 Spring Break&#xff0c;10 天很无聊啊&#xff0c;人一无聊就想写代码&#xff0c;但是前面写守望 UI CSS 的时候写伤了&#xff0c;而且 Spring Break 就 10 天&#xff0c;实在不想写一个大项目。 有一天听到了古巨基的《爱与诚》里面唱的&#x…...

    2024/5/3 9:50:02
  2. React+Redux打造“NEWS EARLY”单页应用 一步步让你理解最前沿技术栈的真谛

    之前写过一篇文章&#xff0c;分享了我利用闲暇时间&#xff0c;使用ReactRedux技术栈重构的百度某产品个人中心页面。您可以参考这里&#xff0c;或者参考Github代码仓库地址。 这个工程实例中&#xff0c;我采用了厂内的工程构建工具&#xff0d;FIS&#xff0c;并贯穿了reac…...

    2024/4/21 12:29:52
  3. React+Redux 打造 “NEWS EARLY” 单页应用 一个项目理解最前沿技术栈真谛

    之前写过一篇文章&#xff0c;分享了我利用闲暇时间&#xff0c;使用ReactRedux技术栈重构的百度某产品个人中心页面。您可以参考这里&#xff0c;或者参考Github代码仓库地址。这个工程实例中&#xff0c;我采用了厂内的工程构建工具&#xff0d;FIS3&#xff0c;并贯穿了reac…...

    2024/5/6 22:05:23
  4. 基于SSM框架大型分布式电商系统开发(13-14)

    前言 消息中间件解决方案JMSSpringBoot框架与短信解决方案 因为是根据大佬的项目点滴做起&#xff0c;如果看到此博客侵犯利益&#xff0c;请告知立即删除。 第13章 消息中间件解决方案JMS 1.JMS入门 1.1 消息中间件 1.1.1 品优购系统模块调用关系分析 我们已经完成了5个w…...

    2024/4/21 12:29:50
  5. 双眼皮恢复慢体质

    ...

    2024/5/2 6:06:27
  6. 埋线双眼皮11豪

    ...

    2024/4/21 12:29:48
  7. 一、Webstrom+React+Ant Design+echarts搭建react项目

    前言 一、React是Facebook推出的一个前端框架&#xff0c;之前被用于著名的社交媒体Instagram中&#xff0c;后来由于取得了不错的反响&#xff0c;于是Facebook决定将其开源。出身名门的React也不负众望&#xff0c;成功成为当前最火热的三大前端框架之一。相比于Angular&…...

    2024/4/21 12:29:47
  8. 使用 Vue + ElementUI + Webpack + VueRouter 做后台管理、RESTful 交互

    一、前言 1、前端三大 JS 框架 Vue、React、Angular 都用了一段时间了&#xff0c;最后还是回归于 Vue JSdemoVue[增删改查] 使用 Vue2.x LayUI 做后台管理 CRUD 界面和 REST 交互React [增删改查] 使用 React LayUI 做后台管理 CRUD 界面和 RESTful 交互Angular 使用 Angul…...

    2024/4/21 12:29:47
  9. 双眼皮线细

    ...

    2024/5/6 6:02:15
  10. 眼皮松弛凹陷可以做眼皮松弛适合什么眼皮松弛做全切双眼皮有用吗

    ...

    2024/4/21 12:29:45
  11. 双眼皮修复一个月后可以吗

    ...

    2024/4/20 16:25:32
  12. 双眼皮二十天可以洗头吗

    ...

    2024/5/2 17:28:17
  13. 双眼皮20天可以洗头吗

    ...

    2024/4/20 16:25:31
  14. 割双眼皮人家说我眼睛脂肪多

    ...

    2024/5/2 7:39:22
  15. 1个月内2次双眼皮7天注意事项

    ...

    2024/4/21 12:29:43
  16. 2016 年谷歌开源了超酷炫的项目

    开放源代码软件让 Google 能够无需重新发明轮子就能够快速有效地进行开发&#xff0c;也让我们能够集中注意力来解决新问题。我们知道&#xff0c;支持开源&#xff0c;就是站在了巨人的肩膀上&#xff0c;所以 Google 员工能够轻松地将他们在内部工作的项目作为开放源代码发布…...

    2024/4/21 12:29:42
  17. 直接拿来用!最火前端开源项目(二)

    摘要&#xff1a;如今开源项目的火热程度已无需再多言语&#xff0c;在&#xff08;一&#xff09;中为开发者整理了九大类的开源项目列表&#xff0c;开发者们&#xff0c;你们用的怎么样了&#xff1f;本文继续整理GitHub上最火的前端开源项目列表&#xff0c;列出十个分类&a…...

    2024/4/21 12:29:41
  18. GitHub 上那些值得你 Star 的开源项目

    “开源”作为 2018 年度热词之一&#xff0c;在这一年里围绕其发生了颇多“大事”&#xff0c;开源贡献者也语法活跃。本文分领域盘点了过去一年的开源项目 Top 榜&#xff0c;看看有没有你也在持续关注的优质内容&#xff1f; 如今&#xff0c;开源已成为软件世界的中坚力量—…...

    2024/4/21 12:29:41
  19. Github优秀开源项目整理

    目前开源社区Github涌现出不少优秀的项目&#xff0c;关注和使用这些项目&#xff0c;一方面可以很好的提升开发效率与质量&#xff0c;另一方面研究开源项目的源码&#xff0c;参与其贡献&#xff0c;也是提升技术能力一个不错的方法。 基于自己团队的需求&#xff0c;以后每周…...

    2024/4/21 12:29:39
  20. 眼综合和埋线双眼皮的区别

    ...

    2024/5/6 5:30:17

最新文章

  1. Android 状态栏WiFi图标的显示逻辑

    1. 状态栏信号图标 1.1 WIFI信号显示 WIFI信号在状态栏的显示如下图所示 当WiFi状态为关闭时&#xff0c;状态栏不会有任何显示。当WiFi状态打开时&#xff0c;会如上图所示&#xff0c;左侧表示有可用WiFi&#xff0c;右侧表示当前WiFi打开但未连接。 当WiFi状态连接时&#x…...

    2024/5/6 22:32:59
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/5/6 9:38:23
  3. JRT高效率开发

    得益于前期的基础投入&#xff0c;借助代码生成的加持&#xff0c;本来计划用一周实现质控物维护界面&#xff0c;实际用来四小时左右完成质控物维护主体&#xff0c;效率大大超过预期。 JRT从设计之初就是为了证明Spring打包模式不适合软件服务模式&#xff0c;觉得Spring打包…...

    2024/5/5 21:03:09
  4. 《前端防坑》- JS基础 - 你觉得typeof nullValue === null 么?

    问题 JS原始类型有6种Undefined, Null, Number, String, Boolean, Symbol共6种。 在对原始类型使用typeof进行判断时, typeof stringValue string typeof numberValue number 如果一个变量(nullValue)的值为null&#xff0c;那么typeof nullValue "?" const u …...

    2024/5/5 21:03:10
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/4 23:54:56
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/4 23:54:56
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/6 9:21:00
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/4 23:55:16
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/4 23:55:17
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/4 23:55:06
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/4 23:55:06
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/4 23:55:16
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/6 21:42:42
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/4 23:54:56
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57