public IEnumerable <DetectionMethodFormDO> GetAll() { List <DetectionMethodFormDO> lstDetectionMethodFormDO = new List <DetectionMethodFormDO>(); try { using (SqlConnection connection = new SqlConnection(FMEADBConnectionstring)) { using (SqlCommand command = new SqlCommand()) { command.Connection = connection; command.CommandText = "FMEA_SP_GetAllDetectionFormRecords"; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandTimeout = FMEADBTimeout; connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { DetectionMethodFormDO dmf = new DetectionMethodFormDO() { Detection_ID = reader.GetInt32(reader.GetOrdinal(FMEAConstants.Detection_ID)), Product_Class = reader.IsDBNull(reader.GetOrdinal(FMEAConstants.Product_Class)) ? null : reader.GetString(reader.GetOrdinal(FMEAConstants.Product_Class)), Product_Characteristic_ID = reader.GetInt32(reader.GetOrdinal(FMEAConstants.Product_Characteristic_ID)), Site = reader.IsDBNull(reader.GetOrdinal(FMEAConstants.Site)) ? null : reader.GetString(reader.GetOrdinal(FMEAConstants.Site)), Escape_ID = reader.GetDouble(reader.GetOrdinal(FMEAConstants.Escape_ID)), Detection_Master_ID = reader.GetInt32(reader.GetOrdinal(FMEAConstants.Detection_Master_ID)), Detection_Method = reader.IsDBNull(reader.GetOrdinal(FMEAConstants.Detection_Method)) ? null : reader.GetString(reader.GetOrdinal(FMEAConstants.Detection_Method)), PD_Characteristics_Desc = reader.IsDBNull(reader.GetOrdinal(FMEAConstants.PD_Characteristics_Desc)) ? null : reader.GetString(reader.GetOrdinal(FMEAConstants.PD_Characteristics_Desc)), Escape_Description = reader.IsDBNull(reader.GetOrdinal(FMEAConstants.Escape_Description)) ? null : reader.GetString(reader.GetOrdinal(FMEAConstants.Escape_Description)), Escape_ID_Description = reader.IsDBNull(reader.GetOrdinal(FMEAConstants.Escape_ID_Description)) ? null : reader.GetString(reader.GetOrdinal(FMEAConstants.Escape_ID_Description)), }; lstDetectionMethodFormDO.Add(dmf); } } } } catch (Exception) { throw; } return(lstDetectionMethodFormDO.OrderBy(r => r.PD_Characteristics_Desc)); }
protected override async Task OnInitializedAsync() { DetectionMethodFormDO = (await DetectionMethodDataService.GetDetectionMethodFormDOs()).Where(x => x.Detection_ID == int.Parse(DetectionId)).FirstOrDefault(); }