public MainWindow() { InitializeComponent(); ConfigurationManager.RefreshSection("appSettings"); this.Title = ConfigurationManager.AppSettings["title"]; lineDevice = new LineDevice(); lineDevice.QRCodeReaderIP = ConfigurationManager.AppSettings["ScanerIP"]; lineDevice.QRCodeReaderModel = ConfigurationManager.AppSettings["ScanerModel"]; business = new StackTrayBusiness(lineDevice, new BatchBusiness("MySQLConnection1")); business.ReadLineStatus(); GridCanvas.Children.Add(new Controls.CanasWindow(business)); }
public StackTrayBusiness(LineDevice lineDevice, BusinessControl businessControl) { //PrintInfo.DottedLine(); this.stackNumber = int.Parse(ConfigurationManager.AppSettings["stackNumber"]); this.trayNumber = int.Parse(ConfigurationManager.AppSettings["trayNumber"]); this.isBatchValid = int.Parse(ConfigurationManager.AppSettings["isBatchValid"]) == 1; this.isTrayCodeValid = int.Parse(ConfigurationManager.AppSettings["isTrayCodeValid"]) == 1; this.lineDevice = lineDevice; this.businessControl = businessControl; //创建表 this.lineDevice.PrefixTable = ConfigurationManager.AppSettings["prefixTable"]; CreateTableBusiness.CreateTable(this.lineDevice.PrefixTable); InitTrayCodeList(); DeviceInit(); }