private bool Exists(BatchLine pObjBatchLine) { return(mObjBatchLineDAO.GetEntitiesList().Where(x => x.BatchId == pObjBatchLine.BatchId && x.ItemId == pObjBatchLine.ItemId && x.Quantity == pObjBatchLine.Quantity && x.Id != pObjBatchLine.Id).Count() > 0 ? true : false); }
private bool search(PartManager partManager, SoegInputType1 soegObject, BatchLine batchLine, SourceUsageOrder SourceUsageOrder) { var searchResult = partManager.SearchList( BrokerContext.Current.UserToken, BrokerContext.Current.ApplicationToken, soegObject, SourceUsageOrder); if (StandardReturType.IsSucceeded(searchResult.StandardRetur)) { if (batchLine.FillFrom(searchResult)) { return(true); } else { batchLine.Error = "Person not found"; return(false); } } else { batchLine.Error = string.Format("{0}-{1}", searchResult.StandardRetur.StatusKode, searchResult.StandardRetur.FejlbeskedTekst); return(false); } }
public static void BuildServiceColumns(BatchLine line, DataGrid grid) { if (line == null) { return; } grid.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto; foreach (var pair in line.ParsedServiceFields.Where(k => k.Key != "ReportData")) { var key = pair.Key; //todo - хорошо бы вычислять ширину колонок, но непонятно как //если задать с помощью звезды колонка будет зажата в минимальный размер //тк все имеющееся пространство уже будет распределено между фиксированными колонками //var width = new DataGridLength(1, DataGridLengthUnitType.Star); var width = new DataGridLength(50, DataGridLengthUnitType.Pixel); grid.Columns.Add(new DataGridTextColumn { Width = width, Header = key, Binding = new Binding(".") { Converter = new LambdaConverter <BatchLine>(l => l?.ParsedServiceFields.GetValueOrDefault(key), o => { return((o as BatchLineView).BatchLine); }) } }); } }
public void SaveOrUpdate(BatchLine pObjBatchLine) { if (!Exists(pObjBatchLine)) { mObjBatchLineDAO.SaveOrUpdateEntity(pObjBatchLine); } else { throw new Exception("La linea de lote ingresada ya existe."); } }
public void BuildLineViews(List <BatchLine> batchLines) { var orderLines = Addresses.SelectMany(a => a.ActiveOrders()).SelectMany(o => o.Lines); var lookup = orderLines.ToLookup(l => l.ExportBatchLineId); var items = batchLines.Select(l => new BatchLineView(l, lookup[l.ExportId].FirstOrDefault())).ToArray(); Lines.Value = orderLines.Except(items.Where(x => x.OrderLine != null).Select(x => x.OrderLine)) .Select(x => new BatchLineView(x)).Concat(items).ToObservableCollection(); BatchLine.CalculateStyle(Address, Addresses, Lines.Value); Lines.Value.Where(l => l.OrderLine != null).Each(l => l.OrderLine.Configure(User)); ReportLines.Recalculate(); }
public void FillFrom_UnmatchedName_False() { var factory = new SoegListOutputTypeFactory(); var names = new string[] { "first1 middle1 last1", "first1 middle1 middle12 last1", "first2 middle2 last2" }; var expected = "first1 middle1 middle2 last1"; var sr = factory.Create(names); var bl = new BatchLine() { Name = expected }; var success = bl.FillFrom(sr); Assert.IsFalse(success); }
public void Mark_line() { var order = MakeOrderLine().Order; Activate(batch, order.Address); order.Frozen = true; batch.Lines.Value = new ObservableCollection <BatchLineView> { new BatchLineView(new BatchLine { ProductId = 105, Address = batch.Address }, null), }; BatchLine.CalculateStyle(batch.Address, batch.Addresses, batch.Lines.Value); Assert.IsTrue(batch.Lines.Value[0].ExistsInFreezed); Assert.IsTrue(batch.Lines.Value[0].IsCurrentAddress); }
public void Delete_line() { session.DeleteEach <BatchLine>(); var catalog = session.Query <Catalog>().First(c => !c.HaveOffers); var batchLine = new BatchLine(catalog, address); session.Save(batchLine); model.SelectedReportLines.Add(model.Lines.Value.First()); model.CurrentReportLine.Value = model.Lines.Value.First(); Assert.IsTrue(model.CanDelete); model.Delete(); Close(model); session.Clear(); Assert.IsNull(session.Get <BatchLine>(batchLine.Id)); }
public void FillFrom_Success(int index) { var factory = new SoegListOutputTypeFactory(); var names = new string[] { "first1 middle1 last1", "first1 middle1 middle12 last1", "first2 middle2 last2" }; var expected = names.First(); var names2 = names.Skip(1).ToList(); names2.Insert(index, expected); var sr = factory.Create(names2.ToArray()); var bl = new BatchLine() { Name = expected }; var success = bl.FillFrom(sr); Assert.IsTrue(success); Assert.AreEqual(expected, bl.MatchedName); }
public int Update(BatchLine pObjRecord) { pObjRecord.RowCode = GetCode(pObjRecord.Id); return(mObjBatchLineDAO.Update(pObjRecord)); }
public int Add(BatchLine pObjRecord) { return(mObjBatchLineDAO.Add(pObjRecord)); }
public FileIO(BatchLine bl) { this.batLine = bl; }
public FileIO(BatchLine bl, BatchObject bo) { this.batLine = bl; this.batObj = bo; }