예제 #1
0
 public static channel[] GetChannels()
 {
     using (vEntities context = new vEntities())
     {
         return(context.channels.ToArray());
     }
 }
        public static System.Collections.Generic.IEnumerable<ChannelPpointAccessInfo> GetAllPPointsbyChannel(string channelid)
        {
            int channelIdentifier;

            if (int.TryParse(channelid, out channelIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var dbQuery = from edcha in context.tchannel_ppoint
                                  join ed in context.tppoints on edcha.ID_PPOINT equals ed.ID_PPOINT
                                  join ch in context.channels on edcha.ID_CHANNEL equals ch.id
                                  where edcha.ID_CHANNEL == channelIdentifier
                                  select
                                      new ChannelPpointAccessInfo()
                                          {
                                              id = ch.id,
                                              name = ch.name,
                                              ID_PPOINT = ed.ID_PPOINT,
                                              IIS_NAME = ed.IIS_NAME,
                                              URL = ed.URL,
                                              AMS_URL = ed.AMS_URL
                                          };

                    return dbQuery.AsEnumerable().ToArray();

                }
            }
            return null;
        }
 public static tppointstatu[] GetAllPpointStatus()
 {
     using (vEntities context = new vEntities())
     {
         return(context.tppointstatus.ToArray());
     }
 }
 public static tencoderdevice[] GetEncoderdevices()
 {
     using (vEntities context = new vEntities())
     {
         return context.tencoderdevices.ToArray();
     }
 }
예제 #5
0
 public static tppoint[] GetPPoints()
 {
     using (vEntities context = new vEntities())
     {
         return(context.tppoints.ToArray());
     }
 }
 public static channel[] GetChannels()
 {
     using (vEntities context = new vEntities())
     {
         return context.channels.ToArray();
     }
 }
예제 #7
0
 public static tencoderdevice[] GetEncoderdevices()
 {
     using (vEntities context = new vEntities())
     {
         return(context.tencoderdevices.ToArray());
     }
 }
예제 #8
0
 public static tppoint[] GetPPoints()
 {
     using (vEntities context = new vEntities())
     {
         return context.tppoints.ToArray();
     }
 }
 public static tppointstatu[] GetAllPpointStatus()
 {
     using (vEntities context = new vEntities())
     {
         return context.tppointstatus.ToArray();
     }
 }
예제 #10
0
 public static tchannel_ppoint[] GetChannel_Ppoints()
 {
     using (vEntities context = new vEntities())
     {
         return(context.tchannel_ppoint.ToArray());
     }
 }
예제 #11
0
 public static bool GetPPointStatus(string PPointid)
 {
     using (vEntities context = new vEntities())
     {
         return(context.tppoints.FirstOrDefault(post => post.ID_PPOINT == int.Parse(PPointid)).IN_USE);
     }
 }
예제 #12
0
        public static System.Collections.Generic.IEnumerable <ChannelPpointAccessInfo> GetAllChannelsByPPoint(string PPointid)
        {
            int PPointIdentifier;

            if (int.TryParse(PPointid, out PPointIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var dbQuery = from edcha in context.tchannel_ppoint
                                  join ed in context.tppoints on edcha.ID_PPOINT equals ed.ID_PPOINT
                                  join ch in context.channels on edcha.ID_CHANNEL equals ch.id
                                  where edcha.ID_PPOINT == PPointIdentifier
                                  select
                                  new ChannelPpointAccessInfo()
                    {
                        id        = ch.id,
                        name      = ch.name,
                        ID_PPOINT = ed.ID_PPOINT,
                        IIS_NAME  = ed.IIS_NAME,
                        URL       = ed.URL,
                        AMS_URL   = ed.AMS_URL
                    };

                    return(dbQuery.AsEnumerable().ToArray());
                }
            }
            return(null);
        }
 public static tdevicechannelaccess[] GetDeviceChannelAccess()
 {
     using (vEntities context = new vEntities())
     {
         return(context.tdevicechannelaccesses.ToArray());
     }
 }
        public static tencoderdevice UpdateEncoderDevice(tencoderdevice post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

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

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

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

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

            return(post);
        }
