public static BystronicData GetData(DataSource dataSource) { lock (_bystronicDataLock) { if (_bystronicData == null) { _bystronicData = new BystronicData(dataSource); } return(_bystronicData); } }
public static void UpdateData(DataSource dataSource) { //if (_tmpBystronicData == null) _tmpBystronicData = new BystronicData(dataSource); // else // _tmpBystronicData.ReadData(dataSource); lock (_bystronicDataLock) { _bystronicData = _tmpBystronicData; //LogUtil.Trace("* Bystronic data reloaded"); } }
public void OrderChanged(Order order) { order.YtdSaleBeforeThisOrder = this.GetYtdSale(order.Salesman, order.ID, order.OrderDate.Value); var index = BystronicData.GetData(this).orders.FindIndex(x => x.ID == order.ID); if (index >= 0) { UpdateOrder(order); BystronicData.GetData(this).UpdateOrder(order, index); } else { AddOrder(order); BystronicData.GetData(this).AddOrder(order); } BystronicData.GetData(this).RefreshSalesmenData(this); }
public void OrderDeleted(int orderID, out string poNumber) { DeleteOrder(orderID); BystronicData.GetData(this).DeleteOrder(orderID, out poNumber); BystronicData.GetData(this).RefreshSalesmenData(this); }