コード例 #1
0
        public IActionResult SaveLicenseMessage(AppLicenseMessageDTO model)
        {
            if (ModelState.IsValid)
            {
                _trlAppProcessService.SaveLicenseMessage(model);
                return(Json(new { success = true }));
            }

            return(PartialView("_ModalTrlLicenseMessageEdit", model));
        }
コード例 #2
0
        public IActionResult ModalLicenseMessage(Guid appId)
        {
            var licenseMsg = _commonDataService.GetDto <AppLicenseMessageDTO>(p => p.AppId == appId).SingleOrDefault();

            if (licenseMsg != null)
            {
                return(NotFound());
            }

            licenseMsg = new AppLicenseMessageDTO {
                AppId = appId, Id = Guid.Empty
            };

            return(PartialView("_ModalTrlLicenseMessageEdit", licenseMsg));
        }
コード例 #3
0
        public void SaveLicenseMessage(AppLicenseMessageDTO model)
        {
            var trl = _dataService.GetEntity <TrlApplication>(p => p.Id == model.AppId).SingleOrDefault();

            if (trl == null || string.IsNullOrEmpty(trl.ExpertiseResult) || trl.AppDecisionId == null)
            {
                return;
            }

            var licenseMsg = _dataService.GetEntity <AppLicenseMessage>(p => p.Id == model.Id).SingleOrDefault();

            if (licenseMsg != null)
            {
                return;
            }

            licenseMsg = new AppLicenseMessage();
            _objectMapper.Map(model, licenseMsg);
            licenseMsg.Performer = model.PerformerId;
            licenseMsg.OldLimsId = _limsExchangeService.ExportLimsMessageTRL(licenseMsg).Result;
            licenseMsg.State     = "Підготовка";
            _dataService.Add(licenseMsg);
            _dataService.SaveChanges();
        }