public EquipmentFront(Action <string, string> pSetBarCode, Action <double, bool> pSetWeight, Action <double, bool> pSetControlWeight, Action <StatusEquipment> pActionStatus = null) { System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance); sEquipmentFront = this; Task.Run(() => Init(pSetBarCode, pSetWeight, pSetControlWeight, pActionStatus)); }
public Admin() { EF = EquipmentFront.GetEquipmentFront; Bl = BL.GetBL; InitializeComponent(); if (EF != null) { LE = new ObservableCollection <EquipmentElement>(EF.GetListEquipment); } ListEquipment.ItemsSource = LE; //поточний час DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += timer_Tick; timer.Start(); }
public MainWindow() { var c = new Config("appsettings.json");// Конфігурація Програми(Шляхів до БД тощо) //Для касового місця Запит логін пароль. if (Global.TypeWorkplace == eTypeWorkplace.SelfServicCheckout) { Access.СurUser = new User() { TypeUser = eTypeUser.Client, CodeUser = 99999999, Login = "******", NameUser = "******" } } ; Bl = new BL(true); EF = new EquipmentFront(Bl.GetBarCode, SetWeight, CS.OnScalesData); //SetBarCode += Bl.GetBarCode;// (pBarCode, pTypeBarCode) => { Bl.GetBarCode(pBarCode, pTypeBarCode); }; //SetControlWeight += Bl.CS.OnScalesData; // (pWeight, isStable)=>{ }); //ad = new Admin(); EF.SetStatus += (info) => { EquipmentInfo = info.TextState; }; Global.OnReceiptCalculationComplete += (pWares, pIdWorkplace) => { try { ListWares = new ObservableCollection <ReceiptWares>(pWares); Dispatcher.BeginInvoke(new ThreadStart(() => { WaresList.ItemsSource = ListWares; Recalc(); })); } catch (Exception e) { FileLogger.WriteLogMessage($"MainWindow.OnReceiptCalculationComplete Exception =>(pWares=>{pWares.ToJSON()},pIdWorkplace=>{pIdWorkplace}) => ({Environment.NewLine}Message=>{e.Message}{Environment.NewLine}StackTrace=>{e.StackTrace})", eTypeLog.Error); } FileLogger.WriteLogMessage($"MainWindow.OnReceiptCalculationComplete Exception =>(pWares=>{pWares.ToJSON()},pIdWorkplace=>{pIdWorkplace})", eTypeLog.Full); }; Global.OnSyncInfoCollected += (SyncInfo) => { FileLogger.WriteLogMessage($"MainWindow.OnSyncInfoCollected Status=>{SyncInfo.Status} StatusDescription=>{SyncInfo.StatusDescription}", eTypeLog.Full); }; Global.OnStatusChanged += (Status) => { }; Global.OnChangedStatusScale += (Status) => { }; Global.OnClientChanged += (client, guid) => { FileLogger.WriteLogMessage($"MainWindow.OnClientChanged(Client.Wallet=> {client.Wallet} SumBonus=>{client.SumBonus})", eTypeLog.Full); }; Global.OnAdminBarCode += (pUser) => { SetConfirm(pUser, false); }; WaresQuantity = "0"; MoneySum = "0"; Volume = true; InitializeComponent(); ListWares = new ObservableCollection <ReceiptWares>(StartData()); WaresList.ItemsSource = ListWares;// Wares; ua.Tag = new CultureInfo("uk"); en.Tag = new CultureInfo("en"); hu.Tag = new CultureInfo("hu"); //pln.Tag = new CultureInfo("pln"); CultureInfo currLang = App.Language; Recalc(); }