示例#1
0
        public void Delete(RecoveryIntervalsDTO entity)
        {
            var item = new RecoveryInterval
            {
                HOLEID        = entity.HOLEID,
                PROJECTCODE   = entity.PROJECTCODE,
                GEOLFROM      = entity.GEOLFROM,
                GEOLTO        = entity.GEOLTO,
                PRIORITY      = entity.PRIORITY,
                Recovery_m    = entity.Recovery_m,
                RecovGeo      = entity.RecovGeo,
                RecovGeoDate  = entity.RecovGeoDate,
                CoreLength    = entity.CoreLength,
                RecoveryRatio = entity.RecoveryRatio,
                ID            = entity.ID
            };

            dbSet.Remove(item);
        }
示例#2
0
        public void Put(RecoveryIntervalsDTO entity)
        {
            var item = new RecoveryInterval
            {
                HOLEID        = entity.HOLEID,
                PROJECTCODE   = entity.PROJECTCODE,
                GEOLFROM      = entity.GEOLFROM,
                GEOLTO        = entity.GEOLTO,
                PRIORITY      = entity.PRIORITY,
                Recovery_m    = entity.Recovery_m,
                RecovGeo      = entity.RecovGeo,
                RecovGeoDate  = entity.RecovGeoDate,
                CoreLength    = entity.CoreLength,
                RecoveryRatio = entity.RecoveryRatio,
                ID            = entity.ID
            };

            context.Entry(item).State = EntityState.Modified;
        }
示例#3
0
        public void UpdateAll(IList <RecoveryIntervalsDTO> entity)
        {
            foreach (var item in entity)
            {
                var interval = new RecoveryInterval
                {
                    HOLEID        = item.HOLEID,
                    PROJECTCODE   = item.PROJECTCODE,
                    GEOLFROM      = item.GEOLFROM,
                    GEOLTO        = item.GEOLTO,
                    PRIORITY      = item.PRIORITY,
                    Recovery_m    = item.Recovery_m,
                    RecovGeo      = item.RecovGeo,
                    RecovGeoDate  = item.RecovGeoDate,
                    CoreLength    = item.CoreLength,
                    RecoveryRatio = item.RecoveryRatio,
                    ID            = item.ID
                };

                dbSet.Attach(interval);
                context.Entry(interval).State = EntityState.Modified;
            }
        }