コード例 #1
0
 public static channel[] GetChannels()
 {
     using (vEntities context = new vEntities())
     {
         return(context.channels.ToArray());
     }
 }
コード例 #2
0
        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;
        }
コード例 #3
0
 public static tppointstatu[] GetAllPpointStatus()
 {
     using (vEntities context = new vEntities())
     {
         return(context.tppointstatus.ToArray());
     }
 }
コード例 #4
0
 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());
     }
 }
コード例 #6
0
 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();
     }
 }
コード例 #9
0
 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);
        }
コード例 #13
0
 public static tdevicechannelaccess[] GetDeviceChannelAccess()
 {
     using (vEntities context = new vEntities())
     {
         return(context.tdevicechannelaccesses.ToArray());
     }
 }
コード例 #14
0
        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);
        }
コード例 #20
0
        public static tchannel_ppoint CreateChannelPPointAccess(tchannel_ppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.tchannel_ppoint.Add(post);
                context.SaveChanges();
            }

            return post;
        }
コード例 #21
0
        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);
        }
コード例 #23
0
        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;
        }
コード例 #26
0
        public static tdevicechannelaccess CreateDeviceChannelAccess(tdevicechannelaccess post)
        {
            using (vEntities context = new vEntities())
            {
                context.tdevicechannelaccesses.Add(post);
                context.SaveChanges();
            }

            return post;
        }
コード例 #27
0
        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);
        }
コード例 #29
0
        public static tdevicechannelaccess UpdateDeviceChannelAccess(tdevicechannelaccess post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return(post);
        }
コード例 #30
0
        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);
        }
コード例 #32
0
        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;
        }
コード例 #37
0
        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;
        }
コード例 #39
0
        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);
        }
コード例 #43
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;
        }
コード例 #44
0
        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();
                    }
                }
            }
        }
コード例 #46
0
        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();
                    }
                }
            }
        }
コード例 #49
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();
                    }
                }
            }
        }
コード例 #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();
                    }
                }
            }
        }
コード例 #52
0
        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();
                    }
                }
            }
        }
コード例 #53
0
        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;
        }
コード例 #54
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();
                    }
                }
            }
        }
コード例 #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;
     }
 }
コード例 #56
0
        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();
            }
        }
コード例 #58
0
 public static tdevicechannelaccess[] GetDeviceChannelAccess()
 {
     using (vEntities context = new vEntities())
     {
         return context.tdevicechannelaccesses.ToArray();
     }
 }
コード例 #59
0
        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;
        }
コード例 #60
0
        public static tchannel_ppoint UpdateChannelPPointAccess(tchannel_ppoint post)
        {
            using (vEntities context = new vEntities())
            {
                context.Entry(post).State = EntityState.Modified;
                context.SaveChanges();
            }

            return post;
        }