예제 #19
0
        public static channel CreateChannel(channel post)
        {
            using (vEntities context = new vEntities())
            {
                context.channels.Add(post);
                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;
        }
        public static tencoderdevice CreateEncoderDevice(tencoderdevice post)
        {
            using (vEntities context = new vEntities())
            {
                context.tencoderdevices.Add(post);
                context.SaveChanges();
            }

            return post;
        }
예제 #22
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 UpdatePPointStatus(tppointstatu post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

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

            return(post);
        }
예제 #25
0
        public static tppoint CreatePPoint(tppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.tppoints.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 tdevicechannelaccess CreateDeviceChannelAccess(tdevicechannelaccess post)
        {
            using (vEntities context = new vEntities())
            {
                context.tdevicechannelaccesses.Add(post);
                context.SaveChanges();
            }

            return(post);
        }
예제 #28
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 tdevicechannelaccess UpdateDeviceChannelAccess(tdevicechannelaccess 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);
        }
예제 #31
0
        public static tchannel_ppoint UpdateChannelPPointAccess(tchannel_ppoint 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;
        }
예제 #33
0
        public static tppoint GetAvailablePPoint()
        {
            using (vEntities context = new vEntities())
                {
                   var tempPP = context.tppoints.FirstOrDefault(post => post.IN_USE == false);

                // if there are no more publishin points available it creates a new one in Azure
                    return tempPP == null ? CreateAMSPPoint(new tppoint() {}) : tempPP;

                }
        }
예제 #34
0
        public static List <tppoint> SearchPPointByName(string ppointName)
        {
            using (vEntities context = new vEntities())
            {
                var query = from ppoint in context.tppoints
                            where ppoint.IIS_NAME.Contains(ppointName)
                            select ppoint;

                return(query.ToList());
            }
        }
예제 #35
0
        public static tppoint GetAvailablePPoint()
        {
            using (vEntities context = new vEntities())
            {
                var tempPP = context.tppoints.FirstOrDefault(post => post.IN_USE == false);

                // if there are no more publishin points available it creates a new one in Azure
                return(tempPP == null?CreateAMSPPoint(new tppoint()
                {
                }) : tempPP);
            }
        }
예제 #36
0
        public static tppoint GetPPoint(string PPointid)
        {
            int PPointIdentifier;

            if (int.TryParse(PPointid, out PPointIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    return context.tppoints.FirstOrDefault(post => post.ID_PPOINT == PPointIdentifier);
                }
            }

            return null;
        }
        public static tppointstatu GetPpointstatus(string PPointid)
        {
            int PPointStatusIdentifier;

            if (int.TryParse(PPointid, out PPointStatusIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    return context.tppointstatus.FirstOrDefault(post => post.ID_STATUS == PPointStatusIdentifier);
                }
            }

            return null;
        }
예제 #38
0
        public static channel GetChannel(string channelid)
        {
            int channelIdentifier;

            if (int.TryParse(channelid, out channelIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    return context.channels.FirstOrDefault(post => post.id == channelIdentifier);
                }
            }

            return null;
        }
        public static tppointstatu GetPpointstatus(string PPointid)
        {
            int PPointStatusIdentifier;

            if (int.TryParse(PPointid, out PPointStatusIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    return(context.tppointstatus.FirstOrDefault(post => post.ID_STATUS == PPointStatusIdentifier));
                }
            }

            return(null);
        }
예제 #40
0
        public static tppoint GetPPoint(string PPointid)
        {
            int PPointIdentifier;

            if (int.TryParse(PPointid, out PPointIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    return(context.tppoints.FirstOrDefault(post => post.ID_PPOINT == PPointIdentifier));
                }
            }

            return(null);
        }
예제 #41
0
        public static channel GetChannel(string channelid)
        {
            int channelIdentifier;

            if (int.TryParse(channelid, out channelIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    return(context.channels.FirstOrDefault(post => post.id == channelIdentifier));
                }
            }

            return(null);
        }
예제 #42
0
        public static tencoderdevice Getencoderdevice(string deviceid)
        {
            int deviceIdentifier;

            if (int.TryParse(deviceid, out deviceIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    return(context.tencoderdevices.FirstOrDefault(post => post.ID_ENCODERDEVICE == deviceIdentifier));
                }
            }

            return(null);
        }
        public static tencoderdevice Getencoderdevice(string deviceid)
        {
            int deviceIdentifier;

            if (int.TryParse(deviceid, out deviceIdentifier) )
            {
                using (vEntities context = new vEntities())
                {
                    return context.tencoderdevices.FirstOrDefault(post => post.ID_ENCODERDEVICE == deviceIdentifier);
                }
            }

            return null;
        }
        public static tdevicechannelaccess GetDeviceChannelAccess(string deviceid, string channelid)
        {
            int deviceIdentifier;
            int channelIdentifier;

            if (int.TryParse(deviceid, out deviceIdentifier) && (int.TryParse(channelid, out channelIdentifier)))
            {
                using (vEntities context = new vEntities())
                {
                    return(context.tdevicechannelaccesses.FirstOrDefault(post => post.ID_DEVICE == deviceIdentifier && (post.ID_CHANNEL == channelIdentifier)));
                }
            }

            return(null);
        }
예제 #45
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();
                    }
                }
            }
        }
        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();
                    }
                }
            }
        }
