public async Task<ImportError> AddSpecialFeature(ImportQueueFilter filter, FdpSpecialFeature specialFeature) { await Task.FromResult(_featureDataStore.FdpSpecialFeatureSave(specialFeature)); return await Task.FromResult(_importDataStore.ImportErrorGet(filter)); }
public FdpSpecialFeature FdpSpecialFeatureSave(FdpSpecialFeature specialFeature) { FdpSpecialFeature retVal = new EmptyFdpSpecialFeature(); using (IDbConnection conn = DbHelper.GetDBConnection()) { try { var para = DynamicParameters.FromCDSId(CurrentCDSID); para.Add("@FeatureCode", specialFeature.FeatureCode, DbType.String); para.Add("@FdpSpecialFeatureTypeId", specialFeature.Type.FdpSpecialFeatureTypeId, DbType.Int32); para.Add("@DocumentId", specialFeature.DocumentId, DbType.Int32); retVal = conn.Query<FdpSpecialFeature>("dbo.Fdp_SpecialFeatureMapping_Save", para, commandType: CommandType.StoredProcedure).FirstOrDefault(); } catch (Exception ex) { Log.Error(ex); throw; } } return retVal; }
public async Task<ActionResult> AddSpecialFeature(ImportExceptionParameters parameters) { var filter = ImportQueueFilter.FromExceptionId(parameters.ExceptionId.Value); var importView = await GetModelFromParameters(parameters); var importFeatures = (IEnumerable<string>)TempData["AddSpecialFeature"]; foreach (var importFeature in importFeatures) { var specialFeature = new FdpSpecialFeature() { DocumentId = parameters.DocumentId.GetValueOrDefault(), ProgrammeId = parameters.ProgrammeId.GetValueOrDefault(), Gateway = parameters.Gateway, FeatureCode = importFeature, Type = new FdpSpecialFeatureType() { FdpSpecialFeatureTypeId = parameters.SpecialFeatureTypeId } }; await DataContext.Import.AddSpecialFeature(filter, specialFeature); } await DeactivateException(importView.CurrentException); await ReProcessException(importView.CurrentException); return Json(JsonActionResult.GetSuccess(), JsonRequestBehavior.AllowGet); }