示例#1
0
 public OrderSummaryViewModel(CustomerInvoiceDatum InvoiceDetails, ObservableCollection <InvocieLineItem> LineitemFromCloud)
 {
     TotalAmount  = InvoiceDetails.PayableAmount.ToString();
     TotalMRP     = InvoiceDetails.TotalInvoiceAmount.ToString();
     Discount     = InvoiceDetails.DiscountAmount.ToString();
     LineItemList = new ObservableCollection <InvocieLineItem>();
     InvoiceItems(InvoiceDetails.CustomerInvoiceId, LineitemFromCloud);
 }
        public ItemDetailPage(CustomerInvoiceDatum InvoiceDetails)
        {
            InitializeComponent();
            var    app = Application.Current as App;
            string MerchantStaffRole = app.UserRole;

            BindingContext = viewModel = new ItemDetailViewModel(InvoiceDetails);
            CustomerInfo   = viewModel.CustomerInfo;
            AddressInfo    = viewModel.AddressInfo;
        }
示例#3
0
 public OrderSummaryViewModel(CustomerInvoiceDatum InvoiceDetails, ObservableCollection <InvocieLineItem> LineitemFromCloud)
 {
     OrderPaymentMode = string.IsNullOrEmpty(InvoiceDetails.PaymentMode) ? "" : InvoiceDetails.PaymentMode;
     EarnedPoints     = string.IsNullOrEmpty(InvoiceDetails.EarnedPoints) ? "" : InvoiceDetails.EarnedPoints;
     RedeemedPoints   = string.IsNullOrEmpty(InvoiceDetails.RedeemedPoints) ? "" : InvoiceDetails.RedeemedPoints;
     TotalAmount      = string.IsNullOrEmpty(InvoiceDetails.PayableAmount) ? "" : InvoiceDetails.PayableAmount;
     TotalMRP         = InvoiceDetails.TotalInvoiceAmount.ToString();
     Discount         = string.IsNullOrEmpty(InvoiceDetails.DiscountAmount) ? "" : InvoiceDetails.DiscountAmount;
     LineItemList     = new ObservableCollection <InvocieLineItem>();
     InvoiceItems(InvoiceDetails.CustomerInvoiceId, LineitemFromCloud);
 }
        //Constructor
        public ItemDetailViewModel(CustomerInvoiceDatum InvoiceDetails)
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                //CustomerInfo.FirstName = "yoyo honey singh";
                //CustomerInfo.PrimaryPhone = "998898989";
                phoneNumberList = new ObservableCollection <string>();
                var storecust_id = string.IsNullOrEmpty(InvoiceDetails.StoreCustomerId) ? "" : InvoiceDetails.StoreCustomerId;
                if (InvoiceDetails.CreatedDate != null)
                {
                    var date          = InvoiceDetails.CreatedDate;
                    var convertedDate = date.ToString("MMM dd, yyyy hh:mm tt");
                    //var convertedDate = date.ToLocalTime().ToString("MMM dd, yyyy hh:mm tt");
                    Console.WriteLine("Converted date :", convertedDate);
                    OrderDate = convertedDate;
                }
                else
                {
                    OrderDate = "";
                }

                BillNumber      = string.IsNullOrEmpty(InvoiceDetails.InvoiceId) ? "" : InvoiceDetails.InvoiceId;
                OrderSource     = InvoiceDetails.OrderSource;
                PayableAmount   = string.IsNullOrEmpty(InvoiceDetails.PayableAmount) ? "" : InvoiceDetails.PayableAmount.ToString();
                OrderStatus     = string.IsNullOrEmpty(InvoiceDetails.OrderStatus) ? "" : InvoiceDetails.OrderStatus;
                UpdateBtnStatus = false;
                SetOrderStatusFrameColor(OrderStatus);
                Task.Run(async() => await GetLineItemsFromCloudAsync(InvoiceDetails.InvoiceId)).Wait();
                Task.Run(async() => { await ExecuteLoadCustomerCommand(storecust_id, InvoiceDetails.DeliverAddressId, InvoiceDetails); }).Wait();
                int i = 10;
                //ResetBtnStatus(InvoiceDetails.OrderStatus);
            }
            else
            {
                DependencyService.Get <IToastMessage>().LongTime("Check your Internet Connection and try again");
            }
        }
        public async Task ExecuteLoadCustomerCommand(string storecust_id, string DeliverAddressId, CustomerInvoiceDatum InvoiceDetails)
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                IsBusy = true;
                try
                {
                    if (!string.IsNullOrEmpty(storecust_id))
                    {
                        CustomerInfo = new CustomerDetails();
                        AddressInfo  = new AddressDetails();
                        CustomerApiData CustomerItems = await CustomerApiService.Instance.FetchCustomerList(storecust_id);

                        AddressApiData AddressItem = await AddressApiService.Instance.RefreshAddressList(DeliverAddressId);

                        CustomerInfo = CustomerItems.CustomerInfo;
                        AddressInfo  = AddressItem.CustAddress;
                        phoneNumberList.Add(AddressInfo.PrimaryPhone);
                        phoneNumberList.Add(AddressInfo.AlternatePhone);
                        if (String.IsNullOrEmpty(AddressInfo.AlternatePhone))
                        {
                            DisplayAltNumber = false;
                        }
                        else
                        {
                            DisplayAltNumber = true;
                        }
                        if (String.IsNullOrEmpty(AddressInfo.FlatNoDoorNo))
                        {
                            DisplayFlatNumber = false;
                        }
                        else
                        {
                            DisplayFlatNumber = true;
                        }
                        if (String.IsNullOrEmpty(AddressInfo.SocietyBuildingNo))
                        {
                            DisplaySociety = false;
                        }
                        else
                        {
                            DisplaySociety = true;
                        }
                    }
                    else
                    {
                        AddressInfo                   = new AddressDetails();
                        AddressInfo.FirstName         = InvoiceDetails.FirstName;
                        AddressInfo.PrimaryPhone      = InvoiceDetails.PrimaryPhone;
                        AddressInfo.AlternatePhone    = null;
                        DisplayAltNumber              = false;
                        DisplayFlatNumber             = false;
                        AddressInfo.Address1          = InvoiceDetails.Address1;
                        AddressInfo.PostalCodeZipCode = InvoiceDetails.ZipCode;
                        AddressInfo.Address2          = InvoiceDetails.Address2;
                        AddressInfo.TagName           = null;
                        phoneNumberList.Add(AddressInfo.PrimaryPhone);
                        phoneNumberList.Add(AddressInfo.AlternatePhone);
                    }
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    IsBusy = false;
                }
            }
            else
            {
                DependencyService.Get <IToastMessage>().LongTime("Check your Internet Connection and try again");
            }
        }
示例#6
0
 public OrderSummary(CustomerInvoiceDatum InvoiceDetails, ObservableCollection <InvocieLineItem> LineitemFromCloud)
 {
     InitializeComponent();
     BindingContext = viewModel = new OrderSummaryViewModel(InvoiceDetails, LineitemFromCloud);
 }