public async Task <ActionResult> MapOxoTrim(ImportExceptionParameters parameters) { var filter = ImportQueueFilter.FromExceptionId(parameters.ExceptionId.GetValueOrDefault()); var trim = ModelTrim.FromIdentifier(parameters.TrimIdentifier); var importView = await GetModelFromParameters(parameters); var importTrimLevels = (IEnumerable <string>)TempData["MapOxoTrim"]; foreach (var importTrimLevel in importTrimLevels) { var trimMapping = new FdpTrimMapping() { ImportTrim = importTrimLevel, DocumentId = parameters.DocumentId.GetValueOrDefault(), ProgrammeId = parameters.ProgrammeId.GetValueOrDefault(), Gateway = parameters.Gateway, TrimId = trim.Id }; await DataContext.Import.MapTrim(filter, trimMapping); } await DeactivateException(importView.CurrentException); await ReProcessException(importView.CurrentException); return(Json(JsonActionResult.GetSuccess(), JsonRequestBehavior.AllowGet)); }
public Programme Programme(ModelTrim trim) { ProgrammeDataStore ds = new ProgrammeDataStore("system"); Programme retVal = new Programme(); retVal = ds.ProgrammeGet(trim.ProgrammeId); return(retVal); }
public static string GetDisplayString(this ModelTrim trim) { if (!string.IsNullOrEmpty(trim.DPCK)) { return(string.Format("{0} - {1} ({2})", trim.Name, trim.Level, trim.DPCK)); } return(string.Format("{0} - {1}", trim.Name, trim.Level)); }
public bool ModelTrimSave(ModelTrim obj) { bool retVal = true; string procName = (obj.IsNew ? "dbo.OXO_ModelTrim_New" : "dbo.OXO_ModelTrim_Edit"); using (IDbConnection conn = DbHelper.GetDBConnection()) { try { obj.Save(CurrentCDSID); var para = new DynamicParameters(); para.Add("@p_Programme_Id", obj.ProgrammeId, DbType.Int32); para.Add("@p_Name", obj.Name, DbType.String, size: 500); para.Add("@p_Abbreviation", obj.Abbreviation, DbType.String, size: 50); para.Add("@p_Level", obj.Level, DbType.String, size: 500); para.Add("@p_DPCK", obj.DPCK, DbType.String, size: 10); para.Add("@p_Active", obj.Active, DbType.Boolean); if (obj.IsNew) { para.Add("@p_Created_By", obj.CreatedBy, DbType.String, size: 8); para.Add("@p_Created_On", obj.CreatedOn, DbType.DateTime); } para.Add("@p_Updated_By", obj.UpdatedBy, DbType.String, size: 8); para.Add("@p_Last_Updated", obj.LastUpdated, DbType.DateTime); para.Add("@p_Id", obj.Id, DbType.Int32, ParameterDirection.InputOutput); conn.Execute(procName, para, commandType: CommandType.StoredProcedure); if (obj.Id == 0) { obj.Id = para.Get <int>("@p_Id"); } } catch (Exception ex) { Log.Error(ex); throw; } } return(retVal); }
public ModelTrim ModelTrimGet(int id) { ModelTrim retVal = null; using (IDbConnection conn = DbHelper.GetDBConnection()) { try { var para = new DynamicParameters(); para.Add("@p_Id", id, DbType.Int32); retVal = conn.Query <ModelTrim>("dbo.OXO_ModelTrim_Get", para, commandType: CommandType.StoredProcedure).FirstOrDefault(); } catch (Exception ex) { Log.Error(ex); throw; } } return(retVal); }