complete rls 2
parent
7e5b388119
commit
6681c11444
|
@ -31,7 +31,7 @@ namespace iElection
|
||||||
if (UtilitiesWrapper.Instance.UserUtilities.IsAuthorized)
|
if (UtilitiesWrapper.Instance.UserUtilities.IsAuthorized)
|
||||||
await NavigationService.NavigateAsync("NavigationPage/MainPage");
|
await NavigationService.NavigateAsync("NavigationPage/MainPage");
|
||||||
else
|
else
|
||||||
await NavigationService.NavigateAsync("NavigationPage/SignUpPage");
|
await NavigationService.NavigateAsync("NavigationPage/LoginPage");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,5 +16,7 @@ namespace iElection.Services.Rest
|
||||||
Task<ApiResult<LoginRespond>> LoginUser([Body] LoginRequest loginRequest);
|
Task<ApiResult<LoginRespond>> LoginUser([Body] LoginRequest loginRequest);
|
||||||
[Post("/RegisterUser")]
|
[Post("/RegisterUser")]
|
||||||
Task<ApiResult<LoginRespond>> RegisterUser([Body] RegisterDto registerDto);
|
Task<ApiResult<LoginRespond>> RegisterUser([Body] RegisterDto registerDto);
|
||||||
|
[Post("/ForgetPassUser/{phone}")]
|
||||||
|
Task<ApiResult<LoginRespond>> ForgetPassUser(string phone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,9 @@ namespace iElection.Utilities
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void PushIndicator()
|
public async void PushIndicator(bool popOthers = true)
|
||||||
{
|
{
|
||||||
|
if(popOthers)
|
||||||
await PopAsync();
|
await PopAsync();
|
||||||
var indicator = new Frame
|
var indicator = new Frame
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,9 +36,15 @@ namespace iElection.ViewModels
|
||||||
var contact = parameters.GetValue<InviteContactDto>("Contact");
|
var contact = parameters.GetValue<InviteContactDto>("Contact");
|
||||||
if (contact != null)
|
if (contact != null)
|
||||||
{
|
{
|
||||||
PageDto = contact;
|
|
||||||
IsAdding = false;
|
IsAdding = false;
|
||||||
IsReadOnly = true;
|
IsReadOnly = true;
|
||||||
|
PageDto.Age = contact.Age;
|
||||||
|
PageDto.District = contact.District;
|
||||||
|
PageDto.FirstName = contact.FirstName;
|
||||||
|
PageDto.LastName = contact.LastName;
|
||||||
|
PageDto.Gender = contact.Gender;
|
||||||
|
PageDto.Job = contact.Job;
|
||||||
|
PageDto.Phone = contact.Phone;
|
||||||
Title = PageDto.FullName;
|
Title = PageDto.FullName;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,6 +7,7 @@ using System.Windows.Input;
|
||||||
using iElection.Models.Api;
|
using iElection.Models.Api;
|
||||||
using iElection.Services.Contracts;
|
using iElection.Services.Contracts;
|
||||||
using iElection.Utilities;
|
using iElection.Utilities;
|
||||||
|
using iElection.Views.PopUps;
|
||||||
using Prism.Navigation;
|
using Prism.Navigation;
|
||||||
using Refit;
|
using Refit;
|
||||||
|
|
||||||
|
@ -16,6 +17,7 @@ namespace iElection.ViewModels
|
||||||
{
|
{
|
||||||
public ICommand SignUpCommand { get; set; }
|
public ICommand SignUpCommand { get; set; }
|
||||||
public ICommand LoginCommand { get; set; }
|
public ICommand LoginCommand { get; set; }
|
||||||
|
public ICommand ForgetPassCommand { get; set; }
|
||||||
public LoginPageViewModel(INavigationService navigationService, IRestWrapper restWrapper) : base(navigationService, restWrapper)
|
public LoginPageViewModel(INavigationService navigationService, IRestWrapper restWrapper) : base(navigationService, restWrapper)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -52,6 +54,10 @@ namespace iElection.ViewModels
|
||||||
{
|
{
|
||||||
NavigationService.NavigateAsync("SignUpPage");
|
NavigationService.NavigateAsync("SignUpPage");
|
||||||
});
|
});
|
||||||
|
ForgetPassCommand = new DelegateCommand(async () =>
|
||||||
|
{
|
||||||
|
await UtilitiesWrapper.Instance.PopUpUtilities.PushAsync(new ForegetPassPopUp());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,10 +47,7 @@
|
||||||
Padding="8,3"
|
Padding="8,3"
|
||||||
HasShadow="True"
|
HasShadow="True"
|
||||||
MaterialTheme="Acrylic">
|
MaterialTheme="Acrylic">
|
||||||
<Grid
|
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||||
BackgroundColor="#F1F1F1"
|
|
||||||
ColumnDefinitions="Auto,*"
|
|
||||||
IsVisible="{Binding IsAdding}">
|
|
||||||
<Label
|
<Label
|
||||||
Margin="-3,0,8,0"
|
Margin="-3,0,8,0"
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
@ -61,7 +58,7 @@
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
IsReadOnly="{Binding IsReadOnly}"
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
Placeholder="مثال : امیرحسین"
|
Placeholder="مثال : امیرحسین"
|
||||||
Text="{Binding PageDto.FirstName, Mode=TwoWay}" />
|
Text="{Binding Path=PageDto.FirstName, Mode=TwoWay}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</materialFrame:MaterialFrame>
|
</materialFrame:MaterialFrame>
|
||||||
<materialFrame:MaterialFrame
|
<materialFrame:MaterialFrame
|
||||||
|
@ -69,10 +66,7 @@
|
||||||
Padding="8,3"
|
Padding="8,3"
|
||||||
HasShadow="True"
|
HasShadow="True"
|
||||||
MaterialTheme="Acrylic">
|
MaterialTheme="Acrylic">
|
||||||
<Grid
|
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||||
BackgroundColor="#F1F1F1"
|
|
||||||
ColumnDefinitions="Auto,*"
|
|
||||||
IsVisible="{Binding IsAdding}">
|
|
||||||
<Label
|
<Label
|
||||||
Margin="-3,0,8,0"
|
Margin="-3,0,8,0"
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
@ -91,10 +85,7 @@
|
||||||
Padding="8,3"
|
Padding="8,3"
|
||||||
HasShadow="True"
|
HasShadow="True"
|
||||||
MaterialTheme="Acrylic">
|
MaterialTheme="Acrylic">
|
||||||
<Grid
|
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||||
BackgroundColor="#F1F1F1"
|
|
||||||
ColumnDefinitions="Auto,*"
|
|
||||||
IsVisible="{Binding IsAdding}">
|
|
||||||
<Label
|
<Label
|
||||||
Margin="-3,0,8,0"
|
Margin="-3,0,8,0"
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
@ -104,6 +95,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
IsReadOnly="{Binding IsReadOnly}"
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
|
Keyboard="Telephone"
|
||||||
Placeholder="مثال : 09124805051"
|
Placeholder="مثال : 09124805051"
|
||||||
Text="{Binding PageDto.Phone, Mode=TwoWay}" />
|
Text="{Binding PageDto.Phone, Mode=TwoWay}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -114,10 +106,7 @@
|
||||||
HasShadow="True"
|
HasShadow="True"
|
||||||
MaterialTheme="Acrylic">
|
MaterialTheme="Acrylic">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid
|
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||||
BackgroundColor="#F1F1F1"
|
|
||||||
ColumnDefinitions="Auto,*"
|
|
||||||
IsVisible="{Binding IsAdding}">
|
|
||||||
<Label
|
<Label
|
||||||
Margin="-3,0,8,0"
|
Margin="-3,0,8,0"
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
@ -150,11 +139,13 @@
|
||||||
SelectionChanged="DistrictSfAutoComplete_OnSelectionChanged"
|
SelectionChanged="DistrictSfAutoComplete_OnSelectionChanged"
|
||||||
ShowSuggestionsOnFocus="True"
|
ShowSuggestionsOnFocus="True"
|
||||||
SuggestionMode="Contains" />
|
SuggestionMode="Contains" />
|
||||||
|
|
||||||
<!--<Picker
|
<!--<Picker
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
ItemDisplayBinding="{Binding Name}"
|
ItemDisplayBinding="{Binding Name}"
|
||||||
ItemsSource="{Binding InfoDto.Districts}"
|
ItemsSource="{Binding InfoDto.Districts}"
|
||||||
SelectedIndexChanged="DistrictPicker_OnSelectedIndexChanged" />-->
|
SelectedIndexChanged="DistrictPicker_OnSelectedIndexChanged" />-->
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</materialFrame:MaterialFrame>
|
</materialFrame:MaterialFrame>
|
||||||
|
@ -164,16 +155,14 @@
|
||||||
HasShadow="True"
|
HasShadow="True"
|
||||||
MaterialTheme="Acrylic">
|
MaterialTheme="Acrylic">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid
|
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||||
BackgroundColor="#F1F1F1"
|
|
||||||
ColumnDefinitions="Auto,*"
|
|
||||||
IsVisible="{Binding IsAdding}">
|
|
||||||
<Label
|
<Label
|
||||||
Margin="-3,0,8,0"
|
Margin="-3,0,8,0"
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
Text="شغل : "
|
Text="شغل : "
|
||||||
VerticalOptions="Center" />
|
VerticalOptions="Center" />
|
||||||
<Entry
|
<Entry
|
||||||
|
Grid.Column="1"
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
IsReadOnly="{Binding IsReadOnly}"
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
Placeholder="شغل"
|
Placeholder="شغل"
|
||||||
|
@ -207,10 +196,7 @@
|
||||||
Padding="8,3"
|
Padding="8,3"
|
||||||
HasShadow="True"
|
HasShadow="True"
|
||||||
MaterialTheme="Acrylic">
|
MaterialTheme="Acrylic">
|
||||||
<Grid
|
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||||
BackgroundColor="#F1F1F1"
|
|
||||||
ColumnDefinitions="Auto,*"
|
|
||||||
IsVisible="{Binding IsAdding}">
|
|
||||||
<Label
|
<Label
|
||||||
Margin="-3,0,8,0"
|
Margin="-3,0,8,0"
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
@ -220,6 +206,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
IsReadOnly="{Binding IsReadOnly}"
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
|
Keyboard="Numeric"
|
||||||
Placeholder="مثال : 32"
|
Placeholder="مثال : 32"
|
||||||
Text="{Binding PageDto.Age, Mode=TwoWay, StringFormat='{}{0:#}'}" />
|
Text="{Binding PageDto.Age, Mode=TwoWay, StringFormat='{}{0:#}'}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -230,16 +217,14 @@
|
||||||
HasShadow="True"
|
HasShadow="True"
|
||||||
MaterialTheme="Acrylic">
|
MaterialTheme="Acrylic">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid
|
<Grid BackgroundColor="#F1F1F1" ColumnDefinitions="Auto,*">
|
||||||
BackgroundColor="#F1F1F1"
|
|
||||||
ColumnDefinitions="Auto,*"
|
|
||||||
IsVisible="{Binding IsAdding}">
|
|
||||||
<Label
|
<Label
|
||||||
Margin="-3,0,8,0"
|
Margin="-3,0,8,0"
|
||||||
FontFamily="{StaticResource ShabnameBold}"
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
Text="جنسیت : "
|
Text="جنسیت : "
|
||||||
VerticalOptions="Center" />
|
VerticalOptions="Center" />
|
||||||
<Entry
|
<Entry
|
||||||
|
Grid.Column="1"
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
IsReadOnly="{Binding IsReadOnly}"
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
Placeholder="جنسیت"
|
Placeholder="جنسیت"
|
||||||
|
|
|
@ -77,6 +77,12 @@
|
||||||
TextColor="White" />
|
TextColor="White" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Button
|
||||||
|
Margin="0,10"
|
||||||
|
BackgroundColor="Transparent"
|
||||||
|
Command="{Binding ForgetPassCommand}"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
Text="فراموشی رمز عبور" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<ContentView
|
||||||
|
x:Class="iElection.Views.PopUps.ForegetPassPopUp"
|
||||||
|
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
|
Margin="40,0"
|
||||||
|
FlowDirection="RightToLeft"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
VerticalOptions="Center">
|
||||||
|
<ContentView.Content>
|
||||||
|
<Frame BackgroundColor="{StaticResource Gray-100}" CornerRadius="10">
|
||||||
|
<StackLayout HorizontalOptions="Center">
|
||||||
|
<StackLayout HorizontalOptions="Center">
|
||||||
|
<Label
|
||||||
|
x:Name="messageLabel"
|
||||||
|
FontFamily="{StaticResource Shabname}"
|
||||||
|
FontSize="Body"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
HorizontalTextAlignment="Center"
|
||||||
|
Text="اگر رمز خود را فراموش کرده اید ، شماره تلفن خود را وارد کنید تا رمز عبور جدید برای شماره تلفن شما ارسال شود"
|
||||||
|
TextColor="#444"
|
||||||
|
VerticalOptions="Center" />
|
||||||
|
<Grid ColumnDefinitions="Auto,*">
|
||||||
|
<Label
|
||||||
|
Margin="-3,0,8,0"
|
||||||
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
Text="شماره تلفن : "
|
||||||
|
VerticalOptions="Center" />
|
||||||
|
<Entry
|
||||||
|
x:Name="phoneEntry"
|
||||||
|
Grid.Column="1"
|
||||||
|
FontSize="Small"
|
||||||
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
|
Keyboard="Telephone"
|
||||||
|
Placeholder="مثال : 09124805051" />
|
||||||
|
</Grid>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout
|
||||||
|
Margin="0,10,0,0"
|
||||||
|
HorizontalOptions="Center"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<Button
|
||||||
|
Padding="30,0"
|
||||||
|
BackgroundColor="{StaticResource Green}"
|
||||||
|
Clicked="AcceptButton_OnClicked"
|
||||||
|
CornerRadius="6"
|
||||||
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
FontSize="17"
|
||||||
|
HeightRequest="40"
|
||||||
|
Text="تایید"
|
||||||
|
TextColor="White" />
|
||||||
|
<Button
|
||||||
|
Padding="25,0"
|
||||||
|
BackgroundColor="#30FA0941"
|
||||||
|
Clicked="CancelButton_OnClicked"
|
||||||
|
CornerRadius="6"
|
||||||
|
FontFamily="{StaticResource ShabnameBold}"
|
||||||
|
FontSize="17"
|
||||||
|
HeightRequest="40"
|
||||||
|
Text="انصراف"
|
||||||
|
TextColor="#FA0941" />
|
||||||
|
</StackLayout>
|
||||||
|
</StackLayout>
|
||||||
|
</Frame>
|
||||||
|
</ContentView.Content>
|
||||||
|
</ContentView>
|
|
@ -0,0 +1,51 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using iElection.Services;
|
||||||
|
using iElection.Utilities;
|
||||||
|
using Refit;
|
||||||
|
using Xamarin.Forms;
|
||||||
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
namespace iElection.Views.PopUps
|
||||||
|
{
|
||||||
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
public partial class ForegetPassPopUp : ContentView
|
||||||
|
{
|
||||||
|
private RestWrapper RestWrapper = new RestWrapper();
|
||||||
|
public ForegetPassPopUp()
|
||||||
|
{
|
||||||
|
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void AcceptButton_OnClicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(phoneEntry.Text))
|
||||||
|
throw new Exception("شماره تلفن را وارد کنید");
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PushIndicator(false);
|
||||||
|
var rest = await RestWrapper.AccountApiRest.ForgetPassUser(phoneEntry.Text);
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
if (rest.IsSuccess)
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PushSuccess("فراموشی رمز در صورت صحت شماره تلفن برای شما پیامک خواهد شد");
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
RestWrapper.UnhandledExceptionRaiser(ex);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
UtilitiesWrapper.Instance.PopUpUtilities.PushError(ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CancelButton_OnClicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Utilities.UtilitiesWrapper.Instance.PopUpUtilities.PopAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -95,6 +95,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
IsReadOnly="{Binding IsReadOnly}"
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
|
Keyboard="Telephone"
|
||||||
Placeholder="مثال : 09124805051"
|
Placeholder="مثال : 09124805051"
|
||||||
Text="{Binding PageDto.Phone, Mode=TwoWay}" />
|
Text="{Binding PageDto.Phone, Mode=TwoWay}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -172,6 +173,7 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
FontSize="Small"
|
FontSize="Small"
|
||||||
IsReadOnly="{Binding IsReadOnly}"
|
IsReadOnly="{Binding IsReadOnly}"
|
||||||
|
Keyboard="Numeric"
|
||||||
Placeholder="مثال : 32"
|
Placeholder="مثال : 32"
|
||||||
Text="{Binding PageDto.Age, Mode=TwoWay, StringFormat='{}{0:#}'}" />
|
Text="{Binding PageDto.Age, Mode=TwoWay, StringFormat='{}{0:#}'}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -40,6 +40,9 @@
|
||||||
<EmbeddedResource Update="Views\PopUps\ErrorPopUp.xaml">
|
<EmbeddedResource Update="Views\PopUps\ErrorPopUp.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Update="Views\PopUps\ForegetPassPopUp.xaml">
|
||||||
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Update="Views\PopUps\QuestionPopUp.xaml">
|
<EmbeddedResource Update="Views\PopUps\QuestionPopUp.xaml">
|
||||||
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
Loading…
Reference in New Issue