Skip to content

Commit 89cd3d2

Browse files
committed
update 2020.03.31
1 parent f10972e commit 89cd3d2

File tree

1,069 files changed

+343974
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,069 files changed

+343974
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
6+
<TypeScriptToolsVersion>3.1</TypeScriptToolsVersion>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Compile Remove="Pages\NewFolder\**" />
11+
<Content Remove="Pages\NewFolder\**" />
12+
<EmbeddedResource Remove="Pages\NewFolder\**" />
13+
<None Remove="Pages\NewFolder\**" />
14+
</ItemGroup>
15+
16+
17+
<ItemGroup>
18+
<PackageReference Include="Microsoft.AspNetCore.App" />
19+
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.1" PrivateAssets="All" />
20+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.9" />
21+
</ItemGroup>
22+
23+
24+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
25+
<TypeScriptTarget>ES5</TypeScriptTarget>
26+
<TypeScriptJSXEmit>None</TypeScriptJSXEmit>
27+
<TypeScriptModuleKind />
28+
<TypeScriptCompileOnSaveEnabled>False</TypeScriptCompileOnSaveEnabled>
29+
<TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
30+
<TypeScriptRemoveComments>False</TypeScriptRemoveComments>
31+
<TypeScriptOutFile />
32+
<TypeScriptOutDir />
33+
<TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
34+
<TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
35+
<TypeScriptSourceMap>True</TypeScriptSourceMap>
36+
<TypeScriptMapRoot />
37+
<TypeScriptSourceRoot />
38+
</PropertyGroup>
39+
40+
41+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
42+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
43+
<WarningsAsErrors />
44+
</PropertyGroup>
45+
46+
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<_SelectedScaffolderID>Microsoft.AspNet.Scaffolding.Mvc.RazorPages.ModelBasedRazorPageScaffolder</_SelectedScaffolderID>
5+
<_SelectedScaffolderCategoryPath>root/Common/RazorPage</_SelectedScaffolderCategoryPath>
6+
<WebStackScaffolding_ViewDialogWidth>600</WebStackScaffolding_ViewDialogWidth>
7+
<WebStackScaffolding_IsLayoutPageSelected>False</WebStackScaffolding_IsLayoutPageSelected>
8+
<WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
9+
<WebStackScaffolding_IsReferencingScriptLibrariesSelected>True</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
10+
<ActiveDebugProfile>Appeon.MvcModelMapperDemo</ActiveDebugProfile>
11+
<RazorPage_SelectedScaffolderID>Microsoft.AspNet.Scaffolding.Mvc.RazorPageScaffolder</RazorPage_SelectedScaffolderID>
12+
<RazorPage_SelectedScaffolderCategoryPath>root/Common/RazorPage</RazorPage_SelectedScaffolderCategoryPath>
13+
<WebStackScaffolding_DbContextDialogWidth>600</WebStackScaffolding_DbContextDialogWidth>
14+
<NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
15+
</PropertyGroup>
16+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
17+
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
18+
</PropertyGroup>
19+
</Project>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
using Appeon.SnapObjectsDemo.Service.Models;
2+
using Microsoft.AspNetCore.Mvc;
3+
using Microsoft.AspNetCore.Mvc.RazorPages;
4+
using System;
5+
using System.Collections.Generic;
6+
7+
namespace Appeon.MvcModelMapperDemo.Models
8+
{
9+
public class BasePageModel: PageModel
10+
{
11+
/// <summary>
12+
/// Return to the unified json format
13+
/// </summary>
14+
/// <param name="code"></param>
15+
/// <param name="message"></param>
16+
/// <param name="id"></param>
17+
/// <returns></returns>
18+
protected JsonResult GenJsonResult(int code,String message,int? id)
19+
{
20+
var result = new Dictionary<string, object>()
21+
{
22+
{ "code", code},
23+
{ "message",message},
24+
{ "id",id}
25+
};
26+
27+
return new JsonResult(result);
28+
}
29+
/// <summary>
30+
/// convert date format
31+
/// </summary>
32+
/// <param name="SalesOrder"></param>
33+
protected void ConvertData(SalesOrder SalesOrder)
34+
{
35+
String orderDate = this.Request.Form["SalesOrder.OrderDate"];
36+
String dueDate = this.Request.Form["SalesOrder.DueDate"];
37+
String shipDate = this.Request.Form["SalesOrder.ShipDate"];
38+
39+
if (!String.IsNullOrEmpty(orderDate) && SalesOrder.OrderDate == null)
40+
{
41+
try
42+
{
43+
DateTime dt;
44+
DateTime.TryParseExact(orderDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dt);
45+
SalesOrder.OrderDate = dt;
46+
}
47+
catch (Exception)
48+
{
49+
}
50+
}
51+
if (!String.IsNullOrEmpty(dueDate) && SalesOrder.DueDate == null)
52+
{
53+
try
54+
{
55+
SalesOrder.DueDate = DateTime.ParseExact(dueDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None);
56+
}
57+
catch (Exception)
58+
{
59+
60+
}
61+
}
62+
if (!String.IsNullOrEmpty(shipDate) && SalesOrder.ShipDate == null)
63+
{
64+
try
65+
{
66+
SalesOrder.ShipDate = DateTime.ParseExact(shipDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None);
67+
}
68+
catch (Exception)
69+
{
70+
71+
}
72+
}
73+
}
74+
}
75+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Collections;
2+
3+
namespace Appeon.MvcModelMapperDemo.Models
4+
{
5+
public class DataTable
6+
{
7+
/// <summary>
8+
/// request flag
9+
/// </summary>
10+
public int draw { get; set; }
11+
12+
/// <summary>
13+
/// The total records
14+
/// </summary>
15+
public int recordsTotal { get; set; }
16+
17+
/// <summary>
18+
/// The records of filter
19+
/// </summary>
20+
public int recordsFiltered { get; set; }
21+
22+
/// <summary>
23+
/// The index of page
24+
/// </summary>
25+
public int pageIndex { get; set; }
26+
27+
/// <summary>
28+
/// The size per page
29+
/// </summary>
30+
public int? pageSize { get; set; }
31+
32+
/// <summary>
33+
/// The data per page
34+
/// </summary>
35+
public IList data { get; set; }
36+
}
37+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@page
2+
@model ErrorModel
3+
@{
4+
ViewData["Title"] = "Error";
5+
}
6+
7+
<h1 class="text-danger">Error.</h1>
8+
<h2 class="text-danger">An error occurred while processing your request.</h2>
9+
10+
@if (Model.ShowRequestId)
11+
{
12+
<p>
13+
<strong>Request ID:</strong> <code>@Model.RequestId</code>
14+
</p>
15+
}
16+
17+
<h3>Development Mode</h3>
18+
<p>
19+
Swapping to the <strong>Development</strong> environment displays detailed information about the error that occurred.
20+
</p>
21+
<p>
22+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
23+
It can result in displaying sensitive information from exceptions to end users.
24+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
25+
and restarting the app.
26+
</p>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore.Mvc;
7+
using Microsoft.AspNetCore.Mvc.RazorPages;
8+
9+
namespace Appeon.MvcModelMapperDemo.Pages
10+
{
11+
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
12+
public class ErrorModel : PageModel
13+
{
14+
public string RequestId { get; set; }
15+
16+
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
17+
18+
public void OnGet()
19+
{
20+
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)