end verification
This commit is contained in:
@@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Common\DTOs\" />
|
<Folder Include="Common\DTOs\" />
|
||||||
|
<Folder Include="Features\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Service">
|
<Reference Include="Service">
|
||||||
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
|
<HintPath>..\..\Dlls\Service.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@@ -36,6 +36,16 @@ namespace Back.Controllers
|
|||||||
val= _getVerificationValidation.verificationCode.val
|
val= _getVerificationValidation.verificationCode.val
|
||||||
});;
|
});;
|
||||||
}
|
}
|
||||||
|
[HttpGet("ReSend/{ID}")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<ActionResult> ReSend(int ID)
|
||||||
|
{
|
||||||
|
var resultValidationmodel = await _getVerificationValidation.ValidateAsync(ID);
|
||||||
|
if (!resultValidationmodel.IsValid)
|
||||||
|
return BadRequest(resultValidationmodel.Errors.Select(s => s.ErrorMessage).ToList());
|
||||||
|
// _getVerificationValidation.verificationCode
|
||||||
|
return NoContent();
|
||||||
|
}
|
||||||
[HttpPost("Submit")]
|
[HttpPost("Submit")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<ActionResult<bool>> Submit(VerificationCodeDto item)
|
public async Task<ActionResult<bool>> Submit(VerificationCodeDto item)
|
||||||
@@ -48,13 +58,19 @@ namespace Back.Controllers
|
|||||||
{
|
{
|
||||||
if (VerificationCode.prm == item.prm && VerificationCode.val == item.val && VerificationCode.Type == item.Type)
|
if (VerificationCode.prm == item.prm && VerificationCode.val == item.val && VerificationCode.Type == item.Type)
|
||||||
{
|
{
|
||||||
|
bool Sucstatus = false;
|
||||||
switch (VerificationCode.Type)
|
switch (VerificationCode.Type)
|
||||||
{
|
{
|
||||||
case "NewTicketNoAuthentication":
|
case "NewTicketNoAuthentication":
|
||||||
return Ok(_servValidatinMsg.SubmittedTicket(VerificationCode));
|
Sucstatus = await _servValidatinMsg.SubmittedTicket(VerificationCode);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return BadRequest("این نوع احراز تعریف نشده");
|
return BadRequest("این نوع احراز تعریف نشده");
|
||||||
}
|
}
|
||||||
|
if (Sucstatus)
|
||||||
|
await _servValidatinMsg.Delete(VerificationCode);
|
||||||
|
|
||||||
|
return Ok(Sucstatus);
|
||||||
}
|
}
|
||||||
else return BadRequest("اطلاعات شما منطبق با سامانه نیست");
|
else return BadRequest("اطلاعات شما منطبق با سامانه نیست");
|
||||||
|
|
||||||
@@ -62,5 +78,13 @@ namespace Back.Controllers
|
|||||||
else return BadRequest("کد احراز صحیح نمی باشد");
|
else return BadRequest("کد احراز صحیح نمی باشد");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
[HttpDelete("Remove/{ID}")]
|
||||||
|
[AllowAnonymous]
|
||||||
|
public async Task<ActionResult<bool>> Remove(int ID)
|
||||||
|
{
|
||||||
|
var VerificationCode = await _servValidatinMsg.GetVerificationCode(ID);
|
||||||
|
await _servValidatinMsg.Delete(VerificationCode);
|
||||||
|
return NoContent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,10 +23,14 @@ namespace Back.Services
|
|||||||
{
|
{
|
||||||
return await _verificationCodeRepo.Get(w => w.ID == ID).FirstOrDefaultAsync();
|
return await _verificationCodeRepo.Get(w => w.ID == ID).FirstOrDefaultAsync();
|
||||||
}
|
}
|
||||||
|
public async Task<bool> Delete(VerificationCode model)
|
||||||
|
{
|
||||||
|
return await _verificationCodeRepo.DeleteAsync(model);
|
||||||
|
}
|
||||||
public async Task<bool> SubmittedTicket(VerificationCode code)
|
public async Task<bool> SubmittedTicket(VerificationCode code)
|
||||||
{
|
{
|
||||||
var ticket = await _ticket.Get(w => w.ID == Convert.ToInt32(code.prm)).FirstOrDefaultAsync();
|
var ticket = await _ticket.Get(w => w.ID == Convert.ToInt32(code.prm)).FirstOrDefaultAsync();
|
||||||
if (ticket != null)
|
if (ticket != null && ticket.Status== StatusTicket.unknownPerson)
|
||||||
{
|
{
|
||||||
ticket.Status = StatusTicket.Awaitingreview;
|
ticket.Status = StatusTicket.Awaitingreview;
|
||||||
return await _ticket.UpdateAsync(ticket);
|
return await _ticket.UpdateAsync(ticket);
|
||||||
|
@@ -24,6 +24,9 @@ namespace Back.Services
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
var ID= _ticketUnknownPeopleRepo.Get(w=>w.Mobile==Mobile).Select(s=>s.ID).FirstOrDefault();
|
||||||
|
if (ID!=null && ID > 0)
|
||||||
|
return ID;
|
||||||
var item=await _ticketUnknownPeopleRepo.AddAsync(new TiceketUnknownPeople
|
var item=await _ticketUnknownPeopleRepo.AddAsync(new TiceketUnknownPeople
|
||||||
{
|
{
|
||||||
FullName = FullName,
|
FullName = FullName,
|
||||||
|
@@ -29,8 +29,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xl-7 col-lg-6">
|
<div class="col-xl-7 col-lg-6">
|
||||||
<Toasts class="p-3" Messages="messages" AutoHide="true" Delay="6000" Placement="ToastsPlacement.TopRight" />
|
|
||||||
|
|
||||||
<div class="contact-form-right-warp">
|
<div class="contact-form-right-warp">
|
||||||
<div class="postbox__comment-form">
|
<div class="postbox__comment-form">
|
||||||
<EditForm EditContext="editContext" OnValidSubmit="newTicket">
|
<EditForm EditContext="editContext" OnValidSubmit="newTicket">
|
||||||
@@ -73,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</EditForm>
|
</EditForm>
|
||||||
<Button Color="ButtonColor.Primary" @onclick="OnShowModalClick">Show Modal</Button>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -82,25 +80,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Modal @ref="_modal"
|
|
||||||
title="Modal title">
|
|
||||||
|
|
||||||
<BodyTemplate>
|
|
||||||
Modal body text goes here.
|
|
||||||
</BodyTemplate>
|
|
||||||
|
|
||||||
<FooterTemplate>
|
|
||||||
<Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
|
|
||||||
<Button Color="ButtonColor.Primary" @onclick="testhand">Save changes</Button>
|
|
||||||
</FooterTemplate>
|
|
||||||
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
List<ToastMessage> messages = new List<ToastMessage>();
|
|
||||||
|
|
||||||
private Modal _modal = default!;
|
|
||||||
//-------------------------------
|
|
||||||
string type = "NewTicketNoAuthentication";
|
string type = "NewTicketNoAuthentication";
|
||||||
private EditContext? editContext;
|
private EditContext? editContext;
|
||||||
[SupplyParameterFromForm]
|
[SupplyParameterFromForm]
|
||||||
@@ -127,8 +110,7 @@
|
|||||||
{
|
{
|
||||||
messageStore?.Clear();
|
messageStore?.Clear();
|
||||||
var res = await request.Content.ReadFromJsonAsync<int>();
|
var res = await request.Content.ReadFromJsonAsync<int>();
|
||||||
OnShowModalClick();
|
nav.NavigateTo($"Verification/{res}");
|
||||||
// nav.NavigateTo($"Verification/{res}");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -137,28 +119,8 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private async Task testhand()
|
|
||||||
{
|
|
||||||
ShowMessage(ToastType.Warning);
|
|
||||||
}
|
|
||||||
private async Task OnShowModalClick()
|
|
||||||
{
|
|
||||||
await _modal.ShowAsync();
|
|
||||||
}
|
|
||||||
private async Task OnHideModalClick()
|
|
||||||
{
|
|
||||||
await _modal.HideAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ShowMessage(ToastType toastType) => messages.Add(CreateToastMessage(toastType));
|
|
||||||
|
|
||||||
private ToastMessage CreateToastMessage(ToastType toastType)
|
|
||||||
=> new ToastMessage
|
|
||||||
{
|
|
||||||
Type = toastType,
|
|
||||||
Title = "Blazor Bootstrap",
|
|
||||||
HelpText = $"{DateTime.Now}",
|
|
||||||
Message = $"Hello, world! This is a toast message. DateTime: {DateTime.Now}",
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
<div class="signin-banner-from-box">
|
<div class="signin-banner-from-box">
|
||||||
|
|
||||||
@* <EditForm EditContext="editContext" OnValidSubmit="SubmitVerificationCode"> *@
|
|
||||||
|
|
||||||
<EditForm Model="VerificationCodeModel" OnSubmit="SubmitVerificationCode" FormName="VerificationCodeDto">
|
<EditForm Model="VerificationCodeModel" OnSubmit="SubmitVerificationCode" FormName="VerificationCodeDto">
|
||||||
|
|
||||||
@@ -70,7 +69,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="signin-banner-from-register">
|
<div class="signin-banner-from-register">
|
||||||
<NavLink href="Register">کد ارسال نشد؟ <span>ارسال مجدد</span></NavLink>
|
<NavLink style="cursor:pointer" @onclick="ReSend">کد ارسال نشد؟ <span>ارسال مجدد</span></NavLink>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
bool successfull = false;
|
||||||
// alert
|
// alert
|
||||||
AlertColor alertColor = AlertColor.Primary;
|
AlertColor alertColor = AlertColor.Primary;
|
||||||
IconName alertIconName = IconName.CheckCircleFill;
|
IconName alertIconName = IconName.CheckCircleFill;
|
||||||
@@ -95,7 +95,6 @@
|
|||||||
[SupplyParameterFromForm]
|
[SupplyParameterFromForm]
|
||||||
public VerificationCodeDto? VerificationCodeModel { get; set; } = new VerificationCodeDto();
|
public VerificationCodeDto? VerificationCodeModel { get; set; } = new VerificationCodeDto();
|
||||||
|
|
||||||
|
|
||||||
protected override async Task OnParametersSetAsync()
|
protected override async Task OnParametersSetAsync()
|
||||||
{
|
{
|
||||||
var request = await _hc.GetAsync($"Verification/GetVerification/{ID}");
|
var request = await _hc.GetAsync($"Verification/GetVerification/{ID}");
|
||||||
@@ -114,6 +113,21 @@
|
|||||||
}
|
}
|
||||||
@functions {
|
@functions {
|
||||||
|
|
||||||
|
private async Task ReSend()
|
||||||
|
{
|
||||||
|
|
||||||
|
var request = await _hc.GetAsync($"Verification/ReSend/{VerificationCodeModel?.ID}");
|
||||||
|
if (request.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
ShowSuccessAlert("کد مجدد ارسال شد");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowDangerAlert(await request.Content.ReadFromJsonAsync<string>());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
private async Task SubmitVerificationCode()
|
private async Task SubmitVerificationCode()
|
||||||
{
|
{
|
||||||
if (VerificationCodeModel.Code < 1000 || VerificationCodeModel.Code > 9000)
|
if (VerificationCodeModel.Code < 1000 || VerificationCodeModel.Code > 9000)
|
||||||
@@ -129,6 +143,7 @@
|
|||||||
if (status)
|
if (status)
|
||||||
{
|
{
|
||||||
ShowSuccessAlert("عملیات با موفقیت انجام شد");
|
ShowSuccessAlert("عملیات با موفقیت انجام شد");
|
||||||
|
successfull = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -157,5 +172,11 @@
|
|||||||
alertIconName = IconName.ExclamationTriangleFill;
|
alertIconName = IconName.ExclamationTriangleFill;
|
||||||
alertMessage = msg;
|
alertMessage = msg;
|
||||||
}
|
}
|
||||||
private async Task EndForm() => nav.NavigateTo("/");
|
private async Task EndForm()
|
||||||
|
{
|
||||||
|
if (!successfull)
|
||||||
|
await _hc.DeleteAsync($"Verification/Remove/{VerificationCodeModel?.ID}");
|
||||||
|
|
||||||
|
nav.NavigateTo("/");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -9,9 +9,9 @@ builder.RootComponents.Add<HeadOutlet>("head::after");
|
|||||||
builder.Services.AddBlazorBootstrap();
|
builder.Services.AddBlazorBootstrap();
|
||||||
|
|
||||||
|
|
||||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
|
||||||
|
|
||||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
||||||
|
|
||||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user