private bool createNewCell(int floor, int row, int rack, int storey, int position) { var q = DB.NewQuery(@" Select top 1 Id from Cells where MarkForDeleting = 0 and Floor = @Floor and [Row] = @Row and Rack = @Rack and Storey = @Storey and Position = @Position"); q.AddInputParameter("Row", row); q.AddInputParameter("Rack", rack); q.AddInputParameter("Floor", floor); q.AddInputParameter("Storey", storey); q.AddInputParameter("Position", position); if (q.SelectInt64() > 0) return false; var newCell = new Cells() { Floor = floor, Row = row, Rack = rack, Storey = storey, Position = position, ParentId = ParentOfCell, TypeOfCell = TypeOfCell }; newCell.UpdateDescription(Prefix); var writeResult = newCell.Write(); return writeResult == WritingResult.Success; }
private Cells findPalletCell(long stickerId) { var q = DB.NewQuery("SELECT Top 1 Cell FROM [FMCG].[dbo].[GetStockBalance] ('0001-01-01', 0,0,2,0, @StickerId)"); q.AddInputParameter("StickerId", stickerId); long cellId = q.SelectToList<long>().FirstOrDefault(); var cell = new Cells() { ReadingId = cellId }; return cell; }
private void addWareRow(Stickers sticker, Cells cell, Nomenclature nomenclature, int quantity, long partyId) { if (quantity > 0 && !nomenclature.Empty) { var row = NomenclatureInfo.GetNewRow(this); row[Nomenclature] = nomenclature.Id; row[NomenclaturePlan] = quantity; row[NomenclatureParty] = partyId; row[NomenclatureCode] = sticker.Id; row[NomenclatureCell] = cell.Id; row.AddRowToTable(this); } }