예제 #47
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();
                    }
                }
            }
        }
예제 #48
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();
                    }
                }
            }
        }
예제 #50
0
        public static tchannel_ppoint GetChannel_Ppoint(string PPointid, string channelid)
        {
            int PPointIdentifier;
            int channelIdentifier;

            if (int.TryParse(PPointid, out PPointIdentifier) && (int.TryParse(channelid, out channelIdentifier)))
            {
                using (vEntities context = new vEntities())
                {
                    return
                        (context.tchannel_ppoint.FirstOrDefault(
                             post => post.ID_PPOINT == PPointIdentifier && (post.ID_CHANNEL == channelIdentifier)));
                }
            }

            return(null);
        }
예제 #51
0
        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 System.Collections.Generic.IEnumerable<DeviceChannelAccessInfo> GetAllDevicesbyChannel(string channelid)
        {
            int channelIdentifier;

            if (int.TryParse(channelid, out channelIdentifier))
            {
                using (vEntities context = new vEntities())
                {
                    var dbQuery = from edcha in context.tdevicechannelaccesses
                                  join ed in context.tencoderdevices on edcha.ID_DEVICE equals ed.ID_ENCODERDEVICE
                                  join ch in context.channels on edcha.ID_CHANNEL equals ch.id
                                  where edcha.ID_CHANNEL == channelIdentifier
                                  select new DeviceChannelAccessInfo() { id = ch.id, name = ch.name, ID_ENCODERDEVICE = ed.ID_ENCODERDEVICE, DEVICE_NAME = ed.DEVICE_NAME };

                    return dbQuery.AsEnumerable().ToArray();

                }
            }
            return null;
        }
        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();
                    }
                }
            }
        }
예제 #55
0
 public static bool GetPPointStatus(string PPointid)
 {
     using (vEntities context = new vEntities())
     {
         return context.tppoints.FirstOrDefault(post => post.ID_PPOINT == int.Parse(PPointid)).IN_USE;
     }
 }
        public static tdevicechannelaccess UpdateDeviceChannelAccess(tdevicechannelaccess post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return post;
        }
예제 #57
0
        public static List<tppoint> SearchPPointByName(string ppointName)
        {
            using (vEntities context = new vEntities())
            {
                var query = from ppoint in context.tppoints
                            where ppoint.IIS_NAME.Contains(ppointName)
                            select ppoint;

              return query.ToList();
            }
        }
 public static tdevicechannelaccess[] GetDeviceChannelAccess()
 {
     using (vEntities context = new vEntities())
     {
         return context.tdevicechannelaccesses.ToArray();
     }
 }
        public static tdevicechannelaccess GetDeviceChannelAccess(string deviceid, string channelid)
        {
            int deviceIdentifier;
            int channelIdentifier;

            if (int.TryParse(deviceid, out deviceIdentifier) && (int.TryParse(channelid, out channelIdentifier)))
            {
                using (vEntities context = new vEntities())
                {
                    return context.tdevicechannelaccesses.FirstOrDefault(post => post.ID_DEVICE == deviceIdentifier && (post.ID_CHANNEL == channelIdentifier));
                }
            }

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

            return post;
        }