Beispiel #1
0
        public bool RemoveGLQADetectionPointByID(int QADetectionPointID)
        {
            IQueryable <GL_QADetectionPoint> result = gL_QADetectionPointRepository.GetMany(
                x => x.QADetectionPointID == QADetectionPointID);

            if (result.Count() > 0)
            {
                GL_QADetectionPoint entity = result.First();
                gL_QADetectionPointRepository.Delete(entity);
                unitOfWork.Commit();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        public string AddOrEditGL_QADetectionPoint(GL_QADetectionPointDTO dto)
        {
            string errorMessage = string.Empty;

            try
            {
                GL_QADetectionPoint entityContext;
                if (dto.QADetectionPointID == 0)
                {
                    entityContext               = new GL_QADetectionPoint();
                    entityContext.StationID     = dto.StationID;
                    entityContext.WIP           = dto.WIP;
                    entityContext.ScanIN        = dto.ScanIN;
                    entityContext.ScanOUT       = dto.ScanOUT;
                    entityContext.ScanNG        = dto.ScanNG;
                    entityContext.ScanBACK      = dto.ScanBACK;
                    entityContext.IsEnabled     = dto.IsEnabled;
                    entityContext.Modified_UID  = dto.Modified_UID;
                    entityContext.Modified_Date = dto.Modified_Date;
                    gL_QADetectionPointRepository.Add(entityContext);
                    unitOfWork.Commit();
                }
                else
                {
                    entityContext               = gL_QADetectionPointRepository.GetById(dto.QADetectionPointID);
                    entityContext.StationID     = dto.StationID;
                    entityContext.WIP           = dto.WIP;
                    entityContext.ScanIN        = dto.ScanIN;
                    entityContext.ScanOUT       = dto.ScanOUT;
                    entityContext.ScanNG        = dto.ScanNG;
                    entityContext.ScanBACK      = dto.ScanBACK;
                    entityContext.IsEnabled     = dto.IsEnabled;
                    entityContext.Modified_UID  = dto.Modified_UID;
                    entityContext.Modified_Date = dto.Modified_Date;
                    gL_QADetectionPointRepository.Update(entityContext);
                    unitOfWork.Commit();
                }

                return("0");
            }
            catch (Exception ex)
            {
                errorMessage = ex.Message;
                return(ex.Message);
            }
        }