private void InitData()
 {
     Task.Factory.StartNew(() =>
     {
         PrintLSLists   = new ObservableCollection <LabelPrintLSModel>();
         ProductionDate = DateTime.Now.Date;
         HostConfig     = CommonService.GetHostConfig(DataGridId, HostName, User.ID) ?? new HostConfigModel()
         {
             TypeId = DataGridId, Host = HostName, UserId = User.ID, TypeDesciption = "蓝思标签打印"
         };
         ComputerPrinters = PrintHelper.GetComputerPrinters();
         var config       = CommonService.GetBarTenderPrintConfigXX(User.ID, DataGridId, HostName);
         if (config == null)
         {
             PrintConfiguration = new BarTenderPrintConfigModelXX {
                 TemplateTypeId = DataGridId, HostName = HostName, UserId = User.ID, TemplateTypeName = "蓝思标签打印"
             }
         }
         ;
         else
         {
             PrintConfiguration = config;
             PirntTemplates     = PrintHelper.GetTenderPrintTemplates(config.TemplateSelectedItem.TemplateFolderPath);
         }
         BarcodeTypeLists        = CommonService.GetEnumLists(10);
         BarcodeTypeSelectedItem = BarcodeTypeLists.FirstOrDefault();
         UIExecute.RunAsync(() =>
         {
             QueryBaseCommand.Execute(null);
         });
     });
 }
示例#2
0
        private void InitData()
        {
            Task.Factory.StartNew(() =>
            {
                QueryParameter = new ProductionDeptLabelPrintA4QueryParameterModel {
                    ProductionDate = DateTime.Now.Date
                };
                PrintHistoryLists = new ObservableCollection <LabelPrintHistoryModel>();


                HostConfig = CommonService.GetHostConfig(DataGridId, HostName, User.ID) ?? new HostConfigModel()
                {
                    TypeId = DataGridId, Host = HostName, UserId = User.ID, TypeDesciption = "标签A4打印"
                };
                ComputerPrinters = PrintHelper.GetComputerPrinters();
                var config       = CommonService.GetBarTenderPrintConfigXX(User.ID, DataGridId, HostName);
                if (config == null)
                {
                    PrintConfiguration = new BarTenderPrintConfigModelXX {
                        TemplateTypeId = DataGridId, HostName = HostName, UserId = User.ID, TemplateTypeName = "标签A4打印"
                    }
                }
                ;
                else
                {
                    PrintConfiguration = config;
                    PirntTemplates     = PrintHelper.GetTenderPrintA4Templates(config.TemplateSelectedItem.TemplateFolderPath);
                }


                var ss = _service.GetHistoryLists(CommonService.GetSqlWhereString(QueryParameter));

                UIExecute.RunAsync(() =>
                {
                    ss.ForEach(x => PrintHistoryLists.Add(x));
                });
            });
        }