Ejemplo n.º 1
0
        private void SetInitialValues()
        {
            ModifiedOrder = CloneObject.CloneObjectSerializable <OrderModel>(Order);

            RemovedOrderProducts = new List <OrderProductModel>();

            // Order info
            OrderIdValue.Text      = Order.Id.ToString();
            OrderDateValue.Text    = Order.DateTimeOfTheOrder.ToString();
            StaffNameValue.Text    = Order.Staff.Person.FullName;
            StoreNameValue.Text    = Order.Store.Name;
            CustomerNameValue.Text = Order.Customer.Person.FullName;

            OrderTotalPriceValue.Value        = Order.GetTotalPrice;
            TotalPriceAfterChangesValue.Value = Order.GetTotalPrice;

            TotalProfitValue.Value             = Order.GetTotalProfit;
            TotalProfitAfterChangesValue.Value = Order.GetTotalProfit;

            OrderDetailsValue.Text = Order.Details;

            // Order Payments
            OrderPaymentsList.ItemsSource = null;
            OrderPaymentsList.ItemsSource = Order.OrderPayments;

            OrderProductList.ItemsSource = null;
            OrderProductList.ItemsSource = ModifiedOrder.OrderProducts;

            RemovedOrderProductList.ItemsSource = null;
            RemovedOrderProductList.ItemsSource = RemovedOrderProducts;

            SelectedOrderProductQuantityValue.Value = 0;

            TotalPaidValue.Value     = Order.GetTotalPaid;
            ShoppeeWalletValue.Value = PublicVariables.Store.GetShopeeWallet;

            if (ModifiedOrder.GetOrderState == "DONE")
            {
                CustomerShouldPayValue.Value     = 0;
                CustomerShouldReceiveValue.Value = 0;

                StoreWillPayNowValue.Value   = 0;
                StoreWillPayLaterValue.Value = 0;

                CustomerWillPayNowValue.Value   = 0;
                CustomerWillPayLaterValue.Value = 0;
            }
            else if (ModifiedOrder.GetOrderState == "Customer Should Pay")
            {
                CustomerShouldPayValue.Value     = ModifiedOrder.GetTotalNotPaid;
                CustomerShouldReceiveValue.Value = 0;

                CustomerWillPayNowValue.Value   = ModifiedOrder.GetTotalNotPaid;
                CustomerWillPayLaterValue.Value = 0;

                StoreWillPayNowValue.Value   = 0;
                StoreWillPayLaterValue.Value = 0;
            }
            else if (ModifiedOrder.GetOrderState == "Customer Should Receive")
            {
                CustomerShouldPayValue.Value     = 0;
                CustomerShouldReceiveValue.Value = ModifiedOrder.GetCustomerShouldReceive;

                StoreWillPayNowValue.Value   = ModifiedOrder.GetCustomerShouldReceive;
                StoreWillPayLaterValue.Value = 0;

                CustomerWillPayNowValue.Value   = 0;
                CustomerWillPayLaterValue.Value = 0;
            }
            else
            {
                CustomerShouldPayValue.Value = 0;

                CustomerShouldReceiveValue.Value = 0;
            }
        }
Ejemplo n.º 2
0
        private void SetInitialValues()
        {
            ModifiedIncomedOrder = CloneObject.CloneObjectSerializable <IncomeOrderModel>(IncomeOrder);

            RemovedIncomeOrderProducts = new List <IncomeOrderProductModel>();

            // Order info
            IncomeOrderIdValue.Text   = IncomeOrder.Id.ToString();
            IncomeOrderDateValue.Text = IncomeOrder.Date.ToString();
            StaffNameValue.Text       = IncomeOrder.Staff.Person.FullName;
            StoreNameValue.Text       = IncomeOrder.Store.Name;
            SupplierNameValue.Text    = IncomeOrder.Supplier.Person.FullName;

            IncomeOrderTotalPriceValue.Value  = IncomeOrder.GetTotalPrice;
            TotalPriceAfterChangesValue.Value = IncomeOrder.GetTotalPrice;

            IncomeOrderDetailsValue.Text = IncomeOrder.Details;

            //Income Order Payments
            IncomeOrderPaymentsList.ItemsSource = null;
            IncomeOrderPaymentsList.ItemsSource = IncomeOrder.IncomeOrderPayments;

            IncomeOrderProductList.ItemsSource = null;
            IncomeOrderProductList.ItemsSource = ModifiedIncomedOrder.IncomeOrderProducts;

            RemovedIncomeOrderProductList.ItemsSource = null;
            RemovedIncomeOrderProductList.ItemsSource = RemovedIncomeOrderProducts;

            SelectedIncomeOrderProductQuantityValue.Value = 0;

            TotalPaidValue.Value     = IncomeOrder.GetTotalPaid;
            ShoppeeWalletValue.Value = PublicVariables.Store.GetShopeeWallet;

            if (ModifiedIncomedOrder.GetIncomeOrderState == "DONE")
            {
                StoreShouldPayValue.Value     = 0;
                StoreShouldReceiveValue.Value = 0;

                StoreWillPayNowValue.Value   = 0;
                StoreWillPayLaterValue.Value = 0;

                SupplierWillPayNowValue.Value   = 0;
                SupplierWillPayLaterValue.Value = 0;
            }
            else if (ModifiedIncomedOrder.GetIncomeOrderState == "Store Should Pay")
            {
                StoreShouldPayValue.Value     = ModifiedIncomedOrder.GetTotalNotPaid;
                StoreShouldReceiveValue.Value = 0;

                StoreWillPayNowValue.Value   = ModifiedIncomedOrder.GetTotalNotPaid;
                StoreWillPayLaterValue.Value = 0;

                SupplierWillPayNowValue.Value   = 0;
                SupplierWillPayLaterValue.Value = 0;
            }
            else if (ModifiedIncomedOrder.GetIncomeOrderState == "Store Should Receive")
            {
                StoreShouldPayValue.Value     = 0;
                StoreShouldReceiveValue.Value = ModifiedIncomedOrder.GetStoreShouldReceive;

                SupplierWillPayNowValue.Value   = ModifiedIncomedOrder.GetStoreShouldReceive;
                SupplierWillPayLaterValue.Value = 0;

                StoreWillPayNowValue.Value   = 0;
                StoreWillPayLaterValue.Value = 0;
            }
            else
            {
                StoreShouldPayValue.Value     = 0;
                StoreShouldReceiveValue.Value = 0;
            }
        }