示例#1
0
文件: Common.cs 项目: shoumu/Pigger
        public Commons(string name)
        {
            helper = new DBHelper();
            InOutList = new List<InOutType>();
            YearList = new List<string>();
            MonthList = new List<string>();
            DayList = new List<string>();
            
            currentUser = name;

            InOutList.Add(new InOutType(0, "收入"));
            InOutList.Add(new InOutType(1, "支出"));
            AccountTypeList = helper.getAllAccountypes();
            getInAccTypeList();
            ShowAccountList = helper.getAllShowAccount(currentUser);
            getYearMonthDayList();

            BudgetInitialize();
        }
示例#2
0
        public void initialize()
        {
            helper = new DBHelper();
            listShow = new List<Entity.ShowAccount>();
            common = new Entity.Commons(currentUser);
            listShow = helper.getAllShowAccount(currentUser);
            accountlist.ItemsSource = listShow;

            // 为收支类型绑定数据
            inoutType.DisplayMemberPath = "Name";
            inoutType.SelectedValuePath = "Id";
            inoutType.ItemsSource = common.InOutList;

            // 这里显示的是用户具有的AccoutType的类型
            accType.DisplayMemberPath = "TypeName";
            accType.SelectedValuePath = "Id";
            accType.ItemsSource = common.InAccTypeList;

            year.ItemsSource = common.YearList;
            month.ItemsSource = common.MonthList;
            day.ItemsSource = common.DayList;
        }