public AcervoEditView(tblProduto produto, FuncionarioEditView.EditContext ctx) { _produtoAtual = produto; _context = ctx; InitializeComponent(); if (ctx == FuncionarioEditView.EditContext.Creating) { } else { txtID.Text = $"ID {_produtoAtual.IDProduto}"; txtEditora.Text = _produtoAtual.Editora; txtAno.Text = $"{_produtoAtual.AnoEdicao?.Year}"; txtGêneros.Text = string.Join(",", _produtoAtual.tblGeneroProduto.Select(g => g.tblGenero.NomeGenero)); txtSinopse.Text = _produtoAtual.DescricaoProd; txtAutor.Text = _produtoAtual.AutoresLivro; txtTítulo.Text = _produtoAtual.NomeLivro; txtPrateleira.Text = $"{_produtoAtual.Prateleira}"; txtFileira.Text = $"{_produtoAtual.Fileira}"; txtSetor.Text = $"{_produtoAtual.Setor}"; var converter = new ByteToImageConverter(); imgProduto.Source = (ImageSource)converter.Convert(_produtoAtual.ImagemProd, typeof(ImageSource), null, null); } }
public ClienteDetailsView(tblLeitor leitor, FuncionarioEditView.EditContext ctx) { _context = ctx; InitializeComponent(); txtNome.Text = leitor.Nome; txtEmail.Text = leitor.Email; txtCPF.Text = leitor.CPF.ApplyCPFMask(); txtCargo.Text = leitor.tblTipoLeitor.TipoLeitor; txtEndereço.Text = leitor.Endereco; txtRG.Text = leitor.RG.ApplyRGMask(); txtTel.Text = leitor.Telefone.ApplyTelMask(); txtID.Text = $"ID: {leitor.IDLeitor}"; _currentLeitor = leitor; var converter = new ByteToImageConverter(); imgFuncionario.Source = (ImageSource)converter.Convert(leitor.ImagemLeitor, typeof(ImageSource), null, null); if (_context == FuncionarioEditView.EditContext.Creating) { txtHeader.Text = "Vamos adcionar este novo membro na nossa equipe! Essas informações estão corretas?"; } }
public FuncionarioDetailsView(tblFuncionario funcionario, FuncionarioEditView.EditContext ctx) { _context = ctx; InitializeComponent(); txtNome.Text = funcionario.Nome; txtEmail.Text = funcionario.Email; txtCPF.Text = funcionario.CPF.ApplyCPFMask(); txtCargo.Text = funcionario.tblCargo.NomeCargo; txtEndereço.Text = funcionario.Endereco; txtRG.Text = funcionario.RG.ApplyRGMask(); txtTel.Text = funcionario.Telefone.ApplyTelMask(); txtID.Text = $"ID: {funcionario.IDFuncionario}"; _currentFuncionario = funcionario; var converter = new ByteToImageConverter(); imgFuncionario.Source = (ImageSource)converter.Convert(funcionario.ImagemFunc, typeof(ImageSource), null, null); if (_context == FuncionarioEditView.EditContext.Creating) { txtHeader.Text = "Vamos adcionar este novo membro na nossa equipe! Essas informações estão corretas?"; } }
public ClienteEditView(tblLeitor leitor, FuncionarioEditView.EditContext ctx) { _currentLeitor = leitor; _context = ctx; InitializeComponent(); using var db = new TCCFEntities(); var tiposLeitor = db.tblTipoLeitor.Select(t => t.TipoLeitor).ToList(); foreach (var tipo in tiposLeitor) { cbxCargo.Items.Add(tipo); } if (_context == FuncionarioEditView.EditContext.Creating) { txtHeader.Text = "Vamos adicionar este leitor na nossa equipe"; } else { txtNome.Text = _currentLeitor.Nome; txtEmail.Text = _currentLeitor.Email; txtCPF.Text = _currentLeitor.CPF; txtEndereço.Text = _currentLeitor.Endereco; txtRG.Text = _currentLeitor.RG; txtTel.Text = _currentLeitor.Telefone; txtID.Text = $"ID: {_currentLeitor.IDLeitor}"; cbxCargo.Text = _currentLeitor.tblTipoLeitor.TipoLeitor; if (_currentLeitor.IDLeitor != StateRepository.loggedInUser.Get().IDFuncionario) { StackPanel panelSenha = (StackPanel)txtSenha.Parent; panelSenha.Visibility = Visibility.Collapsed; StackPanel panelConfirmarSenha = (StackPanel)txtConfirmarSenha.Parent; panelConfirmarSenha.Visibility = Visibility.Collapsed; } var converter = new ByteToImageConverter(); if (_currentLeitor.ImagemLeitor != null) { if (_currentLeitor.ImagemLeitor != new byte[] { 0x00 }) { imgFuncionario.Source = (ImageSource)converter.Convert(_currentLeitor.ImagemLeitor, typeof(ImageSource), null, null); } } } }