示例#1
0
        public static BudgetManagementController Create()

        {
            if (_instance == null)
            {
                _instance = new BudgetManagementController();
            }

            return(_instance);
        }
示例#2
0
        public override void ViewDidLoad()
        {
            UIImage img = UIImage.FromFile("BackGround.png");

            img = img.Scale(View.Frame.Size);
            this.View.BackgroundColor = UIColor.FromPatternImage(img);


            txtValue.Placeholder = "Must Be Didigt";
            budget = db.GetBudget(DateTime.Now);
            if (budget != null)
            {
                lblMonthBudget.Text        = "This Month's Budget: " + budget.BudgetAmount.ToString();
                lblTotalCostThisMonth.Text = "Total Cost This Month: " + totalcost.ToString();

                lblRemaningBudget.Text = "Remaning Budget: " + (budget.BudgetAmount - totalcost).ToString();

                lblTotalCostPlanned.Text = "Total Cost Planned: Not Set";
            }
            else
            {
                lblMonthBudget.Text    = "This Month's Budget: NotSet.";
                lblRemaningBudget.Text = "Remaning Budget: 0";
            }
            totalcost = db.GetTotalCostMonth(DateTime.Now);
            lblTotalCostThisMonth.Text = "Total Cost This Month: " + totalcost.ToString();


            lblTotalCostPlanned.Text = "Total Cost Planned: Not Set";


            var budgetManager = BudgetManagementController.Create();

            budgetManager.Budgets.Clear();

            tablePlannedCost.Source = dataSource = new BudgetResource(budgetManager.Budgets, this);

            ReadPlannedCost();
        }