예제 #1
0
        private void SelectCustomer(object sender, NavigationListEventArgs e)
        {
            Customer SelectedCustomer = DataGrid.SelectedItem as Customer;

            if (SelectedCustomer != null)
            {
                if (App.isAdminLoggedIn)
                {
                    ECDeleteButton.Visibility = Visibility.Visible;
                    ECNameBox.Header          = "Nombre";
                    ECAddressBox.Header       = "Direccion";
                    ECPhoneNumberBox.Header   = "Telefono";
                    ECNotesBox.Header         = "Comentarios";
                    ECItemsBox.Header         = "Compra";
                    ECDebtBox.Header          = "Deuda";
                    ECPayedDebtBox.Header     = "Pagado";

                    if (SelectedCustomerToEdit != SelectedCustomer)
                    {
                        SelectedCustomerToEdit = SelectedCustomer as Customer;
                        ECNameBox.Text         = SelectedCustomerToEdit.Name;
                        ECAddressBox.Text      = SelectedCustomerToEdit.Address;
                        ECPhoneNumberBox.Text  = SelectedCustomerToEdit.PhoneNumber;
                        ECNotesBox.Text        = SelectedCustomerToEdit.Notes;
                        ECItemsBox.Text        = SelectedCustomerToEdit.Items;
                        ECDebtBox.Text         = SelectedCustomerToEdit.Debt.ToString();
                        ECPayedDebtBox.Text    = SelectedCustomerToEdit.PayedDebt.ToString();
                    }
                }
                else
                {
                    if (SelectedCustomerToEdit != SelectedCustomer)
                    {
                        SelectedCustomerToEdit = SelectedCustomer as Customer;
                        PDNameTextBlock.Text   = SelectedCustomerToEdit.Name;
                        PDItemsTextBlock.Text  = SelectedCustomerToEdit.Items;
                        PDDebtBox.Text         = SelectedCustomerToEdit.Total.ToString("c");
                    }
                }
            }
            else
            {
                ECCancelButton_Click(null, null);
            }
        }
예제 #2
0
        private void AddToCart(object sender, NavigationListEventArgs e)
        {
            Item SelectedItem = DataGrid.SelectedItem as Item;

            //If a new sale is active, add selected item to the cart.
            if (NSSplitView.IsPaneOpen)
            {
                DataGrid.SelectedItem = null;
                if (SelectedItem != null)
                {
                    if (SelectedItem.Num >= 0)
                    {
                        Cart.AddItem(SelectedItem);
                        UpdateCart();
                    }
                }
            }
            else if (EISplitView.IsPaneOpen)
            {
                if (SelectedItem != null)
                {
                    EIDeleteButton.Visibility = Visibility.Visible;
                    if (SelectedItemToEdit != SelectedItem)
                    {
                        SelectedItemToEdit = SelectedItem as Item;
                        EITypeBox.Text     = SelectedItemToEdit.Type;
                        EISizeBox.Text     = SelectedItemToEdit.Size;
                        EICodeBox.Text     = SelectedItemToEdit.Code;
                        EIBrandBox.Text    = SelectedItemToEdit.Brand;
                        EIPriceBox.Text    = SelectedItemToEdit.Price.ToString();
                        EINumBox.Text      = SelectedItemToEdit.Num.ToString();
                    }
                }
                else
                {
                    EIDeleteButton.Visibility = Visibility.Collapsed;
                }
            }
        }
예제 #3
0
		protected void OnNavigate(NavigationListEventArgs args)
		{
			var copy = Navigate;
			if (copy != null)
				copy(this, args);
		}
예제 #4
0
		private void OnNavigate(object sender, NavigationListEventArgs e)
		{
			var copy = Navigate;
			if (copy != null)
				copy(this, e);
		}
예제 #5
0
		private void OnEditPerson(object sender, NavigationListEventArgs e)
		{
			NavigationService.Navigate(new Uri("/Views/DetailsPage.xaml?SelectedItem=" + e.GetItem<Person>().ID, UriKind.Relative));
		}
예제 #6
0
		protected void OnNavigation(NavigationListEventArgs args)
		{
			if (Navigation != null)
				Navigation(this, args);
		}
예제 #7
0
 private void OnEditPerson(object sender, NavigationListEventArgs e)
 {
     NavigationService.Navigate(new Uri("/Views/DetailsPage.xaml?SelectedItem=" + e.GetItem <Person>().Id, UriKind.Relative));
 }