...
This commit is contained in:
@@ -14,9 +14,14 @@ namespace Back.Controllers
|
|||||||
{
|
{
|
||||||
_sBase = sBase;
|
_sBase = sBase;
|
||||||
}
|
}
|
||||||
[HttpGet("BasePrice")]
|
[HttpGet("Pricing")]
|
||||||
public async Task<ActionResult<List<BasePriceDto>>> GetBasePrice()
|
public async Task<ActionResult<List<BasePriceDto>>> Pricing()
|
||||||
=> Ok(await _sBase.GetBasePrice());
|
=> Ok(await _sBase.GetBasePrice());
|
||||||
|
[HttpGet("DateTimeServer")]
|
||||||
|
public async Task<ActionResult<DateTime>> DateTimeServer()
|
||||||
|
=> Ok(DateTime.Now);
|
||||||
|
[HttpGet("LastBlog/{Count}")]
|
||||||
|
public async Task<ActionResult<List<BlogDto>>> LastBlog(int Count)
|
||||||
|
=> Ok(await _sBase.GetBlog(Count));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
public int ID { get; set; }
|
public int ID { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string Text { get; set; }
|
public string Text { get; set; }
|
||||||
public byte[]? Photo { get; set; }
|
public string? Photo { get; set; }
|
||||||
public string Date { get; set; }
|
public string Date { get; set; }
|
||||||
public string Time { get; set; }
|
public string Time { get; set; }
|
||||||
public bool Status { get; set; }
|
public bool Status { get; set; }
|
||||||
|
@@ -24,7 +24,7 @@ builder.Services.AddCors(options =>
|
|||||||
options.AddPolicy(origins,
|
options.AddPolicy(origins,
|
||||||
policy =>
|
policy =>
|
||||||
{
|
{
|
||||||
policy.WithOrigins("http://localhost:5107")
|
policy.WithOrigins("https://localhost:7224")
|
||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.AllowAnyMethod();
|
.AllowAnyMethod();
|
||||||
});
|
});
|
||||||
|
@@ -8,20 +8,34 @@ namespace Back.Services
|
|||||||
public class ServBase
|
public class ServBase
|
||||||
{
|
{
|
||||||
private readonly IAsyncRepository<Pricing> _repoPricing;
|
private readonly IAsyncRepository<Pricing> _repoPricing;
|
||||||
public ServBase(IAsyncRepository<Pricing> repoPricing)
|
private readonly IAsyncRepository<Blog> _repoBlog;
|
||||||
|
public ServBase(IAsyncRepository<Pricing> repoPricing, IAsyncRepository<Blog> repoBlog)
|
||||||
{
|
{
|
||||||
_repoPricing = repoPricing;
|
_repoPricing = repoPricing;
|
||||||
|
_repoBlog = repoBlog;
|
||||||
}
|
}
|
||||||
public async Task<List<BasePriceDto>> GetBasePrice()
|
public async Task<List<BasePriceDto>> GetBasePrice()
|
||||||
{
|
{
|
||||||
return await _repoPricing.GetAll().Select(x => new BasePriceDto
|
return await _repoPricing.GetAll().Select(x => new BasePriceDto
|
||||||
{
|
{
|
||||||
Price = x.Price,
|
Price = x.Price,
|
||||||
CalculationType = x.CalculationTypeID==1 ? "واحدی"
|
CalculationType = x.CalculationTypeID == 1 && x.PermissionID == 16 ? "هر ارسال"
|
||||||
: x.CalculationTypeID == 1 && x.PermissionID==16 ? "هر ارسال"
|
:x.CalculationTypeID== 1 && x.PermissionID != 16 ? "واحدی"
|
||||||
: x.CalculationTypeID == 2 ? "نامحدود" : "روزانه",
|
: x.CalculationTypeID == 2 ? "نامحدود" : "روزانه",
|
||||||
PermissionID=x.PermissionID,
|
PermissionID=x.PermissionID,
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
}
|
}
|
||||||
|
public async Task<List<BlogDto>> GetBlog(int count)
|
||||||
|
{
|
||||||
|
return await _repoBlog.Get(w=>w.Status).OrderByDescending(o=>o.ID).Take(count)
|
||||||
|
.Select(s=>new BlogDto
|
||||||
|
{
|
||||||
|
Title = s.Title,
|
||||||
|
Date=s.Date,
|
||||||
|
ID=s.ID,
|
||||||
|
Photo=string.IsNullOrEmpty(s.Photo) ? "blog-grid-1.jpg" : s.Photo
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
25
Shared/DTOs/BlogDto.cs
Normal file
25
Shared/DTOs/BlogDto.cs
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Shared.DTOs
|
||||||
|
{
|
||||||
|
public class BlogDto
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string? Photo { get; set; }
|
||||||
|
public string Date { get; set; }
|
||||||
|
}
|
||||||
|
public class BlogDtoFull
|
||||||
|
{
|
||||||
|
public int ID { get; set; }
|
||||||
|
public string Title { get; set; }
|
||||||
|
public string Text { get; set; }
|
||||||
|
public string? Photo { get; set; }
|
||||||
|
public string Date { get; set; }
|
||||||
|
public string Time { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@@ -5,9 +5,9 @@ VisualStudioVersion = 17.9.34723.18
|
|||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Front", "TaxPayerFull\Front.csproj", "{0D25B253-4DAC-4D94-9BAD-C1E02F35F58B}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Front", "TaxPayerFull\Front.csproj", "{0D25B253-4DAC-4D94-9BAD-C1E02F35F58B}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Back", "Back\Back.csproj", "{94DE9132-9D4E-468B-9BC4-134957BF48FE}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Back", "Back\Back.csproj", "{94DE9132-9D4E-468B-9BC4-134957BF48FE}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{07963EE9-ADA6-4A30-890B-6643BA332D3A}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Shared", "Shared\Shared.csproj", "{07963EE9-ADA6-4A30-890B-6643BA332D3A}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
<div class="tp-project__area grey-bg pt-50 pb-50 fix" id="blog">
|
@using Shared.DTOs
|
||||||
|
@inject HttpClient _hc
|
||||||
|
<div class="tp-project__area grey-bg pt-50 pb-50 fix" id="blog">
|
||||||
<div class="blog-grid-inner mb-10">
|
<div class="blog-grid-inner mb-10">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -9,96 +11,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xl-4 col-lg-6 col-md-6 mb-30">
|
@foreach (var item in items)
|
||||||
<div class="tp-blog-item">
|
{
|
||||||
<div class="tp-blog-thumb fix">
|
<ItemBlog Item="item" />
|
||||||
<a href="blog-details.html"><img src="img/blog/blog-grid-1.jpg" alt=""></a>
|
}
|
||||||
</div>
|
|
||||||
<div class="tp-blog-content">
|
|
||||||
<div class="tp-blog-meta d-flex align-items-center">
|
|
||||||
<div class="tp-blog-category category-color-1">
|
|
||||||
<span>نرم افزار مدیریت</span>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-date">
|
|
||||||
<span>28 آذر, 1402</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-title-box">
|
|
||||||
<a class="tp-blog-title-sm" href="blog-details.html">سال حرفه ای 2023 در حال بررسی</a>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-author-info-box d-flex align-items-center">
|
|
||||||
<div class="tp-blog-avata">
|
|
||||||
<img src="img/avata/avata-1.png" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-author-info">
|
|
||||||
<h5>محمد محمدی</h5>
|
|
||||||
<span>مدیر سایت</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xl-4 col-lg-6 col-md-6 mb-30">
|
|
||||||
<div class="tp-blog-item">
|
|
||||||
<div class="tp-blog-thumb fix">
|
|
||||||
<a href="blog-details.html"><img src="img/blog/blog-grid-2.jpg" alt=""></a>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-content">
|
|
||||||
<div class="tp-blog-meta d-flex align-items-center">
|
|
||||||
<div class="tp-blog-category category-color-1">
|
|
||||||
<span>نرم افزار مدیریت</span>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-date">
|
|
||||||
<span>28 آذر, 1402</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-title-box">
|
|
||||||
<a class="tp-blog-title-sm" href="blog-details.html">بهترین استفاده از بازخورد</a>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-author-info-box d-flex align-items-center">
|
|
||||||
<div class="tp-blog-avata">
|
|
||||||
<img src="img/avata/avata-2.png" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-author-info">
|
|
||||||
<h5>محمد محمدی</h5>
|
|
||||||
<span>مدیر سایت</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xl-4 col-lg-6 col-md-6 mb-30">
|
|
||||||
<div class="tp-blog-item">
|
|
||||||
<div class="tp-blog-thumb fix">
|
|
||||||
<a href="#"><img src="img/blog/blog-grid-3.jpg" alt=""></a>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-content">
|
|
||||||
<div class="tp-blog-meta d-flex align-items-center">
|
|
||||||
<div class="tp-blog-category category-color-1">
|
|
||||||
<span>نرم افزار مدیریت=</span>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-date">
|
|
||||||
<span>28 آذر, 1402</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-title-box">
|
|
||||||
<a class="tp-blog-title-sm" href="blog-details.html">
|
|
||||||
مدیریت پروژه در <br> در دسترس
|
|
||||||
شماست.
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-author-info-box d-flex align-items-center">
|
|
||||||
<div class="tp-blog-avata">
|
|
||||||
<img src="img/avata/avata-3.png" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="tp-blog-author-info">
|
|
||||||
<h5>محمد محمدی</h5>
|
|
||||||
<span>مدیر سایت</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<a href="">ادامه...</a>
|
<a href="">ادامه...</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,5 +23,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
List<BlogDto> items = new List<BlogDto>();
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
items = await _hc.GetFromJsonAsync<List<BlogDto>>("Base/LastBlog/3");
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
36
TaxPayerFull/Layout/ItemBlog.razor
Normal file
36
TaxPayerFull/Layout/ItemBlog.razor
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
@using Shared.DTOs
|
||||||
|
|
||||||
|
<div class="col-xl-4 col-lg-6 col-md-6 mb-30">
|
||||||
|
<div class="tp-blog-item">
|
||||||
|
<div class="tp-blog-thumb fix">
|
||||||
|
<a href="blog-details.html"><img src="img/blog/@Item.Photo" alt=""></a>
|
||||||
|
</div>
|
||||||
|
<div class="tp-blog-content">
|
||||||
|
<div class="tp-blog-meta d-flex align-items-center">
|
||||||
|
<div class="tp-blog-category category-color-1">
|
||||||
|
<span>@Item.Title.Split(':')[0]</span>
|
||||||
|
</div>
|
||||||
|
<div class="tp-blog-date">
|
||||||
|
<span>@Item.Date</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tp-blog-title-box">
|
||||||
|
<a class="tp-blog-title-sm" href="blog-details.html">@Item.Title.Split(':')[1]</a>
|
||||||
|
</div>
|
||||||
|
<div class="tp-blog-author-info-box d-flex align-items-center">
|
||||||
|
<div class="tp-blog-avata">
|
||||||
|
<img src="img/avata/avata-1.png" alt="">
|
||||||
|
</div>
|
||||||
|
<div class="tp-blog-author-info">
|
||||||
|
<h5>مهدی ربیع نژاد</h5>
|
||||||
|
<span>مدیر سایت</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public BlogDto? Item { get; set; }
|
||||||
|
}
|
@@ -1,4 +1,5 @@
|
|||||||
@using System.Globalization
|
@using System.Globalization
|
||||||
|
@inject HttpClient _hc
|
||||||
<!-- header top area -->
|
<!-- header top area -->
|
||||||
<div class="header-top__area header-top__space z-index-3 d-none d-md-block tp-header-top-animation">
|
<div class="header-top__area header-top__space z-index-3 d-none d-md-block tp-header-top-animation">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@@ -21,18 +22,24 @@
|
|||||||
<!-- header bottom -->
|
<!-- header bottom -->
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
DateTime dtserver = DateTime.Now;
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
dtserver = await _hc.GetFromJsonAsync<DateTime>("Base/DateTimeServer");
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@functions{
|
@functions{
|
||||||
public static string GetTodyPersianDatetime()
|
public string GetTodyPersianDatetime()
|
||||||
{
|
{
|
||||||
|
|
||||||
PersianCalendar pcDate = new PersianCalendar();
|
PersianCalendar pcDate = new PersianCalendar();
|
||||||
int persianYear = pcDate.GetYear(DateTime.Now);
|
int persianYear = pcDate.GetYear(dtserver);
|
||||||
int persianMonth = pcDate.GetMonth(DateTime.Now);
|
int persianMonth = pcDate.GetMonth(dtserver);
|
||||||
int persianDay = pcDate.GetDayOfMonth(DateTime.Now);
|
int persianDay = pcDate.GetDayOfMonth(dtserver);
|
||||||
|
|
||||||
string _DayOfWeek = "";
|
string _DayOfWeek = "";
|
||||||
switch (DateTime.Now.DayOfWeek)
|
switch (dtserver.DayOfWeek)
|
||||||
{
|
{
|
||||||
case DayOfWeek.Saturday:
|
case DayOfWeek.Saturday:
|
||||||
_DayOfWeek = " شنبه ";
|
_DayOfWeek = " شنبه ";
|
||||||
|
@@ -99,7 +99,7 @@
|
|||||||
List<BasePriceDto> Models = new List<BasePriceDto>();
|
List<BasePriceDto> Models = new List<BasePriceDto>();
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
Models = await _hc.GetFromJsonAsync<List<BasePriceDto>>("Base/BasePrice");
|
Models = await _hc.GetFromJsonAsync<List<BasePriceDto>>("Base/Pricing");
|
||||||
await base.OnParametersSetAsync();
|
await base.OnParametersSetAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,8 +7,9 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|||||||
builder.RootComponents.Add<App>("#app");
|
builder.RootComponents.Add<App>("#app");
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||||
|
|
||||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
|
||||||
|
|
||||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
||||||
|
|
||||||
await builder.Build().RunAsync();
|
await builder.Build().RunAsync();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user