Exemple #1
0
        public static bool SetProductSpecDefectStat(tblLot oldLot, IEnumerable <LotAttribute> lotAttributes, IEnumerable <IAttributeRange> productSpec, IEnumerable <IAttributeDefect> lotAttributeDefects)
        {
            var specDefects   = GetProductSpecDefects(lotAttributes, productSpec, lotAttributeDefects);
            var defectLotStat = GetLotStatHelper.GetProductSpecDefectStat(specDefects);

            if (defectLotStat != null)
            {
                oldLot.LotStat = (int?)defectLotStat.LotStat;
                if (defectLotStat.LotStat == LotStat.See_Desc && !string.IsNullOrWhiteSpace(defectLotStat.Description))
                {
                    if (string.IsNullOrWhiteSpace(oldLot.Notes))
                    {
                        oldLot.Notes = defectLotStat.Description;
                    }
                    else if (!oldLot.Notes.ToUpper().Contains(defectLotStat.Description.ToUpper()))
                    {
                        oldLot.Notes = string.Format("{0} / {1}", oldLot.Notes, defectLotStat.LotStat);
                    }
                }

                return(true);
            }

            return(false);
        }
Exemple #2
0
        public static bool SetLotHoldStatus(tblLot oldLot, Lot newLot)
        {
            var lotStat = GetLotStatHelper.GetHoldLotStat(newLot.Hold, newLot.ProductionStatus);

            if (lotStat != null)
            {
                oldLot.LotStat = (int)lotStat.Value;
                return(true);
            }

            return(false);
        }
Exemple #3
0
        public static bool SetInHouseContamination(tblLot oldLot, Lot newLot)
        {
            var inHouseResult = GetLotStatHelper.GetInHouseContaminationLotStat(newLot.LotDefects);

            if (inHouseResult != null)
            {
                oldLot.LotStat = (int?)inHouseResult.LotStat;
                if (inHouseResult.LotStat == LotStat.See_Desc)
                {
                    oldLot.Notes = inHouseResult.Description;
                }
                return(true);
            }

            return(false);
        }