private void btnFinished_Click(object sender, System.EventArgs e)
        {
            FrmParent.PostActivity();
            int ControlPort = 0;
            int StreamingPort = 0;
            lbSEControlAddress.ForeColor = Color.Black;
            lbSEControlPort.ForeColor = Color.Black;

            lbStreamingPort.ForeColor = Color.Black;
            lbStreamingAddress.ForeColor = Color.Black;

            try
            {
                ControlPort = System.Convert.ToInt32(tbSEControlPort.Text,10);
                if((ControlPort < 1)||(ControlPort > 65535))
                    ControlPort = System.Convert.ToInt32("Mess this up on purpose to trigger catch!",10);
            }
            catch
            {
                MessageBox.Show("Control Port must be a value between 1 and 65535!");
                lbSEControlPort.ForeColor = Color.Red;
                return;
            }
            try
            {
                StreamingPort = System.Convert.ToInt32(tbStreamingPort.Text,10);
                if((ControlPort < 1)||(ControlPort > 65535))
                    ControlPort = System.Convert.ToInt32("Mess this up on purpose to trigger catch!",10);
            }
            catch
            {
                MessageBox.Show("Streaming Port must be a value between 1 and 65535!");
                lbStreamingPort.ForeColor = Color.Red;
                return;
            }
            if(SE != null)
            {
                if((SE.ControlAddress.ToUpper() != tbSEControlAddress.Text.ToUpper())||(SE.ControlPort != ControlPort))
                {

                    if(!FrmParent.OSystem.CheckAddressPortPair(tbSEControlAddress.Text,ControlPort))
                    {
                        lbSEControlAddress.ForeColor = Color.Red;
                        lbSEControlPort.ForeColor = Color.Red;
                        MessageBox.Show("Control Address/Port pair not unique in database");
                        return;
                    }
                }
                if((SE.StreamingAddress.ToUpper()!= tbStreamingAddress.Text.ToUpper())||(StreamingPort != SE.StreamingPort))
                {
                    if(!FrmParent.OSystem.CheckAddressPortPair(tbStreamingAddress.Text,StreamingPort))
                    {
                        lbStreamingAddress.ForeColor = Color.Red;
                        lbStreamingPort.ForeColor = Color.Red;
                        MessageBox.Show("Control Address/Port pair not unique in database");
                        return;
                    }
                }
            }
            else
            {
                if(!FrmParent.OSystem.CheckAddressPortPair(tbSEControlAddress.Text,ControlPort))
                {
                    lbSEControlAddress.ForeColor = Color.Red;
                    lbSEControlPort.ForeColor = Color.Red;
                    MessageBox.Show("Control Address/Port pair not unique in database");
                    return;
                }
                if(!FrmParent.OSystem.CheckAddressPortPair(tbStreamingAddress.Text,StreamingPort))
                {
                    lbStreamingAddress.ForeColor = Color.Red;
                    lbStreamingPort.ForeColor = Color.Red;
                    MessageBox.Show("Control Address/Port pair not unique in database");
                    return;
                }
            }
            int RoomIndex = cbR.SelectedIndex;
            int MBSIndex = cbMBS.SelectedIndex;

            try
            {
                if(SE == null)
                {
                    //Creating new streaming Encoder
                    OysterClassLibrary.Functions F = new OysterClassLibrary.Functions();
                    F.CreateStreamingEncoder(tbDescription.Text,tbSEControlAddress.Text,ControlPort,tbStreamingAddress.Text,StreamingPort,chkIsMulticast.Checked,chkIsControlableCamera.Checked,
                        Convert.ToInt32(MBSID[MBSIndex,1],10),Convert.ToInt32(RoomID[RoomIndex,1],10),tbStreamingHeader.Text);
                    F.Dispose();
                    Trace.WriteLine("Created Streaming Encoder: " + tbDescription.Text + " " + tbSEControlAddress.Text + ":" + ControlPort.ToString(),System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name);

                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    SE.Update(tbDescription.Text,tbSEControlAddress.Text,ControlPort,tbStreamingAddress.Text,StreamingPort,chkIsMulticast.Checked,chkIsControlableCamera.Checked,
                        Convert.ToInt32(MBSID[MBSIndex,1],10),Convert.ToInt32(RoomID[RoomIndex,1],10),tbStreamingHeader.Text);
                    Trace.WriteLine("Edited Streaming Encoder: " + SE.Description + "(" + SE.ID + ")" ,System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName + "." + System.Reflection.MethodBase.GetCurrentMethod().Name);
                    this.DialogResult = DialogResult.OK;
                }
            }
            catch(Exception Err)
            {
                MessageBox.Show(this,Err.Message,"Streaming Encoder Window");
                return;
            }
        }