private void InitData(ComboBoxSearchModel org, ObservableCollection <CustomerSchedulingOrgLabelModel> orgLabelList) { Organization = org; CustomerSchedulingDate = new CustomerSchedulingDateModel { Date1 = DateTime.Now.AddDays(1).Date, Date2 = DateTime.Now.AddDays(2).Date, Date3 = DateTime.Now.AddDays(3).Date, Date4 = DateTime.Now.AddDays(4).Date, Date5 = DateTime.Now.AddDays(5).Date }; Service.GetCustomerSchedulingDetailLists(Organization.Id, DateTime.Now.Date, Label).ForEach(x => CustomerSchedulingDetailLists.Add(x)); Task.Factory.StartNew(() => { UIExecute.RunAsync(() => { if (orgLabelList.Count == 0) { Service.GetCustomerSchedulingSummaryLists(org.Id, DateTime.Now.Date).ForEach(x => OrgLabelLists.Add(new CustomerSchedulingOrgLabelModel { FItemId = x.FItemId, Label = x.Label, OrgCode = x.OrgCode, OrgId = x.OrgId, ProductionName = x.ProductionName })); } else { OrgLabelLists = orgLabelList; } }); }); }
private void InitData() { Task.Factory.StartNew(() => { SettleMonthSearchedItem = new ComboBoxSearchModel() { Id = Convert.ToInt32(DateTime.Now.Date.AddMonths(-10).ToString("yyyyMM")), SearchText = DateTime.Now.Date.AddMonths(-10).ToString("yyyy-MM") }; ItemProfitAccountingLists = new ObservableCollection <ItemProfitAccountingModel>(); ItemProfitAccountingMonthlyLists = new ObservableCollection <ItemProfitAccountingMonthlyModel>(); ItemProfitAccountingSelectedItem = new ItemProfitAccountingModel(); UIExecute.RunAsync(() => { SettleMonthLists = _itemProfitAccountingService.GetSettleMonthLists(); ItemProfitAccountingQueryCommand.Execute(null); }); }); }
public CustomerSchedulingManagementViewModel(ComboBoxSearchModel org, ObservableCollection <CustomerSchedulingOrgLabelModel> orgLabelList) { InitCommand(); //InitData(org,orgLabelList); Organization = org; CustomerSchedulingDate = new CustomerSchedulingDateModel { Date1 = DateTime.Now.AddDays(1).Date, Date2 = DateTime.Now.AddDays(2).Date, Date3 = DateTime.Now.AddDays(3).Date, Date4 = DateTime.Now.AddDays(4).Date, Date5 = DateTime.Now.AddDays(5).Date }; Service.GetCustomerSchedulingDetailLists(Organization.Id, DateTime.Now.Date, Label).ForEach(x => CustomerSchedulingDetailLists.Add(x)); if (orgLabelList.Count == 0) { Service.GetCustomerSchedulingSummaryLists(org.Id, DateTime.Now.Date).ForEach(x => OrgLabelLists.Add(new CustomerSchedulingOrgLabelModel { FItemId = x.FItemId, Label = x.Label, OrgCode = x.OrgCode, OrgId = x.OrgId, ProductionName = x.ProductionName })); } else { OrgLabelLists = orgLabelList; } }
public CustomerSchedulingManagementView(ComboBoxSearchModel org, ObservableCollection <CustomerSchedulingOrgLabelModel> orgLabelList) { InitializeComponent(); this.DataContext = new CustomerSchedulingManagementViewModel(org, orgLabelList); this.WindowStartupLocation = WindowStartupLocation.CenterScreen; CommandBindings.Add(new CommandBinding(ApplicationCommands.Help, (send, e) => { if (this.WindowState == WindowState.Normal) { this.WindowState = WindowState.Maximized; } else if (WindowState == WindowState.Maximized) { this.WindowState = WindowState.Normal; } })); this.MouseLeftButtonDown += (sender, e) => { if (e.LeftButton == MouseButtonState.Pressed) { this.DragMove(); } }; }