public bool ComplateAcceptance(long acceptanceId, bool forceCompletion, out string errorMessage) { var acceptance = new AcceptanceOfGoods() { ReadingId = acceptanceId }; errorMessage = string.Empty; acceptance.State = StatesOfDocument.Completed; return acceptance.Write() == WritingResult.Success; }
internal static void CreateNewAcceptance(AcceptancePlan acceptancePlan) { if (!@"Створити ""Приймання товару""".Ask()) { return; } var acceptance = new AcceptanceOfGoods(); acceptance.Date = DateTime.Now; acceptance.Driver = acceptancePlan.Driver; acceptance.Car = acceptancePlan.Car; acceptance.Contractor = acceptancePlan.Contractor; acceptance.fillPlan(acceptancePlan.Date); if (acceptance.Write() != WritingResult.Success) { @"Невдала спроба запису документу ""Приймання товару""!".WarningBox(); } }
public bool WriteStickerFact(long acceptanceId, long stickerId, bool palletChanged, long cellId, long previousStickerId, long trayId, long linerId, int linersQuantity, int packsCount, int unitsCount) { if (palletChanged) { var sticker = new Stickers() { ReadingId = stickerId }; sticker.Tray = new Nomenclature() { ReadingId = trayId }; sticker.Liner = new Nomenclature() { ReadingId = linerId }; sticker.LinersQuantity = linersQuantity; sticker.Quantity = packsCount; sticker.UnitsQuantity = unitsCount; if (sticker.Write() != WritingResult.Success) { return false; } } var acceptance = new AcceptanceOfGoods() { ReadingId = acceptanceId }; var result = acceptance.WriteStickerFact(stickerId, cellId, previousStickerId, trayId, linerId, linersQuantity, packsCount, unitsCount); return result; }
public bool CreateNewAcceptance(out long newAcceptanceId) { var acceptance = new AcceptanceOfGoods() { State = StatesOfDocument.Processing, Date = SystemConfiguration.ServerDateTime }; acceptance.SetRef("Responsible", getUserId()); acceptance.Write(); newAcceptanceId = acceptance.Id; return newAcceptanceId > 0; }
private bool getAcceptanceId(long stickerId, bool setProcessingStatus, out long acceptanceId, out RowsStates rowState, out long cellId) { var q = DB.NewQuery(@"select top 1 info.IdDoc, info.NomenclatureState [State], info.NomenclatureCell from SubAcceptanceOfGoodsNomenclatureInfo info join AcceptanceOfGoods a on a.Id = info.IdDoc where a.MarkForDeleting = 0 and NomenclatureCode = @StickerCode"); q.AddInputParameter("StickerCode", stickerId); var resultObj = q.SelectRow(); acceptanceId = 0; rowState = RowsStates.PlannedAcceptance; cellId = 0; if (resultObj != null) { acceptanceId = Convert.ToInt64(resultObj[0]); rowState = (RowsStates)Convert.ToInt32(resultObj[1]); cellId = Convert.ToInt64(resultObj[2]); } bool documentFound = acceptanceId > 0; if (documentFound && setProcessingStatus) { var doc = new AcceptanceOfGoods() { ReadingId = acceptanceId }; doc.State = StatesOfDocument.Processing; doc.Write(); } return documentFound; }
internal static void CreateNewAcceptance(AcceptancePlan acceptancePlan) { if (!@"Створити ""Приймання товару""".Ask()) return; var acceptance = new AcceptanceOfGoods(); acceptance.Date = DateTime.Now; acceptance.Driver = acceptancePlan.Driver; acceptance.Car = acceptancePlan.Car; acceptance.Contractor = acceptancePlan.Contractor; acceptance.fillPlan(acceptancePlan.Date); if (acceptance.Write() != WritingResult.Success) { @"Невдала спроба запису документу ""Приймання товару""!".WarningBox(); } }