Ejemplo n.º 1
0
        internal void CreateExpenseList(ResourceManager _rm)
        {
            rm = _rm;
            if (CB_Offer.SelectedIndex > -1)
            {
                LB_Expense.IsEnabled = true;
                LB_Cost.IsEnabled    = true;
                LB_Count.IsEnabled   = true;
                BT_Save.IsEnabled    = true;
                TB_Expense.IsEnabled = true;
                TB_Count.IsEnabled   = true;
                TB_Cost.IsEnabled    = true;

                int id = VenueIDs[CB_Offer.SelectedIndex];
                WPE     = new Models.WeddingPlannerEntities();
                expList = WPE.WeddingExpenses.Where(x => x.VenueID.Equals(id)).OrderBy(x => x.ExpenseName).ToList();
                ExpenseItems.Children.Clear();
                foreach (var item in expList)
                {
                    var exp = new ViewModel.Expense(item.ExpenseName.Trim(), f.StringCurrencyFormat(item.Expense.ToString().Trim()), item.ID, f.StringCurrencyFormat(item.Count.ToString().Trim()));
                    ExpenseItems.Children.Add(new UserControls.UserControlExpenses(exp, (rm as ResourceManager), ResourceNames, this));
                }
                Amount_Reload();

                if (ExpenseItems.Children.Count > 0)
                {
                    BT_ExportToExcel.Visibility = Visibility.Visible;
                }
                else
                {
                    BT_ExportToExcel.Visibility = Visibility.Hidden;
                }
            }
        }
Ejemplo n.º 2
0
 public UserControlExpenses(ViewModel.Expense _Exp, ResourceManager _rm, string[] _ResourceNames, Pages.Expenses _expPage)
 {
     InitializeComponent();
     Exp     = _Exp;
     rm      = _rm;
     expPage = _expPage;
     ListViewItemMenu1.Visibility = Exp.Expanse != null ? Visibility.Visible : Visibility.Collapsed;
     ListViewItemMenu2.Visibility = Exp.Cost != null ? Visibility.Visible : Visibility.Collapsed;
     ListViewItemMenu3.Visibility = Exp.Count != null ? Visibility.Visible : Visibility.Collapsed;
     ResourceNames    = _ResourceNames;
     this.DataContext = Exp;
     LoadFormats();
 }