public void initialize() { // 初始化 common = new Entity.Commons(currentUser); // 部分数据绑定 inout.DisplayMemberPath = "Name"; inout.SelectedValuePath = "Id"; inout.ItemsSource = common.InOutList; accType.DisplayMemberPath = "TypeName"; accType.SelectedValuePath = "Id"; accType.ItemsSource = common.AccountTypeList; // 默认情况下只能够做将来5年的预算 List<int> years = new List<int>(); string[] temp = DateTime.Now.ToShortDateString().Split('-'); int yearm = Convert.ToInt32(temp[0]); for (int i = 0; i < 5; i++, yearm++) { years.Add(yearm); } year.ItemsSource = years; // 添加月份 List<int> months = new List<int>(); for (int i = 1; i <= 12; i++) { months.Add(i); } month.ItemsSource = months; }
// 初始化工作 public void initialize() { common = new Entity.Commons(currentUser); helper = new DBHelper(); inout.DisplayMemberPath = "Name"; inout.SelectedValuePath = "Id"; inout.ItemsSource = common.InOutList; acctype.DisplayMemberPath = "TypeName"; acctype.SelectedValuePath = "Id"; acctype.ItemsSource = common.AccountTypeList; }
public void initialze() { common = new Entity.Commons(currentUser); budgetlist.ItemsSource = common.ShowBudgetList; // 为inout绑定数据 // 为收支类型绑定数据 inout.DisplayMemberPath = "Name"; inout.SelectedValuePath = "Id"; inout.ItemsSource = common.InOutList; // 这里显示的是用户具有的AccoutType的类型 acctypeName.DisplayMemberPath = "TypeName"; acctypeName.SelectedValuePath = "Id"; acctypeName.ItemsSource = common.InBudgetTypeList; // Year 和 Month year.ItemsSource = common.BudYearList; month.ItemsSource = common.BudMonthList; }
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; }