Пример #1
0
 /// <summary>
 ///     update an testvalue
 /// </summary>
 /// <param name="testValue">the testvalue which will be updated</param>
 public TestValue UpdateTestValue(TestValue testValue)
 {
     TestSheetRepository.SaveChanges();
     return(testValue);
 }
Пример #2
0
 /// <summary>
 ///     Updates the TestSheet
 /// </summary>
 public Int32 UpdateTestSheet() => TestSheetRepository.SaveChanges();
Пример #3
0
        /// <summary>
        ///     Initializes a new testsheet for the faNr and the current date
        /// </summary>
        /// <param name="faNr">the production order number</param>
        /// <returns>the initialized testsheet</returns>
        public TestSheet InitTestSheetForFaNr(String faNr)
        {
            var productionOrder = ProductionOrderRepository.GetAll()
                                  .FirstOrDefault(order => order.FaNr == faNr);

            if (productionOrder == null)
            {
                Logger.Error("Fanr " + faNr + " not found in Production Order");
                return(null);
            }
            var shift = ShiftHelper.GetCurrentShift();

            if (shift == null)
            {
                return(null);
            }

            var testvalues = new List <TestValue>();

            if (productionOrder.Article.ArticleType == ArticleType.BabyDiaper)
            {
                testvalues = new List <TestValue>
                {
                    CreateDefaultTestValueBabyDiaper(TestValueType.Average, TestTypeBabyDiaper.Retention),
                    CreateDefaultTestValueBabyDiaper(TestValueType.Average, TestTypeBabyDiaper.Rewet),
                    CreateDefaultTestValueBabyDiaper(TestValueType.Average, TestTypeBabyDiaper.RewetAndPenetrationTime),
                    CreateDefaultTestValueBabyDiaper(TestValueType.StandardDeviation, TestTypeBabyDiaper.Retention),
                    CreateDefaultTestValueBabyDiaper(TestValueType.StandardDeviation, TestTypeBabyDiaper.Rewet),
                    CreateDefaultTestValueBabyDiaper(TestValueType.StandardDeviation, TestTypeBabyDiaper.RewetAndPenetrationTime)
                }
            }
            ;
            if (productionOrder.Article.ArticleType == ArticleType.IncontinencePad)
            {
                testvalues = new List <TestValue>
                {
                    CreateDefaultTestValueIncontinencePad(TestValueType.StandardDeviation, TestTypeIncontinencePad.AcquisitionTimeAndRewet),
                    CreateDefaultTestValueIncontinencePad(TestValueType.StandardDeviation, TestTypeIncontinencePad.Retention),
                    CreateDefaultTestValueIncontinencePad(TestValueType.StandardDeviation, TestTypeIncontinencePad.RewetFree),
                    CreateDefaultTestValueIncontinencePad(TestValueType.Average, TestTypeIncontinencePad.AcquisitionTimeAndRewet),
                    CreateDefaultTestValueIncontinencePad(TestValueType.Average, TestTypeIncontinencePad.Retention),
                    CreateDefaultTestValueIncontinencePad(TestValueType.Average, TestTypeIncontinencePad.RewetFree)
                }
            }
            ;

            var testSheet = new TestSheet
            {
                ArticleType     = productionOrder.Article.ArticleType,
                ShiftType       = shift.Value,
                FaNr            = productionOrder.FaNr,
                TestValues      = testvalues,
                CreatedDateTime = DateTime.Now,
                SizeName        = productionOrder.Article.SizeName,
                ProductName     = productionOrder.Article.ProductName,
                DayInYear       = DateTime.Now.DayOfYear,
                MachineNr       = productionOrder.Machine.MachineNr,
                SAPNr           = productionOrder.Component?.ComponentNr,
                SAPType         = productionOrder.Component?.ComponentType
            };

            TestSheetRepository.Add(testSheet);
            TestSheetRepository.SaveChanges();

            return(testSheet);
        }

        #endregion

        #region Implementation of ILaborCreatorBll

        #endregion
    }
}