コード例 #1
0
        internal static String Save(DB.SYS_Person entry, DataContext dataContext)
        {
            try
            {
                if (dataContext.EntitySystemContext.GetEntityState(entry) == EntityState.Detached)
                {
                    dataContext.EntitySystemContext.SYS_Person.Add(entry);
                }

                Validation.ValidateEntity(dataContext.EntitySystemContext, entry);
            }
            catch (Validation.EntityValidationException ex)
            {
                return(dataContext.PackageValidationException());
            }

            return("Success");
        }
コード例 #2
0
 public static DB.SYS_Person GetPreviousItem(DB.SYS_Person SYS_Person, DataContext dataContext)
 {
     return(dataContext.EntitySystemContext.SYS_Person.OrderByDescending(o => o.Fullname).FirstOrDefault(n => n.Fullname.CompareTo(SYS_Person.Fullname) < 0 && n.Fullname.CompareTo(SYS_Person.Fullname) != 0));
 }