public object GetValue(string NameValue) { Type typeValue = Types[NameValue]; object ret; try { if (typeValue == typeof(DateTime)) { ret = Convert.ChangeType ( Attr_item.FirstOrDefault(val => val.Attr_name == NameValue).Value, typeValue, new CultureInfo("Ru-ru") ); } else { ret = Convert.ChangeType ( Attr_item.FirstOrDefault(val => val.Attr_name == NameValue).Value, typeValue, CultureInfo.InvariantCulture ); } } catch (Exception) { ret = null; } return(ret); }
public string Print() => $"Art_listArt_item: Art_id={Art_id}, Designation={Designation}, Name={Name}, Section_id={Section_id}\r\n\t" + string.Join("\r\n\t", Attr_item.Select(item => item.Print()));