Exemple #1
0
        public static SequencesDO GetSequenceDO(Sequence sequence)
        {
            SequencesDO sequenceDO = new SequencesDO()
            {
                ID           = sequence.id,
                SequenceDesc = sequence.name
            };

            return(sequenceDO);
        }
Exemple #2
0
        public static Sequence GetSequence(SequencesDO sequenceDO)
        {
            Sequence sequence = new Sequence(sequenceDO.ID, sequenceDO.SequenceDesc, "");

            //            {
            //                id = sequenceDO.ID,
            //                name = sequenceDO.SequenceDesc
            //  };
            return(sequence);
        }
Exemple #3
0
        public int DeleteInspection(Sequence sequence)
        {
            int result = 0;

            try
            {
                SequencesDO sequencesDO = Converter.GetSequenceDO(sequence);
                result = sequencenRepository.DeleteEntity(sequencesDO.ID);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception Occured in DeleteInspection method due to " + ex.Message);
            }
            return(result);
        }
Exemple #4
0
        public int SaveSequences(Sequence sequence)
        {
            int result = 0;

            try
            {
                SequencesDO sequencesDO = Converter.GetSequenceDO(sequence);
                result = sequencenRepository.SaveEntity(sequencesDO);
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception Occured in SaveSequences method due to " + ex.Message);
            }
            return(result);
        }
Exemple #5
0
        public static IEnumerable <SequencesDO> GetMasterSequenceDO(IEnumerable <Model.ServiceModel.MasterSequence> sequences)
        {
            List <SequencesDO> sequenceDO = new List <SequencesDO>();

            foreach (var seq in sequences)
            {
                SequencesDO seqDO = new SequencesDO()
                {
                    ID           = seq.SequenceID,
                    SequenceDesc = seq.SequenceDesc,
                    Priority     = seq.Priority
                };
                sequenceDO.Add(seqDO);
            }
            return(sequenceDO);
        }
Exemple #6
0
        public Sequence GetSequence(int sequenceID)
        {
            Sequence sequence = new Sequence();

            try
            {
                SequencesDO sequencesDO = sequencenRepository.GetEntity(sequenceID);
                if (sequencesDO != null)
                {
                    sequence = Converter.GetSequence(sequencesDO);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Exception Occured in GetSequence method due to " + ex.Message);
            }
            return(sequence);
        }
Exemple #7
0
        /// <summary>
        /// Gets the inspection detail.
        /// </summary>
        /// <returns>The inspection detail.</returns>
        /// <param name="inspection">Inspection.</param>
        /// <param name="IsImageNeeded">If set to <c>true</c> is image needed.</param>
        public Inspection GetInspectionDetail(Inspection inspection, bool IsImageNeeded)
        {
            using (Inspection ins = inspection)
            {
                try
                {
                    this.IsImageNeeded = IsImageNeeded;
                    var inspectionDesc = inspectionService.GetInspections().Where(i => i.inspectionID == inspection.inspectionID).FirstOrDefault();
                    if (inspectionDesc != null)
                    {
                        var inspectionTraansaction = inspectionTransactionService.GetInspectionTransactions().Where(i => i.inspectionID == inspection.inspectionID && i.projectID == inspection.projectID && i.appID == inspection.appID);
                        if (inspectionTraansaction != null && inspectionTraansaction.Count() > 0)
                        {
                            ins.ID = inspectionTraansaction.FirstOrDefault().ID;

                            //ins.InspectionStarted = inspectionTraansaction.FirstOrDefault().InspectionStarted;
                        }
                        inspectionTransactionID = ins.ID;
                        GetInspectionDetails(int.Parse(inspection.inspectionID), ins);
                        inspection.InspectionType = ins.InspectionType;

                        var punchsequenceID = ins.sequences.Where(i => i.id == BALConstant.PUNCH_SEQUENCEID);

                        if (punchsequenceID == null || punchsequenceID.Count() <= 0)
                        {
                            if (inspection.inspectionID == BALConstant.FINAL_INSPECTIONID)
                            {
                                Sequence    punchsequence = new Sequence();
                                SequencesDO seq           = SequencesDO.getPunchListSequenceForInspection(conn, BALConstant.PUNCH_SEQUENCEID).FirstOrDefault();
                                if (seq != null)
                                {
                                    punchsequence.id      = seq.ID;
                                    punchsequence.name    = seq.SequenceDesc;
                                    punchsequence.Options = getPunchListForSeq(BALConstant.FINAL_INSPECTIONID, inspection.projectID, ins.ID);
                                }

                                if (punchsequence != null && punchsequence.Options != null && punchsequence.Options.Count > 0)
                                {
                                    if (punchsequence.Options[0].checkListItems != null && punchsequence.Options[0].checkListItems.Count > 0)
                                    {
                                        ins.sequences.Insert(0, punchsequence);
                                    }
                                }
                            }
                        }
                    }
                    if (ins != null)
                    {
                        ins.locationIDImages = new List <byte[]> ();
                        var images = LocationImageDo.getImageForLocationIdentification(conn, ins.ID);
                        if (images != null && images.Count > 0)
                        {
                            foreach (var img in images)
                            {
                                ins.locationIDImages.Add(img.Image);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Exception Occured in GetInspectionDetail method due to " + ex.Message);
                }
                return(ins);
            }
        }