Beispiel #1
0
        private void Save()
        {
            MetadataSave met = new MetadataSave(this.current.Metadata);

            met.Call();

            Progress.Caption = "Actualizando geografía";
            Progress.Total   = 1;

            context.Data.Session.SaveOrUpdate(current);

            Progress.Increment();
        }
Beispiel #2
0
        public override void Call()
        {
            Progress.Caption = "Actualizando límite";
            Progress.Total   = 1;
            var meta = new MetadataSave(current.Metadata);

            meta.Call();

            if (current.Id.HasValue && current.BoundaryClippingRegions.Count > 0)
            {
                //string deleteRelations = "DELETE FROM boundary_clipping_region WHERE bcr_boundary_id = " + current.Id.Value.ToString();
                //context.Data.Session.SqlActions.ExecuteNonQuery(deleteRelations);
                List <BoundaryClippingRegion> tmp = new List <BoundaryClippingRegion>();
                tmp.AddRange(current.BoundaryClippingRegions);
                current.BoundaryClippingRegions.Clear();
                context.Data.Session.SaveOrUpdate(current);
                context.Data.Session.Flush();
                foreach (var c in tmp)
                {
                    current.BoundaryClippingRegions.Add(c);
                }
            }
            context.Data.Session.SaveOrUpdate(current);
        }