public void RemoveExtraValue(CMSDataContext db, string field) { var ev = FamilyExtras.AsEnumerable().FirstOrDefault(ee => string.Compare(ee.Field, field, ignoreCase: true) == 0); if (ev != null) { db.FamilyExtras.DeleteOnSubmit(ev); } }
public FamilyExtra GetExtraValue(string field) { if (!field.HasValue()) { field = "blank"; } //field = field.Replace(",", "_"); var ev = FamilyExtras.AsEnumerable().FirstOrDefault(ee => string.Compare(ee.Field, field, ignoreCase: true) == 0); if (ev == null) { ev = new FamilyExtra { FamilyId = FamilyId, Field = field, TransactionTime = DateTime.Now }; FamilyExtras.Add(ev); } return(ev); }
public FamilyExtra GetExtraValue(string field) { if (!field.HasValue()) { field = "blank"; } field = field.Trim(); var ev = FamilyExtras.AsEnumerable().FirstOrDefault(ee => ee.Field == field); if (ev == null) { ev = new FamilyExtra { FamilyId = FamilyId, Field = field, TransactionTime = DateTime.Now }; FamilyExtras.Add(ev); } return(ev); }