public async Task ExecuteLoadItems()
        {
            CurrentAddressee = new objRequesList();

            App.WaitScreenStart(Translator.getText("Loading"));

            CurrentAddressee = await apiService.getTravelDefList(App.User + "|" + TravelerSpecs.Id, TravelerSpecs.Id);

            if (CurrentAddressee != null)
            {
                selectedstate2 = CurrentAddressee.listrequestspecs.State;
                Addressee      = CurrentAddressee.listrequestspecs.Addressee;
                address        = CurrentAddressee.listrequestspecs.Address;
                addresseephone = CurrentAddressee.listrequestspecs.AddresseePhone;

                Confirmed = (CurrentAddressee.listrequestspecs.Status != 0) ? true : false;

                NoDelete = (Confirmed) ? false : true;

                city = CurrentAddressee.listrequestspecs.City;



                decimal SumTotal = 0;
                if (CurrentAddressee.lrequestspecs_det != null)
                {
                    totalItems = CurrentAddressee.lrequestspecs_det.Select(X => X.Quantity).Sum();
                    foreach (LRequestSpecs_det item in CurrentAddressee.lrequestspecs_det)
                    {
                        SumTotal += item.Quantity * item.ProductValue;
                    }
                }
                txtAmount = (SumTotal == 0)? "0.00": SumTotal.ToString();

                txtService = CurrentAddressee.listrequestspecs.ServiceFee.ToString();

                txtShipment = CurrentAddressee.listrequestspecs.ShipmentFee.ToString();

                txtTotal = (SumTotal + CurrentAddressee.listrequestspecs.ServiceFee + CurrentAddressee.listrequestspecs.ShipmentFee).ToString();



                txtListSelection = CurrentAddressee.itemsInList.ToString();

                ListShow = CurrentAddressee.lrequestspecs_det;

                if (ListShow != null)
                {
                    foreach (LRequestSpecs_det item in ListShow)
                    {
                        item.imageSource = (item.ProductImage == null)? "item.png": ImageManager.BytesToImage(item.ProductImage);
                    }
                }
            }
            App.WaitScreenStop();
            MessagingCenter.Send <ListCodePageViewModel, string>(this, "DataNoData", "Done");
        }
Пример #2
0
        public PaymentInfoPage(decimal amount, objRequesList requestList)
        {
            InitializeComponent();
            ObjRequestList = requestList;
            BindingContext = viewModel = new PaymentInfoPageViewModel(requestList);


            if (requestList.listrequestspecs.TotalProductValue > 2000)
            {
                Option2.IsVisible        = true;
                Option1.IsVisible        = false;
                bt_accept.IsVisible      = false;
                lb_SendbyEmail.IsVisible = true;
            }
            else if (requestList.listrequestspecs.TotalProductValue < 2000 && amount < 5000)
            {
                Option2.IsVisible = false;
                Option1.IsVisible = true;
                updatepage(requestList);
                lb_SendbyEmail.IsVisible = false;
            }
            else if (requestList.listrequestspecs.TotalProductValue < 2000 && amount > 5000)
            {
                Option2.IsVisible        = true;
                Option1.IsVisible        = false;
                bt_accept.IsVisible      = false;
                lb_SendbyEmail.IsVisible = true;
            }



            viewModel.PaymentDone   += () => DoneAction();
            viewModel.PaymentUnDone += () => UnDoneAction();
            lb_backFunc();
            void lb_backFunc()
            {
                try
                {
                    Back.GestureRecognizers.Add(new TapGestureRecognizer()
                    {
                        Command = new Command(() =>
                        {
                            Navigation.PopModalAsync();
                        })
                    });
                }
                catch (Exception ex) { Debug.WriteLine(ex); }
            }
        }
        async void AddItem(object obj)
        {
            if (string.IsNullOrEmpty(city) || string.IsNullOrEmpty(address) || string.IsNullOrEmpty(addressee) || string.IsNullOrEmpty(selectedstate))
            {
                NoDataSpecified();
            }
            else
            {
                App.WaitScreenStart(Translator.getText("Loading"));
                ListRequestSpecs listRequestSpecs = new ListRequestSpecs();
                listRequestSpecs.Id = TravelerSpecs.Id;
                listRequestSpecs.CountryCodeFrom   = TravelerSpecs.CountryCodeFrom.Split('-')[0];
                listRequestSpecs.CountryCodeTo     = TravelerSpecs.CountryCodeTo.Split('-')[0];
                listRequestSpecs.TravelDate        = TravelerSpecs.FromDate;
                listRequestSpecs.TravelLimit       = TravelerSpecs.ToDate;
                listRequestSpecs.Addressee         = addressee;
                listRequestSpecs.Address           = address;
                listRequestSpecs.AddresseePhone    = addresseephone;
                listRequestSpecs.City              = city;
                listRequestSpecs.State             = SelectedState;
                listRequestSpecs.Status            = 0;
                listRequestSpecs.TotalItems        = 0;
                listRequestSpecs.TotalProductValue = 0;
                listRequestSpecs.TotalWeight       = 0;
                listRequestSpecs.TrackingNumber    = App.User + "|" + TravelerSpecs.Id;
                listRequestSpecs.OpenDays          = "";
                listRequestSpecs.OpenDelivery      = "";
                listRequestSpecs.Email             = App.User;



                CurrentAddressee = await apiService.getTravelDefList(listRequestSpecs.TrackingNumber, listRequestSpecs.Id);


                if (CurrentAddressee == null)
                {
                    await apiService.RegisterItemList(listRequestSpecs);

                    App.WaitScreenStop();
                    AddItemAction();
                }
                else
                {
                    App.WaitScreenStop();
                    AddItemAction();
                }
            }
        }
Пример #4
0
        private void updatepage(objRequesList requestList)
        {
            List <App_Con> Lconf   = DatabaseHelper.getConfiguration(App.Os_Folder);
            string         strPpqk = Lconf.Where(x => x.Name == "CostoPorKilo").Select(x => x.Value).FirstOrDefault().ToString();
            decimal        ppqk    = decimal.Parse(strPpqk);


            decimal weightxKilo = requestList.listrequestspecs.TotalWeight * ppqk;

            txt_amount.Text = Translator.getText("AmountItems").Replace("{0}", "");
            amount.Text     = requestList.listrequestspecs.TotalProductValue.ToString();

            txt_Info.Text = Translator.getText("TooLow");


            txt_Service.Text = Translator.getText("Description") + ":";
            Service.Text     = requestList.listrequestspecs.ServiceDesc;

            Service_txt.Text    = Translator.getText("Service") + ":";
            Service_amount.Text = requestList.listrequestspecs.ServiceFee.ToString();

            txt_Ship.Text   = Translator.getText("ShipMentFee") + ":";
            txt_ShipLD.Text = Translator.getText("ShipLD") + ":";

            Shipment.Text = requestList.listrequestspecs.ShipmentFee.ToString();

            ShipmentLD.Text = requestList.listrequestspecs.TotalWeight + " Kg: " + (requestList.listrequestspecs.TotalWeight * 399).ToString();

            Total.Text = (requestList.listrequestspecs.TotalProductValue +
                          requestList.listrequestspecs.ShipmentFee +
                          requestList.listrequestspecs.ServiceFee +
                          (weightxKilo)).ToString();


            txt_Total.Text = "Total:";


            int c = 0;
        }
 public PaymentInfoPageViewModel(objRequesList requesList)
 {
     RequesList       = requesList;
     ItemsLoadCommand = new Command(async() => ExecuteLoadItemsCommand());
     ItemsLoadCommand.Execute(this);
 }