コード例 #1
0
        public bool DeleteGroup(string cn, DataAccessLayer dal, bool deletePoints)
        {
            if (Groups.ContainsKey(cn))
            {
                List<TtPoint> points = dal.GetPointsInGroup(cn);

                if (deletePoints)
                {
                    dal.DeletePointsInGroup(cn);
                }
                else
                {
                    for (int i = 0; i < points.Count; i++)
                    {
                        points[i].GroupCN = MainGroup.CN;
                        points[i].GroupName = MainGroup.Name;
                    }

                    dal.SavePoints(points, points);
                }

                _Groups.Remove(cn);

                return dal.DeleteGroup(cn);
            }

            return false;
        }