예제 #1
0
        public async Task <bool> Add(AuditPicMDto model)
        {
            var auditPicM = _mapper.Map <MES_Audit_PIC_M>(model);

            _repo.Add(auditPicM);
            return(await _repo.SaveAll());
        }
예제 #2
0
        public async Task <bool> Add(AuditPicMDto model)
        {
            var auditPicM = _mapper.Map <MES_Audit_PIC_M>(model);
            //Get max ID
            int maxID = _repo.FindAll().Select(x => x.PIC_Type_ID).Select(int.Parse).ToList().Max();

            auditPicM.PIC_Type_ID = (maxID + 1).ToString();
            _repo.Add(auditPicM);
            return(await _repo.SaveAll());
        }
예제 #3
0
        public async Task <bool> Add(AuditPicMDto model)
        {
            var auditPicM = _mapper.Map <MES_Audit_PIC_M>(model);

            //Get max ID
            try
            {
                int maxID = _repoPicM.FindAll().Select(x => x.PIC_Type_ID).Select(int.Parse).ToList().Max();
                auditPicM.PIC_Type_ID = (maxID + 1).ToString();
            }
            catch (System.Exception ex)
            {
                throw ex;
            }

            _repoPicM.Add(auditPicM);
            return(await _repoPicM.SaveAll());
        }