Exemple #1
0
        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);
            }
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }