Example #1
0
        internal static String Save(DB.SYS_Abbreviation entry, DataContext dataContext)
        {
            try
            {
                if (dataContext.EntitySystemContext.GetEntityState(entry) == System.Data.Entity.EntityState.Detached)
                {
                    dataContext.EntitySystemContext.SYS_Abbreviation.Add(entry);
                }
            }
            catch (System.Data.Entity.Validation.DbEntityValidationException ex)
            {
                return(dataContext.PackageValidationException());
            }

            return("Success");
        }
Example #2
0
 public static DB.SYS_Abbreviation GetPreviousItem(DB.SYS_Abbreviation SYS_Abbreviation, DataContext dataContext)
 {
     return(dataContext.EntitySystemContext.SYS_Abbreviation.OrderByDescending(o => o.Abbreviation).FirstOrDefault(n => n.Abbreviation.CompareTo(SYS_Abbreviation.Abbreviation) < 0 && n.Abbreviation.CompareTo(SYS_Abbreviation.Abbreviation) != 0));
 }