public void Load()
        {
            // 重新加载扩展日期
            CustomerSchedulingDate = Service.GetContinuousDate(OrganizationSearchedItem.Id, SettleDate);

            // CustomerSchedulingDate = new CustomerSchedulingDateModel() { Date3 = DateTime.Now };


            // 重新加载交期数据
            //CustomerSchedulingDetailLists.Clear();
            //Service.GetCustomerSchedulingDetailLists(OrganizationSearchedItem.Id, SettleDate, CustomerSchedulingSummarySelectedItem?.Label ?? "").ForEach(x => CustomerSchedulingDetailLists.Add(x));

            // 重新加载主表格数据
            CustomerSchedulingSummaryLists.Clear();
            OrgLabelLists.Clear();
            Service.GetCustomerSchedulingSummaryLists(OrganizationSearchedItem.Id, SettleDate).ForEach(x =>
            {
                CustomerSchedulingSummaryLists.Add(x);
                if (SelectedIndex == -1)
                {
                    OrgLabelLists.Add(new CustomerSchedulingOrgLabelModel {
                        FItemId = x.FItemId, Label = x.Label, OrgCode = x.OrgCode, OrgId = x.OrgId, ProductionName = x.ProductionName, Value1 = null, Value2 = null, Value3 = null, Value4 = null, Value5 = null
                    });
                }
            });

            //SelectedIndex = sd;
        }
        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;
                    }
                });
            });
        }
 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;
     }
 }