public bool IsNearCanal(int x, int y, int sizex, int sizey) { for (int a = x - 2; a < x + sizex + 2; a++) { for (int b = y - 2; b < y + sizey + 2; b++) { if (OutOfBounds(a, b)) { continue; } GameObject go = GetBuildingAt(a, b); if (go == null) { continue; } Canal c = go.GetComponent <Canal>(); if (c == null) { continue; } if (c.WaterAccess) { return(true); } } } return(false); }
public Argumentos.Base.Response ExcluirCanal(Guid idCanal) { bool existe = _repositorioVideo.ExisteCanalAssociado(idCanal); if (existe) { AddNotification("Canal", MSG.NAO_E_POSSIVEL_EXCLUIR_UM_X0_ASSOCIADO_A_UM_X1.ToFormat("Canal", "Video")); return(null); } Canal canal = _repositorioCanal.Obter(idCanal); if (canal == null) { AddNotification("Canal", MSG.DADOS_NAO_ENCONTRADOS); } if (this.IsInvalid()) { return(null); } _repositorioCanal.Excluir(canal); return(new Argumentos.Base.Response() { Mensagem = MSG.OPERACAO_REALIZADA_COM_SUCESSO }); }
public Response ExcluirCanal(Guid idCanal) { bool existe = _repositoryVideo.ExisteCanalAssociado(idCanal); if (existe) { AddNotification("Canal", "NAO_E_POSSIVEL_EXCLUIR_UM_canal "); return(null); } Canal canal = _repositoryCanal.Obter(idCanal); if (canal == null) { AddNotification("Canal", "DADOS_NAO_ENCONTRADOS"); } if (IsInvalid()) { return(null); } _repositoryCanal.Excluir(canal); return(new Response() { Message = "OPERACAO_REALIZADA_COM_SUCESSO" }); }
private void listView_MouseDoubleClick(object sender, MouseEventArgs e) { Canal canal = (Canal)listView.SelectedItems[0].Tag; String URL = canal.URLCanal; System.Diagnostics.Process.Start(URL); }
public Response ExcluirCanal(Guid idCanal) { bool existe = false;// _repositorioVideo.ExisteCanalAssociado(idCanal); if (existe) { AddNotification("Canal", "Não é possível excluir um canal associado a um vídeo"); return(null); } Canal canal = _repositorioCanal.Obter(idCanal); if (canal == null) { AddNotification("Canal", "Dados não encontrados"); } if (IsInvalid()) { return(null); } _repositorioCanal.Excluir(canal); return(new Response() { Message = "Operação realizada com sucesso" }); }
public void BasicCanalTest2() { CanalManager canalManager = new CanalManager(); Canal canal = new Canal(); canal.CanelEdges.Add(new CanalEdge() { Id = "SourceCanal", WaterLevel = 2.9 }); canal.CanelEdges.Add(new CanalEdge() { Id = "EndCanal" }); CanalStretch canalStretch = new CanalStretch("stretch1", 602, 20.32, new RectangularSection(5, 0.028, 0)); canalStretch.FromNode = canal.CanelEdges.First(); canalStretch.ToNode = canal.CanelEdges.Last(); canal.CanalStretches.Add(canalStretch); canalManager.SetCanal(canal); var result = canalManager.ExecuteCanalSimulation(); Assert.IsTrue(result != null); }
/// <summary> /// Set Volume of AudioManager. /// </summary> public void SetVolume(float value, Canal canal) { switch (canal) { case Canal.Master: volumeMaster = value; break; case Canal.Music: volumeMusic = value; break; case Canal.SoundEffect: volumeSoundEffect = value; break; case Canal.Ambient: volumeAmbient = value; break; case Canal.Voice: volumeVoice = value; break; default: Debug.LogError("SetVolume() Error : wrong canal"); break; } ChangeVolumeInSources(canal); }
public void SaveCanalConfiguration(Canal canal, string saveLocation) { if (!Directory.Exists(saveLocation)) { Directory.CreateDirectory(saveLocation); } string xml; XmlSerializer xmlSerializer = new XmlSerializer(typeof(CanalConfiguration)); CanalConfigurationConverter converter = new CanalConfigurationConverter(); CanalConfiguration canalConfiguration = converter.ConvertBack(canal); using (var sww = new StringWriter()) { using (XmlWriter writer = XmlWriter.Create(sww)) { xmlSerializer.Serialize(writer, canalConfiguration); xml = sww.ToString(); // Your XML } File.WriteAllText(Path.Combine(saveLocation, "CanalConfiguration.xml"), xml); } }
/// <summary> /// Obtem uma tabela a ser jogada num relatorio /// </summary> /// <returns></returns> public override DataTable Relatorio() { try{ DataTable tabela = new DataTable("RelatorioCanalFormaPagamento"); if (this.Primeiro()) { tabela.Columns.Add("Canal", typeof(string)); tabela.Columns.Add("FormaPagamento", typeof(string)); do { DataRow linha = tabela.NewRow(); Canal canal = new Canal(); canal.Ler(canalFormaPagamento.CanalID.Valor); linha["Canal"] = canal.Nome.Valor; FormaPagamento fp = new FormaPagamento(); fp.Ler(canalFormaPagamento.FormaPagamentoID.Valor); linha["FormaPagamento"] = fp.Nome.Valor; tabela.Rows.Add(linha); }while(this.Proximo()); } else //erro: nao carregou a lista { tabela = null; } return(tabela); }catch (Exception ex) { throw ex; } }
private void AtualizarTela(Canal canal) { // Logo textBoxNome.Text = canal.NomeCanal; textBoxGrupo.Text = canal.GrupoCanal; textBoxCodigo.Text = canal.CodigoDesbloqueioCanal; textBoxURL.Text = canal.URLCanal; }
public Bitmap AplicarEfeito(Bitmap bitmap, object parameter) { string p = parameter.ToString(); Canal canal = (Canal)Enum.Parse(typeof(Canal), p); return(InverterCanal(bitmap, canal)); }
public ActionResult Create() { Canal model = new Canal(); model.Estado = Models.Constantes.Estado.Activo; return(View(model)); }
public Canal ObterCanal(int idCanal) { Canal canal = null; /* Cria conexão com o Banco de Dados SQL */ using (SQLiteConnection conexao = new SQLiteConnection(_StrConexao)) { /* Abre conexão com o Banco de Dados SQL */ conexao.Open(); /* Comando SQL para selecionar canal pelo ID */ SQLiteCommand SQL = new SQLiteCommand("SELECT idCanal, logoCanal, nomeCanal, grupoCanal, codigoDesbloqueioCanal, URLCanal FROM Canal WHERE idCanal=@idCanal"); SQL.Connection = conexao; SQL.Prepare(); SQL.Parameters.AddWithValue("@idCanal", idCanal); using (SQLiteDataReader dataReader = SQL.ExecuteReader()) { if (dataReader.Read()) { canal = new Canal(); canal.IdCanal = dataReader.GetInt32(0); //canal.LogoCanal = (byte[])dataReader.GetValue(1); canal.NomeCanal = dataReader.GetString(2); canal.GrupoCanal = dataReader.GetString(3); canal.CodigoDesbloqueioCanal = dataReader.GetString(4); canal.URLCanal = dataReader.GetString(5); } } /* Fecha conexão com o Banco de Dados SQL */ conexao.Close(); } return(canal); }
public ActionResult Edit(Canal model) { try { if (ModelState.IsValid) { Canal modelUpdate = GetModel(model.IdCanal); modelUpdate.Descripcion = model.Descripcion; modelUpdate.Estado = model.Estado; modelUpdate.UsrMod = this.UserLogonName; modelUpdate.FecMod = this.GetCurrentDateTime(); DataBase.Canales.Update(modelUpdate); DataBase.Save(); VerificarDependencia(model); this.AddDefaultSuccessMessage(); return(RedirectToAction("Index", model)); } } catch { this.AddDefaultErrorMessage(); } return(View(model)); }
public ActionResult Delete(Canal model) { try { Canal modelUpdate = GetModel(model.IdCanal); modelUpdate.Estado = Rp3.AgendaComercial.Models.Constantes.Estado.Eliminado; modelUpdate.UsrMod = this.UserLogonName; modelUpdate.FecMod = this.GetCurrentDateTime(); DataBase.Canales.Update(modelUpdate); DataBase.Save(); VerificarDependencia(model); //DataBase.Canales.Delete(model); //DataBase.Save(); this.AddDefaultSuccessMessage(); return(RedirectToAction("Index", model)); } catch { this.AddDefaultErrorMessage(); } return(RedirectToAction("Index", model)); }
public static XElement AddChennal() { Console.WriteLine("Input values \n " + "labelOfChannel \n" + "genreOfChannel \n" + "countOfVideo \n" + "videos \n"); string labelOfChannel = Console.ReadLine(); string genreOfChannel = Console.ReadLine(); int countOfVideo = Convert.ToInt32(Console.ReadLine()); List <Video> videos = new List <Video>(3); foreach (Video el in videos) { string labelOfVideo = Console.ReadLine(); int countOfViews = Convert.ToInt32(Console.ReadLine()); int countOfLikes = Convert.ToInt32(Console.ReadLine()); int countOfDislike = Convert.ToInt32(Console.ReadLine()); int countOfComments = Convert.ToInt32(Console.ReadLine()); } Canal cn = new Canal(labelOfChannel, genreOfChannel, countOfVideo, videos); return(new XElement("Canal", new XAttribute("labelOfChannel", cn.LabelOfCanal), new XElement("genreOfCanal", cn.GenreOfCanal), new XElement("countOfVideo", cn.CountOfVideo), new XElement("videos", cn.VideosToString()))); }
private static double[] GerarHistograma(Bitmap bitmap, Canal canal) { var histograma = new double[256]; for (int i = 0; i < bitmap.Width; i++) { for (int j = 0; j < bitmap.Height; j++) { Color c = bitmap.GetPixel(i, j); switch (canal) { case Canal.Vermelho: histograma[c.R]++; break; case Canal.Verde: histograma[c.G]++; break; case Canal.Azul: histograma[c.B]++; break; case Canal.Cinza: histograma[c.R]++; break; default: break; } } } return(histograma); }
public static List <Publication> Find(Canal element) { List <Publication> publication = new List <Publication>(); request = "SELECT * FROM Publication WHERE idCanal = @idCanal ORDER BY id ASC"; connection = Bdd.Cnx; command = new SqlCommand(request, connection); command.Parameters.Add(new SqlParameter("@idCanal", element.CanalId)); connection.Open(); reader = command.ExecuteReader(); while (reader.Read()) { Publication pub = new Publication { PublicationId = reader.GetInt32(0), Contenu = reader.GetString(1), PublicationDateCreation = reader.GetDateTime(2), PublicationActif = reader.GetInt32(3) }; publication.Add(pub); } reader.Close(); command.Dispose(); connection.Close(); return(publication); }
private void ChangeVolumeInSources(Canal canal) { float tmpVolume = 1; switch (canal) { case Canal.Master: tmpVolume = volumeMaster; break; case Canal.Music: tmpVolume = volumeMusic * volumeMaster; break; case Canal.SoundEffect: tmpVolume = volumeSoundEffect * volumeMaster; break; case Canal.Ambient: tmpVolume = volumeAmbient * volumeMaster; break; case Canal.Voice: tmpVolume = volumeVoice * volumeMaster; break; default: Debug.LogError("SetVolume() Error : wrong canal"); break; } mapSources[canal].Where(x => x != null).ToList().ForEach(x => x.volume = tmpVolume); }
public ActionResult Create(Canal model) { try { if (ModelState.IsValid) { model.AsignarId(); model.EstadoTabla = Rp3.AgendaComercial.Models.Constantes.Estado.Tabla; model.Estado = Rp3.AgendaComercial.Models.Constantes.Estado.Activo; model.UsrIng = this.UserLogonName; model.FecIng = this.GetCurrentDateTime(); DataBase.Canales.Insert(model); DataBase.Save(); this.AddDefaultSuccessMessage(); return(RedirectToAction("Index", model)); } } catch { this.AddDefaultErrorMessage(); } return(View(model)); }
public IEnumerable <Canal> ObterCanais() { List <Canal> list = new List <Canal>(); /* Cria conexão com o Banco de Dados SQL */ using (SQLiteConnection conexao = new SQLiteConnection(_StrConexao)) { /* Abre conexão com o Banco de Dados SQL */ conexao.Open(); /* Comando SQL para selecionar canais ordenado-os por ordem alfabética */ SQLiteCommand SQL = new SQLiteCommand("SELECT idCanal, logoCanal, nomeCanal, grupoCanal, codigoDesbloqueioCanal, URLCanal FROM Canal ORDER BY nomeCanal"); SQL.Connection = conexao; using (SQLiteDataReader dataReader = SQL.ExecuteReader()) { while (dataReader.Read()) { Canal canal = new Canal(); canal.IdCanal = dataReader.GetInt32(0); //canal.LogoCanal = (byte[])dataReader.GetValue(1); canal.NomeCanal = dataReader.GetString(2); canal.GrupoCanal = dataReader.GetString(3); canal.CodigoDesbloqueioCanal = dataReader.GetString(4); canal.URLCanal = dataReader.GetString(5); list.Add(canal); } } /* Fecha conexão com o Banco de Dados SQL */ conexao.Close(); } return(list); }
public Response DeleteCanal(Guid idCanal) { bool existe = _repositoryVideo.ExisteCanalAssociado(idCanal); if (existe) { AddNotification("Canal", Msg.NAO_E_POSSIVEL_EXCLUIR_UM_X0_ASSOCIADO_A_UM_X1.ToFormat("canal", "vídeo")); return(null); } Canal canal = _repositoryCanal.Obter(idCanal); if (canal == null) { AddNotification("Canal", Msg.DADOS_NAO_ENCONTRADOS); } if (IsInvalid()) { return(null); } _repositoryCanal.Delete(canal); return(new Response() { Mensagem = Msg.OPERACAO_REALIZADA_COM_SUCESSO }); }
public async Task OnPostAddAsync() { try { if (ModelState.IsValid) { var t = Task.Run(() => { var sec = _appServiceSecretaria.GetById(SecretariaSelecionada); var set = _appServiceSetor.GetById(SetorSelecionado); var input = new Canal() { Nome = Input.Nome, Secretaria = sec, Setor = set, Ativo = true }; _appServiceCanal.Add(input); }); await t; Input.Nome = string.Empty; } await OnLoad(); } catch (Exception ex) { StatusMessage = "Erro ao tentar incluír novo canal!" + "\n" + ex.Message; } }
/// <summary> /// Listar todos los canales registrados. /// </summary> /// <returns>Lista de canales registrados en el sistema</returns> public BindingList <Canal> listarCanales() { BindingList <Canal> canales = new BindingList <Canal>(); SqlCommand comando = _manejador.obtenerProcedimiento("SelectCanales"); SqlDataReader datareader = null; try { datareader = _manejador.ejecutarConsultaDatos(comando); while (datareader.Read()) { byte id = (byte)datareader["pk_ID"]; string nombre = (string)datareader["Nombre"]; Canal canal = new Canal(id, nombre); canales.Add(canal); } comando.Connection.Close(); } catch (Exception) { comando.Connection.Close(); throw new Excepcion("ErrorDatosConexion"); } return(canales); }
private void AtualizarCanal(Canal canal) { // Logo canal.NomeCanal = textBoxNome.Text; canal.GrupoCanal = textBoxGrupo.Text; canal.CodigoDesbloqueioCanal = textBoxCodigo.Text; canal.URLCanal = textBoxURL.Text; }
/// <summary> /// Get Volume of AudioManager. /// </summary> public float GetVolume(Canal canal) { switch (canal) { case Canal.Master: return(volumeMaster); case Canal.Music: return(volumeMusic); case Canal.SoundEffect: return(volumeSoundEffect); case Canal.Ambient: return(volumeAmbient); case Canal.Voice: return(volumeVoice); default: Debug.LogError("GetVolume() Error : wrong canal"); break; } return(0); }
public Response ExcluirCanal(Guid idCanal) { // bool existe _respositoryVideo.ExisteCanalAssociado(idCanal); bool existe = true; if (existe) { AddNotification("Canal", MSG.NAO_E_POSSIVEL_EXCLUIR_UMA_X0_ASSOCIADA_A_UMA_X1.ToFormat("canal", "Video")); return(null); } Canal canal = _repositoryCanal.Obter(idCanal); if (canal == null) { AddNotification("Canal", MSG.DADOS_NAO_ENCONTRADOS); } if (this.IsInvalid()) { return(null); } _repositoryCanal.Excluir(canal); return(new Response() { Message = MSG.OPERACAO_REAIZADA_COM_SUCESSO }); }
private void btnCadastrarInformacoes_Click(object sender, EventArgs e) { Canal canal = new Canal(); canal.SetNomePessoa(txtNomePessoa.Text); canal.SetApelido(txtApelido.Text); canal.SetNomeDoCanal(txtNomeCanal.Text); canal.SetQuantidadeInscritos(Convert.ToInt32(txtQuantidadeInscritos.Text)); canal.SetPlataforma(cbPlataforma.SelectedItem.ToString()); canal.SetCategoriaDosJogos(cbCategoriaJogos.SelectedItem.ToString()); canal.SetQuantidadeVisualizacoes(Convert.ToInt64(txtQuantidadeVisualizacoes.Text)); canal.SetQuantidadeLikes(Convert.ToInt32(txtQuantidadeLikes.Text)); canal.SetRendaPorVideo(Convert.ToDouble(txtRendaPorVideo.Text)); canal.SetNacionalidade((cbNacionalidade.SelectedItem.ToString())); canal.SetQuantidadeVideosUpados(Convert.ToInt32(txtQuantidadeVideosUpados.Text)); canal.SetDescricaoDoCanal(txtDescricaoCanal.Text); RepositorioCanal channel = new RepositorioCanal(); if (posicao == -1) { channel.AdicionarCanal(canal); MessageBox.Show("Canal adicionado !"); } else { channel.EditarCanal(canal, posicao); MessageBox.Show("Canal editado !"); } LimparCampos(); //AtualizarLista(); }
public Arguments.Base.Response ExcluirCanal(Guid idCanal) { //bool existe = _repositoryVideo.ExisteCanalAssociado(idCanal); bool existe = true; if (existe) { AddNotification("Canal", "Não foi possivel Excluir um canal associadoa video"); return(null); } Canal canal = _repositoryCanal.Obter(idCanal); if (canal == null) { AddNotification("Canal", "Dados não encontrado"); } if (IsInvalid()) { return(null); } _repositoryCanal.Excluir(canal); return(new Response() { Message = "Operação realizada com sucesso" }); }
public int RegistrarCanal([FromBody] Canal objCanal) { clsCanal objClsCanal; Abm.CanalV objValidarCanal; try { objClsCanal = new clsCanal(); objValidarCanal = new Abm.CanalV(); objValidarCanal = objClsCanal.ValidarCanal(objCanal.can_nombre); if (objValidarCanal == null) { objClsCanal = new clsCanal(); return(objClsCanal.RegistrarCanal(objCanal)); } else { return(0); } } catch (Exception) { throw; } finally { objClsCanal = null; objValidarCanal = null; } }
public static Canal Insert(Canal canal) { CanalDSTableAdapters.TblCanalTableAdapter adapter = new CanalDSTableAdapters.TblCanalTableAdapter(); CanalDS.TblCanalDataTable table = adapter.InsertCanal(canal.Nombre, canal.FechaCreacion, canal.UsuarioCreacionID); if (table.Count() == 0) { return null; } Canal objCanal = RowToDto(table[0]); return CargarInformacionCompleta(objCanal); }
private static Canal CargarInformacionCompleta(Canal objCanal) { if (objCanal == null) { return null; } //objCanal.Videos = VideoBLL.SelectByCanalID(objCanal.Id); //objCanal.CanalesUsuario = CanalUsuarioBLL.SelectByCanalID(objCanal.Id); return objCanal; }
private static Canal RowToDto(CanalDS.TblCanalRow row) { Canal objCanal = new Canal(); objCanal.Id = row.Id; objCanal.Nombre = row.Nombre; objCanal.FechaCreacion = row.FechaCreacion; objCanal.UsuarioCreacionID = row.UsuarioCreacionID; return objCanal; }
private static Canal rowToDto(CanalDS.CanalRow row) { Canal objCanal = new Canal(); objCanal.ID = row.lCanal_Id; objCanal.Nombre = row.sNombre; objCanal.Imagen = row.sImagen; objCanal.Fecha = row.dtCreacion; objCanal.Usuario_ID = row.lUsuario_Id; return objCanal; }
public static void Update(Canal canal) { CanalDSTableAdapters.TblCanalTableAdapter adapter = new CanalDSTableAdapters.TblCanalTableAdapter(); adapter.Update(canal.Nombre, canal.FechaCreacion, canal.UsuarioCreacionID, canal.Id); }