178 lines
6.8 KiB
Plaintext
178 lines
6.8 KiB
Plaintext
@using Front.Pages
|
|
@using Shared.DTOs
|
|
@inject HttpClient _hc
|
|
@inject NavigationManager nav
|
|
<div class="contact-info-area pb-90" id="contact">
|
|
<div class="container">
|
|
<div class="row">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="contact-form-area pb-120">
|
|
<div class="container">
|
|
<div class="row gx-0">
|
|
<div class="col-xl-5 col-lg-6">
|
|
<div class="contact-form-left">
|
|
<div class="contact-form-section-box pb-80">
|
|
<h5 class="inner-section-subtitle">ارتباط با ما</h5>
|
|
<h4 class="tp-section-title pb-10">
|
|
ما مشتاقانه منتظر <br> نظرات شما هستیم
|
|
|
|
</h4>
|
|
</div>
|
|
<div class="contact-form-social-box p-relative">
|
|
|
|
<div class="contact-form-section-img">
|
|
<img src="img/contact/contact-icon-sm-4.png" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-xl-7 col-lg-6">
|
|
<div class="contact-form-right-warp">
|
|
<div class="postbox__comment-form">
|
|
<EditForm EditContext="editContext" OnValidSubmit="newTicket">
|
|
<DataAnnotationsValidator />
|
|
<div class="postbox__comment-input mb-35">
|
|
<ValidationMessage For="()=>model.FullName" />
|
|
<ValidationMessage For="()=>model.Mobile" />
|
|
<ValidationMessage For="()=>model.Title" />
|
|
<ValidationMessage For="()=>model.Text" />
|
|
</div>
|
|
<div class="row gx-20">
|
|
<div class="col-12">
|
|
<div class="postbox__comment-input mb-30">
|
|
<InputText @bind-Value="model.FullName" id="FullName" type="text" class="inputText" required="" />
|
|
<span class="floating-label">نام شما</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-12">
|
|
<div class="postbox__comment-input mb-35">
|
|
<InputText @bind-Value="model.Mobile" id="Mobile" type="text" class="inputText" required=""/>
|
|
<span class="floating-label">موبایل</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-12">
|
|
<div class="postbox__comment-input mb-35">
|
|
<InputText @bind-Value="model.Title" id="Title" type="text" class="inputText" required=""/>
|
|
<span class="floating-label">عنوان</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-xxl-12">
|
|
<div class="postbox__comment-input mb-30">
|
|
<InputText @bind-Value="model.Text" id="Text" class="textareaText" required=""></InputText>
|
|
<span class="floating-label-2">پیام شما ...</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-xxl-12">
|
|
<div class="postbox__btn-box">
|
|
<button type="submit" class="submit-btn w-100">ارسال پیام</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</EditForm>
|
|
<Button Color="ButtonColor.Primary" @onclick="OnShowModalClick">Show Modal</Button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<Modal @ref="_modal"
|
|
title="Modal title"
|
|
OnShowing="OnModalShowing"
|
|
OnShown="OnModalShown"
|
|
OnHiding="OnModalHiding"
|
|
OnHidden="OnModalHidden"
|
|
OnHidePrevented="OnModalHidePrevented">
|
|
|
|
<BodyTemplate>
|
|
Modal body text goes here.
|
|
</BodyTemplate>
|
|
|
|
<FooterTemplate>
|
|
<Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
|
|
<Button Color="ButtonColor.Primary">Save changes</Button>
|
|
</FooterTemplate>
|
|
|
|
</Modal>
|
|
|
|
@code {
|
|
|
|
private Modal _modal = default!;
|
|
[Inject] ToastService ToastService { get; set; } = default!;
|
|
//-------------------------------
|
|
string type = "NewTicketNoAuthentication";
|
|
private EditContext? editContext;
|
|
[SupplyParameterFromForm]
|
|
private CTicketNoAuthenticationDto? model { get; set; } = new CTicketNoAuthenticationDto();
|
|
|
|
private ValidationMessageStore? messageStore;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
// modelTaxTools ??= new();
|
|
// editContext = new(modelTaxTools);
|
|
// editContext.OnValidationRequested += HandleValidationRequested;
|
|
// messageStore = new(editContext);
|
|
|
|
editContext = new EditContext(model);
|
|
messageStore = new(editContext);
|
|
}
|
|
}
|
|
@functions{
|
|
private async Task newTicket(){
|
|
|
|
var request = await _hc.PostAsJsonAsync("Ticket/NewTicketNoAuthentication", model);
|
|
if (request.IsSuccessStatusCode)
|
|
{
|
|
messageStore?.Clear();
|
|
var res = await request.Content.ReadFromJsonAsync<int>();
|
|
OnShowModalClick();
|
|
// nav.NavigateTo($"Verification/{res}");
|
|
}
|
|
else
|
|
{
|
|
var error = await request.Content.ReadFromJsonAsync<List<string>>();
|
|
messageStore?.Add(() => model.Mobile, error);
|
|
|
|
}
|
|
}
|
|
private async Task OnShowModalClick()
|
|
{
|
|
await _modal.ShowAsync();
|
|
}
|
|
|
|
private async Task OnHideModalClick()
|
|
{
|
|
await _modal.HideAsync();
|
|
}
|
|
|
|
private void OnModalShowing()
|
|
{
|
|
ToastService.Notify(new(ToastType.Primary, $"Event: Showing called. DateTime: {DateTime.Now}"));
|
|
}
|
|
|
|
private void OnModalShown()
|
|
{
|
|
ToastService.Notify(new(ToastType.Success, $"Event: Show called. DateTime: {DateTime.Now}"));
|
|
}
|
|
|
|
private void OnModalHiding()
|
|
{
|
|
ToastService.Notify(new(ToastType.Danger, $"Event: Hiding called. DateTime: {DateTime.Now}"));
|
|
}
|
|
|
|
private void OnModalHidden()
|
|
{
|
|
ToastService.Notify(new(ToastType.Warning, $"Event: Hide called. DateTime: {DateTime.Now}"));
|
|
}
|
|
|
|
private void OnModalHidePrevented()
|
|
{
|
|
ToastService.Notify(new(ToastType.Info, $"Event: Hide Prevented called. DateTime: {DateTime.Now}"));
|
|
}
|
|
}
|