示例#1
0
        public void Delete(int QCCmmReportID)
        {
            QCCmmReport _report = _context.QCCmmReports.Find(QCCmmReportID);

            _report.Enabled = false;
            _context.SaveChanges();
        }
示例#2
0
        public int Save(QCCmmReport Report)
        {
            QCCmmReport _dbEntry = null;
            bool        _isNew   = false;

            if (Report.QCCmmReportID == 0)
            {
                _isNew = true;
                _context.QCCmmReports.Add(Report);
            }
            else
            {
                _dbEntry = QueryByReportID(Report.QCCmmReportID);
                if (_dbEntry != null)
                {
                    _dbEntry.QCTaskID       = Report.QCTaskID;
                    _dbEntry.ReportName     = Report.ReportName;
                    _dbEntry.CreateBy       = Report.CreateBy;
                    _dbEntry.CreateComputer = Report.CreateComputer;
                    _dbEntry.CreateDate     = Report.CreateDate;
                    _dbEntry.Enabled        = Report.Enabled;
                    _dbEntry.ReportType     = Report.ReportType;
                }
            }
            _context.SaveChanges();
            if (_isNew)
            {
                return(Report.QCCmmReportID);
            }
            else
            {
                return(_dbEntry.QCCmmReportID);
            }
        }
示例#3
0
        public QCCmmReport QueryByReportID(int ReportID)
        {
            QCCmmReport _report = _context.QCCmmReports.Find(ReportID);

            return(_report);
        }