public void Localiza() { string ProcurePor = "%" + EditLocaliza.Text + "%"; string Filtro = "Nome like " + Biblioteca.QuotedStr(ProcurePor); ListaCliente = (List <ClienteDTO>)ClienteController.ConsultaClienteLista(Filtro); Label2.Text = ListaCliente.Count.ToString() + " Clientes localizados."; GridPrincipal.DataSource = ListaCliente; if (ListaCliente.Count > 0) { GridPrincipal.Focus(); } }
public UsuarioDTO select(String login, String senha) { try { String consultaSql = "from UsuarioDTO where Login="******" and Senha=" + Biblioteca.QuotedStr(Biblioteca.MD5String(login + senha)); UsuarioDTO resultado = base.selectObjetoSql <UsuarioDTO>(consultaSql); return(resultado); } catch (Exception ex) { throw ex; } }
public override void Eliminar() { try { string eliminar = string.Format("EXEC eliminarProductos '{0}'", textIdP.Text.Trim()); //Invoca el procedimiento Eliminar Biblioteca.Herramientas(eliminar); MessageBox.Show("Producto eliminado correctamente"); } catch (Exception error) { MessageBox.Show("Ha ocurrido un error " + error); } }
public void Localiza() { string ProcurePor = "%" + EditLocaliza.Text + "%"; string Filtro = "Nome like " + Biblioteca.QuotedStr(ProcurePor); ListaProduto = (List <ProdutoDTO>)ProdutoController.ConsultaProdutoLista(Filtro); Label2.Text = ListaProduto.Count.ToString() + " produtos localizados."; GridPrincipal.DataSource = ListaProduto; if (ListaProduto.Count > 0) { GridPrincipal.Focus(); } }
private async Task FetchData() { _log.LogInformation("Actualizando cache..."); try { Biblioteca = await _salas.GetSalaState(); } catch (Exception ex) { _log.LogError(ex, "Error al actualizar cache!"); } }
protected void btnReturnare_Click(object sender, EventArgs e) { String status = Biblioteca.Returnare_carte(txtIdCarte.Text, txtIdMembru.Text, Session["Nume_utilizator"].ToString()); if (status == null) { lblMsg.Text = "Carte returnata cu succes!"; } else { lblMsg.Text = "Eroare" + status; } }
protected void B_Comprar_Click(object sender, EventArgs e) { double valorTotal = 0; int id_usuario = int.Parse(Session["id_usuario"].ToString()); //List<Biblioteca> juegos = new DAOCarrito().obtenerProductosCarrito(((Usuario)Session["user"]).Id_usuario); List <Biblioteca> juegos = new DAOCarrito().obtenerProductosCarrito(id_usuario); List <DetallePedido> detalles = new List <DetallePedido>(); foreach (var item in juegos) { Biblioteca juego = new Biblioteca(); DetallePedido det = new DetallePedido(); juego = item; juego.Id_usuario = item.Id_usuario; juego.Id_videojuego = item.Id_videojuego; //pedido = valorTotal + juego.Precio; valorTotal = valorTotal + juego.Precio; det.Id_videojuego = juego.Id_videojuego; det.ValorUnitario = juego.Precio; det.Cantidad = juego.Cantidad; det.ValorTotal = det.Cantidad * det.ValorUnitario; det.NombreJuego = juego.Nom_juego; detalles.Add(det); bool existe = new DAOCarrito().existe(id_videojuego: juego.Id_videojuego); if (existe == true) { new DAOCarrito().updateCompra(juego, id_usuario); ClientScriptManager cm = this.ClientScript; cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('Compra realizada con éxito');</script>"); } else { ClientScriptManager cm = this.ClientScript; cm.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('El artículo " + det.NombreJuego + " ya no se encuentra disponible');</script>"); return; } } //new DAOCarrito().agregarDetalles(detalles); new DAOCarrito().agregarPedido(((Usuario)Session["user"]).Id_usuario, valorTotal); Pedido info = new DAOCarrito().obtenerPedido(((Usuario)Session["user"]).Id_usuario); foreach (var item in detalles) { item.Id_pedido = info.Id_pedido; new DAOCarrito().agregarDetalle(item); } GV_Carrito.DataBind(); B_Comprar.Visible = false; }
public bool ValidaDados() { if (editCpfCnpj.Text.Length == 11) { return(Biblioteca.ValidaCPF(editCpfCnpj.Text)); } if (editCpfCnpj.Text.Length == 14) { return(Biblioteca.ValidaCNPJ(editCpfCnpj.Text)); } return(false); }
private void BtColocar_Click(object sender, EventArgs e) { if (Biblioteca.ValidarFormulario(this, errorProvider1) == false) { bool existe = false; int numeroFila = 0; if (contadorFila == 0) { dataGridView1.Rows.Add(TxtCodigoProducto.Text, TxtDescripcion.Text, TxtPrecio.Text, TxtCantidad.Text); double importe = Convert.ToDouble(dataGridView1.Rows[contadorFila].Cells[2].Value) * Convert.ToDouble(dataGridView1.Rows[contadorFila].Cells[3].Value); dataGridView1.Rows[contadorFila].Cells[4].Value = importe; contadorFila++; } else { foreach (DataGridViewRow Fila in dataGridView1.Rows) { if (Fila.Cells[0].Value.ToString() == TxtCodigoProducto.Text) { existe = true; numeroFila = Fila.Index; } } if (existe == true) { dataGridView1.Rows[numeroFila].Cells[3].Value = (Convert.ToDouble(TxtCantidad.Text) + Convert.ToDouble(dataGridView1.Rows[numeroFila].Cells[3].Value)).ToString(); double importe = Convert.ToDouble(dataGridView1.Rows[numeroFila].Cells[2].Value) * Convert.ToDouble(dataGridView1.Rows[numeroFila].Cells[3].Value); dataGridView1.Rows[numeroFila].Cells[4].Value = importe; } else { dataGridView1.Rows.Add(TxtCodigoProducto.Text, TxtDescripcion.Text, TxtPrecio.Text, TxtCantidad.Text); double importe = Convert.ToDouble(dataGridView1.Rows[contadorFila].Cells[2].Value) * Convert.ToDouble(dataGridView1.Rows[contadorFila].Cells[3].Value); dataGridView1.Rows[contadorFila].Cells[4].Value = importe; contadorFila++; } } } total = 0; foreach (DataGridViewRow Fila in dataGridView1.Rows) { total += Convert.ToDouble(Fila.Cells[4].Value); } lbTotal.Text = "MXN$ " + total.ToString(); }
public void agregarBiblioteca(Videojuego juego, int UsuarioId, int cantidadPedida) { using (var db = new Mapeo()) { Biblioteca agregar = new Biblioteca(); agregar.Id_usuario = UsuarioId; agregar.Id_videojuego = juego.Id_videojuego; agregar.Cantidad = cantidadPedida; agregar.Poseido = false; agregar.Deseado = false; db.lib.Add(agregar); db.SaveChanges(); } }
public ActionResult Edit(int?ID) { if (ID == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Biblioteca biblioteca = _context.Bibliotecas.Find(ID); if (biblioteca == null) { return(HttpNotFound()); } return(View(biblioteca)); }
public override void Eliminar() { try { string eliminar = string.Format("EXEC EliminarClientes '{0}'", textId_Cliente.Text.Trim()); Biblioteca.Herramientas(eliminar); MessageBox.Show("El cliente se ha eliminado correctamente"); } catch (Exception error) { MessageBox.Show("Ha ocurrido un error" + error); } }
private void FEfetuaPagamento_Shown(object sender, EventArgs e) { TotalVenda = 0; Desconto = 0; Acrescimo = 0; TotalReceber = 0; TotalRecebido = 0; Troco = 0; QuantidadeCartao = 0; if (Sessao.Instance.VendaAtual.TaxaAcrescimo > 0) { Sessao.Instance.VendaAtual.Acrescimo = Biblioteca.TruncaValor(Sessao.Instance.VendaAtual.TaxaAcrescimo / 100 * Sessao.Instance.VendaAtual.ValorVenda, Constantes.DECIMAIS_VALOR); } if (Sessao.Instance.VendaAtual.TaxaDesconto > 0) { Sessao.Instance.VendaAtual.Desconto = Biblioteca.TruncaValor(Sessao.Instance.VendaAtual.TaxaDesconto / 100 * Sessao.Instance.VendaAtual.ValorVenda, Constantes.DECIMAIS_VALOR); } // preenche valores nas variaveis TotalVenda = Sessao.Instance.VendaAtual.ValorVenda.Value; Acrescimo = Sessao.Instance.VendaAtual.Acrescimo.Value; Desconto = Sessao.Instance.VendaAtual.Desconto.Value; TotalReceber = Biblioteca.TruncaValor(TotalVenda + Acrescimo - Desconto, Constantes.DECIMAIS_VALOR); SaldoRestante = TotalReceber; SegundoCartaoCancelado = false; TransacaoComTef = false; CupomCancelado = false; PodeFechar = true; IndiceTransacaoTef = -1; AtualizaLabelsValores(); if (SaldoRestante > 0) { editValorPago.Text = SaldoRestante.ToString("0.00"); } else { editValorPago.Text = "0.00"; } // lista que vai acumular os meios de pagamento ListaTotalTipoPagamento = new List <EcfTotalTipoPagamentoDTO>(); // tela padrão TelaPadrao(); }
protected void btnAutentificare_Click(object sender, EventArgs e) { String Nume_complet = Biblioteca.Autentificare(txtUtilizator.Text, txtParola.Text); if (Nume_complet == null || Nume_complet.Length == 0) { lblMsg.Text = "Nume utilizator sau parola gresite!"; } else { Session.Add("Nume_utilizator", txtUtilizator.Text); Session.Add("Nume_complet", Nume_complet); FormsAuthentication.RedirectFromLoginPage(txtUtilizator.Text, false); } }
private void btn_copie_libro_Click(object sender, RoutedEventArgs e) { int x = 0; string titolo = txt_libro_da_cerc.Text; IEnumerable <string> libro = from Biblioteca in xmlDoc.Descendants("wiride") //Seleziona solo il Titolo in input where Biblioteca.Element("titolo").Value == titolo select Biblioteca.Element("titolo").Value; foreach (string name in libro) { x++; } lbl_libri_aut.Items.Add("Sono presenti " + x + " copie/a di " + titolo); }
// GET: Pelicula/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } bib = new Biblioteca(); PeliculaDTO peliculaDTO = bib.mostrarPeliculas(id ?? 0); if (peliculaDTO == null) { return(HttpNotFound()); } return(View(peliculaDTO)); }
public ActionResult Delete(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } bib = new Biblioteca(); LibroDTO librosdto = bib.mostrarLibros(id ?? 0); if (librosdto == null) { return(HttpNotFound()); } return(View(librosdto)); }
// GET: Serie/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } bib = new Biblioteca(); SerieTVDTO serieTVDTO = bib.mostrarSeries(id ?? 0); if (serieTVDTO == null) { return(HttpNotFound()); } return(View(serieTVDTO)); }
private void button1_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text.Trim()) == false) //sino null o vacio { try { DataSet dataset; string buscar = "Select * from Articulos WHERE nombre_producto LIKE ('%" + textBox1.Text.Trim() + "%')";//alguna letra % % dataset = Biblioteca.Herramientas(buscar); dataGridView1.DataSource = dataset.Tables[0]; } catch (Exception error) { MessageBox.Show("No se puede conectar, Error: " + error.Message); } } }
private void Button11_Click(object sender, EventArgs e) { try { Memo2.Clear(); Memo2.AppendText("Mês = " + Biblioteca.Desencripta(ListaPagamento[Grid2.CurrentRow.Index].a)); Memo2.AppendText("\rAno = " + Biblioteca.Desencripta(ListaPagamento[Grid2.CurrentRow.Index].b)); Memo2.AppendText("\rVencimento = " + Biblioteca.Desencripta(ListaPagamento[Grid2.CurrentRow.Index].c)); Memo2.AppendText("\rBloqueio = " + Biblioteca.Desencripta(ListaPagamento[Grid2.CurrentRow.Index].d)); Memo2.AppendText("\rLiberado = " + Biblioteca.Desencripta(ListaPagamento[Grid2.CurrentRow.Index].e)); } catch (Exception eError) { MessageBox.Show(eError.Message); } }
//Buscar private void BtBuscar_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(TxtCodigoCliente.Text.Trim()) == false) { string cmd = string.Format("SELECT nombre_cliente FROM Clientes WHERE id_cliente = '{0}'", TxtCodigoCliente.Text.Trim()); DataSet dataset = Biblioteca.Herramientas(cmd); TxtCliente.Text = dataset.Tables[0].Rows[0]["nombre_cliente"].ToString().Trim(); TxtCodigoProducto.Focus();//Focus } } catch (Exception error) { MessageBox.Show("Ha ocurrido un error" + error.Message); } }
public void RetornoOperador(MovimentoVO pMovimento) { ConsultaSQL = "update ECF_MOVIMENTO set STATUS_MOVIMENTO=" + Biblioteca.QuotedStr("A") + " where ID = ?pId"; try { comando = new MySqlCommand(ConsultaSQL, conexao); comando.Parameters.AddWithValue("?pId", pMovimento.Id); comando.ExecuteNonQuery(); } catch (Exception eError) { Log.write(eError.ToString()); } }
public List <FichaTecnicaVO> TabelaFichaTecnica(string pIdProduto) { List <FichaTecnicaVO> ListaFichaTecnica = new List <FichaTecnicaVO>(); ConsultaSQL = " select " + " f.ID, " + " f.ID_PRODUTO, " + " f.DESCRICAO, " + " f.ID_PRODUTO_FILHO, " + " f.QUANTIDADE " + " from " + " FICHA_TECNICA f " + " where " + " f.ID_PRODUTO = " + Biblioteca.QuotedStr(pIdProduto); try { comando = new MySqlCommand(ConsultaSQL, conexao); leitor = comando.ExecuteReader(); while (leitor.Read()) { FichaTecnicaVO FichaTecnica = new FichaTecnicaVO(); FichaTecnica.Id = Convert.ToInt32(leitor["ID"]); FichaTecnica.IdProduto = Convert.ToInt32(leitor["ID_PRODUTO"]); FichaTecnica.IdProdutoFilho = Convert.ToInt32(leitor["ID_PRODUTO_FILHO"]); FichaTecnica.Descricao = leitor["DESCRICAO"].ToString(); FichaTecnica.Quantidade = Convert.ToDecimal(leitor["QUANTIDADE"]); ListaFichaTecnica.Add(FichaTecnica); } return(ListaFichaTecnica); } catch (Exception eError) { Log.write(eError.ToString()); return(null); } finally { if (leitor != null) { leitor.Close(); } } }
public List <R02VO> TabelaR02(string pDataInicio, string pDataFim, int pIdImpressora) { ConsultaSQL = "select * from R02 where " + "ID_IMPRESSORA=" + Convert.ToString(pIdImpressora) + " and (DATA_MOVIMENTO between " + Biblioteca.QuotedStr(pDataInicio) + " and " + Biblioteca.QuotedStr(pDataFim) + ")"; try { List <R02VO> ListaR02 = new List <R02VO>(); comando = new MySqlCommand(ConsultaSQL, conexao); leitor = comando.ExecuteReader(); while (leitor.Read()) { R02VO R02 = new R02VO(); R02.Id = Convert.ToInt32(leitor["ID"]); R02.IdOperador = Convert.ToInt32(leitor["ID_OPERADOR"]); R02.IdImpressora = Convert.ToInt32(leitor["ID_IMPRESSORA"]); R02.IdCaixa = Convert.ToInt32(leitor["ID_ECF_CAIXA"]); R02.SerieEcf = Convert.ToString(leitor["SERIE_ECF"]); R02.CRZ = Convert.ToInt32(leitor["CRZ"]); R02.COO = Convert.ToInt32(leitor["COO"]); R02.CRO = Convert.ToInt32(leitor["CRO"]); R02.DataMovimento = (DateTime)(leitor["DATA_MOVIMENTO"]); R02.DataEmissao = (DateTime)(leitor["DATA_EMISSAO"]); R02.HoraEmissao = Convert.ToString(leitor["HORA_EMISSAO"]); R02.VendaBruta = Convert.ToDecimal(leitor["VENDA_BRUTA"]); R02.GrandeTotal = Convert.ToDecimal(leitor["GRANDE_TOTAL"]); R02.HashTripa = Convert.ToString(leitor["HASH_TRIPA"]); R02.HashIncremento = Convert.ToInt32(leitor["HASH_INCREMENTO"]); ListaR02.Add(R02); } return(ListaR02); } catch (Exception eError) { Log.write(eError.ToString()); return(null); } finally { if (leitor != null) { leitor.Close(); } } }
public List <R06VO> TabelaR06(string pDataInicio, string pDataFim, int pIdImpressora) { ConsultaSQL = "select * from R06 where " + "ID_IMPRESSORA=" + Convert.ToString(pIdImpressora) + " and (DATA_EMISSAO between " + Biblioteca.QuotedStr(pDataInicio) + " and " + Biblioteca.QuotedStr(pDataFim) + ")"; try { List <R06VO> ListaR06 = new List <R06VO>(); comando = new MySqlCommand(ConsultaSQL, conexao); leitor = comando.ExecuteReader(); while (leitor.Read()) { R06VO R06 = new R06VO(); R06.Id = Convert.ToInt32(leitor["ID"]); R06.IdOperador = Convert.ToInt32(leitor["ID_OPERADOR"]); R06.IdImpressora = Convert.ToInt32(leitor["ID_IMPRESSORA"]); R06.IdCaixa = Convert.ToInt32(leitor["ID_ECF_CAIXA"]); R06.COO = Convert.ToInt32(leitor["COO"]); R06.GNF = Convert.ToInt32(leitor["GNF"]); R06.GRG = Convert.ToInt32(leitor["GRG"]); R06.CDC = Convert.ToInt32(leitor["CDC"]); R06.Denominacao = Convert.ToString(leitor["DENOMINACAO"]); R06.DataEmissao = Convert.ToDateTime(Convert.ToString(leitor["DATA_EMISSAO"])); R06.HoraEmissao = Convert.ToString(leitor["HORA_EMISSAO"]); R06.SerieEcf = Convert.ToString(leitor["SERIE_ECF"]); R06.HashTripa = Convert.ToString(leitor["HASH_TRIPA"]); R06.HashIncremento = Convert.ToInt32(leitor["HASH_INCREMENTO"]); ListaR06.Add(R06); } return(ListaR06); } catch (Exception eError) { Log.write(eError.ToString()); return(null); } finally { if (leitor != null) { leitor.Close(); } } }
public OperadorVO ConsultaUsuario(string pLogin, string pSenha) { ConsultaSQL = "select " + " O.ID, " + " O.ID_ECF_FUNCIONARIO, " + " O.LOGIN, " + " O.SENHA, " + " F.NIVEL_AUTORIZACAO " + "from " + " ECF_OPERADOR O, ECF_FUNCIONARIO F " + "where " + " O.ID_ECF_FUNCIONARIO=F.ID " + " and LOGIN="******" and SENHA=" + Biblioteca.QuotedStr(pSenha); try { comando = new MySqlCommand(ConsultaSQL, conexao); leitor = comando.ExecuteReader(); if (leitor.Read()) { OperadorVO Operador = new OperadorVO(); Operador.Id = Convert.ToInt32(leitor["ID"]); Operador.IdFuncionario = Convert.ToInt32(leitor["ID_ECF_FUNCIONARIO"]); Operador.Login = Convert.ToString(leitor["LOGIN"]); Operador.Senha = Convert.ToString(leitor["SENHA"]); Operador.Nivel = Convert.ToString(leitor["NIVEL_AUTORIZACAO"]); return(Operador); } else { return(null); } } catch (Exception eError) { Log.write(eError.ToString()); return(null); } finally { if (leitor != null) { leitor.Close(); } } }
private void Confirma() { string Mensagem; // impressao do documento no ECF if (cbAImpressaododocumentonoECF.Checked) { if (MessageBox.Show("Deseja imprimir a LMFS - Leitura Memória Fiscal Simplificada?", "Pergunta do Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { // por data if (cbPeriododeData.Checked) { FDataModule.ACBrECF.LeituraMemoriaFiscal(Convert.ToDateTime(mkeDataIni.Text), Convert.ToDateTime(mkeDataFim.Text), true); } // por reducao; else if (cbIntervaloCRZ.Checked) { FDataModule.ACBrECF.LeituraMemoriaFiscal(Convert.ToInt32(editInicio.Text), Convert.ToInt32(editFim.Text), true); } } } // Gravacao de arquivo eletronico no formato de espelho if (cbBGravacaodearquivoeletroniconoformatodeespelho.Checked) { if (MessageBox.Show("Deseja gerar o arquivo da LMFS - Formato Espelho?", "Pergunta do Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { NomeArquivo = Application.StartupPath + "\\LMFS_Completa.txt"; // por data if (cbPeriododeData.Checked) { FDataModule.ACBrECF.LeituraMemoriaFiscalSerial(Convert.ToDateTime(mkeDataIni.Text), Convert.ToDateTime(mkeDataFim.Text), NomeArquivo, true); } // por reducao else if (cbIntervaloCRZ.Checked) { FDataModule.ACBrECF.LeituraMemoriaFiscalSerial(Convert.ToInt32(editInicio.Text), Convert.ToInt32(editFim.Text), NomeArquivo, true); } } //FDataModule.ACBrPAF.AssinarArquivoComEAD(NomeArquivo); Biblioteca.AssinarComOpenSsl(NomeArquivo); Mensagem = "Arquivo armazenado em: " + NomeArquivo; MessageBox.Show(Mensagem, "Informação do Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void BtnBuscar_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(textBox1.Text.Trim()) == false) { try { DataSet DS; string buscar = "Select * from Factura WHERE NumeroFactura LIKE ('%" + textBox1.Text.Trim() + "%')"; DS = Biblioteca.Validaciones(buscar); dataGridView1.DataSource = DS.Tables[0]; } catch (Exception error) { MessageBox.Show("No se puede conectar, Error: ", error.Message); } } }
public void addBilioteca(int libro, Usuario user) { var app = new AppContext(); // TO-DO validar si ya existe el libro en la biblioteca, en ese caso no guardar y notificar var biblioteca = new Biblioteca { LibroId = libro, UsuarioId = user.Id, Estado = ESTADO.POR_LEER }; cont.Bibliotecas.Add(biblioteca); cont.SaveChanges(); }
private void btn_cerca_gen_libro_Click(object sender, RoutedEventArgs e) { string gen = txt_genere.Text; //Trova genere Romanzo IEnumerable <string> libro = from Biblioteca in xmlDoc.Descendants("wiride") where Biblioteca.Element("genere").Value.Contains(gen) select Biblioteca.Element("titolo").Value; int count = 0; foreach (string name in libro) { count++; } lbl_libri_aut.Items.Add("Il numero di libri di genere: " + gen + " è " + count); }