public static tencoderdevice UpdateEncoderDevice(tencoderdevice post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return post;
        }
        public static tchannel_ppoint CreateChannelPPointAccess(tchannel_ppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.tchannel_ppoint.Add(post);
                context.SaveChanges();
            }

            return post;
        }
Exemple #3
0
        public static channel UpdateChannel(channel post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return(post);
        }
Exemple #4
0
        public static tencoderdevice UpdateEncoderDevice(tencoderdevice post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return(post);
        }
        public static tppointstatu CreatePPointStatus(tppointstatu post)
        {
            using (vEntities context = new vEntities())
            {
                context.tppointstatus.Add(post);
                context.SaveChanges();
            }

            return(post);
        }
        public static tdevicechannelaccess UpdateDeviceChannelAccess(tdevicechannelaccess post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return(post);
        }
        public static tppointstatu UpdatePPointStatus(tppointstatu post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return(post);
        }
Exemple #8
0
        public static tchannel_ppoint UpdateChannelPPointAccess(tchannel_ppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return(post);
        }
Exemple #9
0
        public static channel CreateChannel(channel post)
        {
            using (vEntities context = new vEntities())
            {
                context.channels.Add(post);
                context.SaveChanges();
            }

            return(post);
        }
        public static tdevicechannelaccess CreateDeviceChannelAccess(tdevicechannelaccess post)
        {
            using (vEntities context = new vEntities())
            {
                context.tdevicechannelaccesses.Add(post);
                context.SaveChanges();
            }

            return post;
        }
        public static tppoint CreatePPoint(tppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.tppoints.Add(post);
                context.SaveChanges();
            }

            return post;
        }
        public static tencoderdevice CreateEncoderDevice(tencoderdevice post)
        {
            using (vEntities context = new vEntities())
            {
                context.tencoderdevices.Add(post);
                context.SaveChanges();
            }

            return post;
        }
        public static tdevicechannelaccess CreateDeviceChannelAccess(tdevicechannelaccess post)
        {
            using (vEntities context = new vEntities())
            {
                context.tdevicechannelaccesses.Add(post);
                context.SaveChanges();
            }

            return(post);
        }
        public static tppointstatu UpdatePPointStatus(tppointstatu post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return post;
        }
Exemple #15
0
        public static tencoderdevice CreateEncoderDevice(tencoderdevice post)
        {
            using (vEntities context = new vEntities())
            {
                context.tencoderdevices.Add(post);
                context.SaveChanges();
            }

            return(post);
        }
Exemple #16
0
        public static tchannel_ppoint CreateChannelPPointAccess(tchannel_ppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.tchannel_ppoint.Add(post);
                context.SaveChanges();
            }

            return(post);
        }
        public static channel UpdateChannel(channel post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return post;
        }
        public static channel CreateChannel(channel post)
        {
            using (vEntities context = new vEntities())
            {
                context.channels.Add(post);
                context.SaveChanges();
            }

            return post;
        }
        public static tppoint CreateAMSPPoint(tppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.tppoints.Add(post);
                context.SaveChanges();
            }

            return(post);
        }
        public static void DeleteChannel(string channelid)
        {
            int channelIdentifier;

            if (int.TryParse(channelid, out channelIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var entity = context.channels.FirstOrDefault(post => post.id == channelIdentifier);
                    if (entity != null)
                    {
                        context.channels.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
Exemple #21
0
        public static void DeleteChannel(string channelid)
        {
            int channelIdentifier;

            if (int.TryParse(channelid, out channelIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var entity = context.channels.FirstOrDefault(post => post.id == channelIdentifier);
                    if (entity != null)
                    {
                        context.channels.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
Exemple #22
0
        public static void DeleteEncoderDevice(string deviceid)
        {
            int deviceIdentifier;

            if (int.TryParse(deviceid, out deviceIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var entity = context.tencoderdevices.FirstOrDefault(post => post.ID_ENCODERDEVICE == deviceIdentifier);
                    if (entity != null)
                    {
                        context.tencoderdevices.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
        public static void DeleteEncoderDevice(string deviceid)
        {
            int deviceIdentifier;

            if (int.TryParse(deviceid, out deviceIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var entity = context.tencoderdevices.FirstOrDefault(post => post.ID_ENCODERDEVICE == deviceIdentifier);
                    if (entity != null)
                    {
                        context.tencoderdevices.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
        public static void DeletePPointStatus(string PPointid)
        {
            int PPointStatusIdentifier;

            if (int.TryParse(PPointid, out PPointStatusIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var entity = context.tppointstatus.FirstOrDefault(post => post.ID_STATUS == PPointStatusIdentifier);
                    if (entity != null)
                    {
                        context.tppointstatus.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
        public static void DeletePPoint(string PPointid)
        {
            int PPointIdentifier;

            if (int.TryParse(PPointid, out PPointIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var entity = context.tppoints.FirstOrDefault(post => post.ID_PPOINT == PPointIdentifier);
                    if (entity != null)
                    {
                        context.tppoints.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
        public static void DeleteDeviceChannelAccess(string deviceid, string channelid)
        {
            int deviceIdentifier;
            int channelIdentifier;

            if (int.TryParse(deviceid, out deviceIdentifier) && (int.TryParse(channelid, out channelIdentifier)))
            {
                using (vEntities context = new vEntities())
                {
                    var entity = context.tdevicechannelaccesses.FirstOrDefault(post => post.ID_DEVICE == deviceIdentifier && (post.ID_CHANNEL == channelIdentifier));;
                    if (entity != null)
                    {
                        context.tdevicechannelaccesses.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
        public static void DeleteDeviceChannelAccess(string deviceid, string channelid)
        {
            int deviceIdentifier;
            int channelIdentifier;

            if (int.TryParse(deviceid, out deviceIdentifier) && (int.TryParse(channelid, out channelIdentifier)))
            {
                using (vEntities context = new vEntities())
                {
                    var entity = context.tdevicechannelaccesses.FirstOrDefault(post => post.ID_DEVICE == deviceIdentifier && (post.ID_CHANNEL == channelIdentifier));;
                    if (entity != null)
                    {
                        context.tdevicechannelaccesses.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
Exemple #28
0
        public static void DeleteChannelPPointAccess(string PPointid, string channelid)
        {
            int PPointIdentifier;
            int channelIdentifier;

            if (int.TryParse(PPointid, out PPointIdentifier) && (int.TryParse(channelid, out channelIdentifier)))
            {
                using (vEntities context = new vEntities())
                {
                    var entity =
                        context.tchannel_ppoint.FirstOrDefault(
                            post => post.ID_PPOINT == PPointIdentifier && (post.ID_CHANNEL == channelIdentifier));
                    ;
                    if (entity != null)
                    {
                        context.tchannel_ppoint.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
        public static void DeleteChannelPPointAccess(string PPointid, string channelid)
        {
            int PPointIdentifier;
            int channelIdentifier;

            if (int.TryParse(PPointid, out PPointIdentifier) && (int.TryParse(channelid, out channelIdentifier)))
            {
                using (vEntities context = new vEntities())
                {
                    var entity =
                        context.tchannel_ppoint.FirstOrDefault(
                            post => post.ID_PPOINT == PPointIdentifier && (post.ID_CHANNEL == channelIdentifier));
                    ;
                    if (entity != null)
                    {
                        context.tchannel_ppoint.Remove(entity);
                        context.SaveChanges();
                    }
                }
            }
        }
        public static tdevicechannelaccess UpdateDeviceChannelAccess(tdevicechannelaccess post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return post;
        }
        public static tchannel_ppoint UpdateChannelPPointAccess(tchannel_ppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return post;
        }