コード例 #1
0
        protected async override void OnAppearing()
        {
            if (await helper.UpdateSQLiteDbWithPayAndDelTypes())
            {
                try
                {
                    paymentTypes = await _connection.Table <PaymentTypeModel>().ToListAsync();

                    deliveryTypes = await _connection.Table <DeliveryTypeModel>().ToListAsync();

                    PaymentTypeModel p = paymentTypes.Where(d => d.PaymentTypeID == delivery.PaymentTypeID).FirstOrDefault();
                    if (p != null)
                    {
                        PaymentType.Text = p.PaymentTypeName;
                    }
                    DeliveryTypeModel D = deliveryTypes.Where(d => d.DeliveryTypeID == delivery.DeliveryTypeID).FirstOrDefault();
                    if (D != null)
                    {
                        DeliveryType.Text = D.DeliveryTypeName;
                    }
                    if (delivery.DeliveryStatus == 4)
                    {
                        directionsBtn.IsVisible = false;
                    }
                }
                catch (Exception ex) { await DisplayAlert("error", ex.Message + ">||<" + ex.InnerException, "ok"); }
            }
            else
            {
                throw new Exception("No internet or bad request to server");
            }

            base.OnAppearing();
        }
コード例 #2
0
        protected async override void OnAppearing()
        {
            try
            {
                paymentTypes = await _connection.Table <PaymentTypeModel>().ToListAsync();

                deliveryTypes = await _connection.Table <DeliveryTypeModel>().ToListAsync();

                PaymentTypeModel p = paymentTypes.Where(d => d.PaymentTypeID == delivery.PaymentTypeID).FirstOrDefault();
                if (p != null)
                {
                    PaymentType.Text = p.PaymentTypeName;
                }
                DeliveryTypeModel D = deliveryTypes.Where(d => d.DeliveryTypeID == delivery.DeliveryTypeID).FirstOrDefault();
                if (D != null)
                {
                    DeliveryType.Text = D.DeliveryTypeName;
                }
            }
            catch (Exception ex) { await DisplayAlert("error", ex.Message + ">||<" + ex.InnerException, "ok"); }



            base.OnAppearing();
        }
コード例 #3
0
ファイル: RecordModel.cs プロジェクト: kolev9605/Budget
 public static RecordModel FromRecord(Record record)
 {
     return(new RecordModel
     {
         Id = record.Id,
         Note = record.Note,
         Account = AccountModel.FromAccount(record.Account),
         RecordType = record.RecordType,
         PaymentType = PaymentTypeModel.FromPaymentType(record.PaymentType),
         Category = CategoryModel.FromCategory(record.Category),
         DateAdded = record.DateAdded,
         Amount = record.Amount,
     });
 }