Merge pull request #8 from syncfusion/Update-Nuget-Version
Added validation to Expense description..
This commit is contained in:
Коммит
3e3a351361
|
@ -20,11 +20,12 @@ namespace ExpenseAnalysis
|
|||
|
||||
public class AddTransactionDetail
|
||||
{
|
||||
|
||||
public double Spent { get; set; }
|
||||
|
||||
public CategoryPicker Category { get; set; }
|
||||
|
||||
[Display(Name = "Expense Description")]
|
||||
[Required(AllowEmptyStrings = false, ErrorMessage = "Description should not be empty")]
|
||||
public string ExpenseDescription { get; set; }
|
||||
|
||||
public DateTime Date { get; set; }
|
||||
|
|
|
@ -8,12 +8,17 @@ namespace ExpenseAnalysis
|
|||
{
|
||||
public TransactionPage TransactionPage;
|
||||
|
||||
bool isDescriptionValid;
|
||||
|
||||
public AddTransactionsPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void DoneButton_Clicked(object sender, EventArgs e)
|
||||
{
|
||||
isDescriptionValid = dataForm.Validate("ExpenseDescription");
|
||||
if (isDescriptionValid)
|
||||
{
|
||||
var newTransaction = ((ExpenseViewModel)BindingContext).SingleTransaction;
|
||||
if (newTransaction.Spent != 0)
|
||||
|
@ -30,6 +35,7 @@ namespace ExpenseAnalysis
|
|||
}
|
||||
Navigation.PopToRootAsync();
|
||||
}
|
||||
}
|
||||
|
||||
private void DataForm_AutoGeneratingDataFormItem(object sender, AutoGeneratingDataFormItemEventArgs e)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче