Exemple #1
0
        public static bool IsIntersectByYearAndWorld(PersonMinMax a, PersonMinMax b)
        {
            if (a == null || b == null) throw new NullReferenceException();
            bool isintersect = false;

            if (a.ID != b.ID)// don't compare with self
            {
                if (a.Year == b.Year && a.Store_WorldID == b.Store_WorldID)
                {
                    isintersect = true;
                }
            }

            return isintersect;
        }
Exemple #2
0
        public static bool IsIntersectByYearAndWorld(PersonMinMax a, PersonMinMax b)
        {
            if (a == null || b == null)
            {
                throw new NullReferenceException();
            }
            bool isintersect = false;

            if (a.ID != b.ID)// don't compare with self
            {
                if (a.Year == b.Year && a.Store_WorldID == b.Store_WorldID)
                {
                    isintersect = true;
                }
            }

            return(isintersect);
        }
        public override bool Commit()
        {
            if (IsModified())
            {
                try
                {

                    PersonMinMax newentity = new PersonMinMax();
                    PersonMinMax.CopyTo(PersonMinMax, newentity);
                    newentity.Year = Year;
                    newentity.Max = PersonMax;
                    newentity.Min = PersonMin;
                    newentity = ClientEnvironment.PersonMinMaxService.SaveOrUpdate(newentity);
                    PersonMinMax.CopyTo(newentity, PersonMinMax);
                    Modified = true;
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(ex.Message);
                    return false;
                }
            }
            return true;
        }