Cliente.Unit LeituraFuncionario() { var c = new Cliente.Unit(); c.ID = txtCodigo.Text; c.Nome = txtNomeCliente.Text; c.NomeMae = txtNomeMae.Text; c.NomePai = txtNomePai.Text; if (chkTemPai.Checked) { c.NaoTemPai = true; } else { c.NaoTemPai = false; } if (rdbMasc.Checked) { c.Genero = "M"; } if (rdbFem.Checked) { c.Genero = "F"; } if (rdbInde.Checked) { c.Genero = "I"; } c.CPF = txtCPF.Text; c.CEP = txtCEP.Text; c.Logradouro = txtLogradouro.Text; c.Complemento = txtComplemento.Text; c.Cidade = txtCidade.Text; c.Bairro = txtBairro.Text; if (cbbEstados.SelectedIndex < 0) { c.Estado = ""; } else { c.Estado = cbbEstados.Items[cbbEstados.SelectedIndex].ToString(); } c.Telefone = txtTelefone.Text; c.Profissao = txtProfissao.Text; if (Information.IsNumeric(txtRendaFamiliar.Text)) { double vRenda = Convert.ToDouble(txtRendaFamiliar.Text); if (vRenda < 0) { c.RendaFamiliar = 0; } else { c.RendaFamiliar = vRenda; } } return(c); }
private void Dg_Clientes_DoubleClick(object sender, EventArgs e) { try { DataGridViewRow row = new DataGridViewRow(); row = Dg_Clientes.SelectedRows[0]; string id = row.Cells[0].Value.ToString(); Cliente.Unit c = new Cliente.Unit(); c = c.BuscarFicharioSQLREL(id); if (c == null) { MessageBox.Show("Identificador não encontrado.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { EscreveFormulario(c); } } catch (Exception ex) { MessageBox.Show(ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void EscreveFormulario(Cliente.Unit C) { Txt_Codigo.Text = C.Id; Txt_NomeCliente.Text = C.Nome; Txt_NomeMae.Text = C.NomeMae; if (C.NaoTemPai == 1) { Chk_TemPai.Checked = true; Txt_NomePai.Text = ""; } else { Chk_TemPai.Checked = false; Txt_NomePai.Text = C.NomePai; } if (C.Genero == 0) { Rdb_Masculino.Checked = true; } if (C.Genero == 1) { Rdb_Feminino.Checked = true; } if (C.Genero == 3) { Rdb_Indefinido.Checked = true; } Txt_CPF.Text = C.Cpf; Txt_CEP.Text = C.Cep; Txt_Logradouro.Text = C.Logradouro; Txt_Complemento.Text = C.Complemento; Txt_Cidade.Text = C.Cidade; Txt_Bairro.Text = C.Bairro; Txt_Telefone.Text = C.Telefone; Txt_Profissao.Text = C.Profissao; if (C.Estado == "") { Cmb_Estados.SelectedIndex = -1; } else { for (int i = 0; i <= Cmb_Estados.Items.Count - 1; i++) { if (C.Estado == Cmb_Estados.Items[i].ToString()) { Cmb_Estados.SelectedIndex = i; } } } Txt_RendaFamiliar.Text = C.RendaFamiliar.ToString(); }
private void novoToolStripButton_Click(object sender, System.EventArgs e) { try { var cliente = new Cliente.Unit(); cliente = LeituraFuncionario(); cliente.ValidaClasse(); cliente.ValidaComplemento(); MessageBox.Show("Classe foi inicializada sem erros!", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (ValidationException ex) { MessageBox.Show(ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { MessageBox.Show(ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void salvarToolStripButton_Click(object sender, EventArgs e) { if (Txt_Codigo.Text == "") { MessageBox.Show("Código do Cliente vazio.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { Cliente.Unit C = new Cliente.Unit(); C = LeituraFormulario(); C.ValidaClasse(); C.ValidaComplemento(); //C.AlterarFichario("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); //C.AlterarFicharioDB("Cliente"); //C.AlterarFicharioSQL("Cliente"); C.AlterarFicharioSQLREL(); MessageBox.Show("OK: Indentificador alterado com sucesso", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); AtualizaGrid(); //string clienteJson = Cliente.SerializedClassUnit(C); //Fichario F = new Fichario("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); //if (F.status) //{ // F.Alterar(C.Id, clienteJson); // if (F.status) // { // MessageBox.Show("OK: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); // } // else // { // MessageBox.Show("ERR: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} //else //{ // MessageBox.Show("ERR: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } catch (ValidationException Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void salvarToolStripButton_Click(object sender, EventArgs e) { string codigoCliente = Txt_Codigo.Text; if (codigoCliente == "") { MessageBox.Show("Código do Cliente vazio.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { Cliente.Unit C = new Cliente.Unit(); C = LeituraFormulario(); C.ValidaClasse(); C.ValidaComplemento(); C.AlterarFichario("D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); MessageBox.Show($"OK: Identificador alterado com sucesso.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); //string clienteJson = Cliente.SerializeClassUnit(C); //Fichario f = new Fichario("D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); //if (f.Status) //{ // f.Alterar(C.Id, clienteJson); // if (f.Status) // { // MessageBox.Show($"OK: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); // } // else // { // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} //else //{ // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } catch (ValidationException Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void abrirToolStripButton_Click(object sender, EventArgs e) { if (Txt_Codigo.Text == "") { MessageBox.Show("Código do Cliente vazio.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { Cliente.Unit C = new Cliente.Unit(); //C = C.BuscarFicharioDB(Txt_Codigo.Text, "C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); //C = C.BuscarFicharioDB(Txt_Codigo.Text, "Cliente"); //C = C.BuscarFicharioSQL(Txt_Codigo.Text, "Cliente"); C = C.BuscarFicharioSQLREL(Txt_Codigo.Text); if (C == null) { MessageBox.Show("Identificador não encontrado.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { EscreveFormulario(C); } //Fichario F = new Fichario("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); //if (F.status) //{ // string clienteJson = F.Buscar(Txt_Codigo.Text); // Cliente.Unit C = new Cliente.Unit(); // C = Cliente.DesSerializedClassUnit(clienteJson); // EscreveFormulario(C); //} //else //{ // MessageBox.Show("ERR: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } catch (Exception Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void newToolStripButton_Click(object sender, EventArgs e) { try { Cliente.Unit C = new Cliente.Unit(); C = LeituraFormulario(); C.ValidaClasse(); C.ValidaComplemento(); MessageBox.Show("Classe foi inicializada sem erros", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (ValidationException Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void abrirToolStripButton_Click(object sender, EventArgs e) { string codigoCliente = Txt_Codigo.Text; if (codigoCliente == "") { MessageBox.Show("Código do Cliente vazio.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { Cliente.Unit cliente = new Cliente.Unit(); cliente = cliente.BuscarFichario(codigoCliente, "D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); EscreveFormulario(cliente); } catch (Exception ex) { MessageBox.Show(ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } //Fichario f = new Fichario("D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); //if (f.Status) //{ // string clienteJson = f.Buscar(codigoCliente); // if (f.Status) // { // Cliente.Unit cliente = Cliente.DeserializeClassUnit(clienteJson); // EscreveFormulario(cliente); // } // else // { // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} //else //{ // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } }
private void novoToolStripButton_Click(object sender, EventArgs e) { try { Cliente.Unit C = new Cliente.Unit(); C = LeituraFormulario(); C.ValidaClasse(); C.ValidaComplemento(); //C.IncluirFichario("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); //C.IncluirFichario(Directory.GetCurrentDirectory()); C.IncluirFicharioDB("Cliente"); MessageBox.Show("OK: Indentificador incluido com sucesso", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); //string clienteJson = Cliente.SerializedClassUnit(C); //Fichario F = new Fichario("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); //if (F.status) //{ // F.Incluir(C.Id, clienteJson); // if (F.status) // { // MessageBox.Show("OK: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); // } // else // { // MessageBox.Show("ERR: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} //else //{ // MessageBox.Show("ERR: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } catch (ValidationException Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void EscreveFormulario(Cliente.Unit cliente) { Txt_Codigo.Text = cliente.Id; Txt_NomeCliente.Text = cliente.Nome; Txt_NomeMae.Text = cliente.NomeMae; Txt_NomePai.Text = cliente.NomePai; Chk_TemPai.Checked = cliente.NaoTemPai; Rdb_Masculino.Checked = cliente.Genero == 0; Rdb_Feminino.Checked = cliente.Genero == 1; Rdb_Indefinido.Checked = cliente.Genero == 2; Txt_CPF.Text = cliente.Cpf; Txt_CEP.Text = cliente.Cep; Txt_Logradouro.Text = cliente.Logradouro; Txt_Complemento.Text = cliente.Complemento; Txt_Cidade.Text = cliente.Cidade; Txt_Bairro.Text = cliente.Bairro; Txt_Telefone.Text = cliente.Telefone; Txt_Profissao.Text = cliente.Profissao; Cmb_Estados.SelectedIndex = Cmb_Estados.Items.IndexOf(cliente.Estado); Txt_RendaFamiliar.Text = cliente.RendaFamiliar.ToString(); }
private void AtualizaGrid() { try { Dg_Clientes.Rows.Clear(); Cliente.Unit C = new Cliente.Unit(); var ListaBusca = C.BuscarFicharioDBTodosSQLREL(); foreach (var item in ListaBusca) { DataGridViewRow row = new DataGridViewRow(); row.CreateCells(Dg_Clientes); row.Cells[0].Value = item[0].ToString(); row.Cells[1].Value = item[1].ToString(); Dg_Clientes.Rows.Add(row); } } catch (Exception Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private Cliente.Unit LeituraFormulario() { Cliente.Unit C = new Cliente.Unit(); C.Id = Txt_Codigo.Text; C.Nome = Txt_NomeCliente.Text; C.NomeMae = Txt_NomeMae.Text; C.NomePai = Txt_NomePai.Text; if (Chk_TemPai.Checked) { C.NaoTemPai = true; } else { C.NaoTemPai = false; } if (Rdb_Masculino.Checked) { C.Genero = 0; } if (Rdb_Feminino.Checked) { C.Genero = 1; } if (Rdb_Indefinido.Checked) { C.Genero = 2; } C.Cpf = Txt_CPF.Text; C.Cep = Txt_CEP.Text; C.Logradouro = Txt_Logradouro.Text; C.Complemento = Txt_Complemento.Text; C.Cidade = Txt_Cidade.Text; C.Bairro = Txt_Bairro.Text; if (Cmb_Estados.SelectedIndex < 0) { C.Estado = ""; } else { C.Estado = Cmb_Estados.Items[Cmb_Estados.SelectedIndex].ToString(); } C.Telefone = Txt_Telefone.Text; C.Profissao = Txt_Profissao.Text; if (Information.IsNumeric(Txt_RendaFamiliar.Text)) { Double vRenda = Convert.ToDouble(Txt_RendaFamiliar.Text); if (vRenda < 0) { C.RendaFamiliar = 0; } else { C.RendaFamiliar = vRenda; } } return(C); }
private void Btn_Busca_Click(object sender, EventArgs e) { try { Cliente.Unit C = new Cliente.Unit(); //var ListaBusca = C.BuscarFicharioTodos("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); var ListaBusca = C.BuscarFicharioDBTodosDB("Cliente"); Frm_Busca FForm = new Frm_Busca(ListaBusca); FForm.ShowDialog(); if (FForm.DialogResult == DialogResult.OK) { var idSelect = FForm.idSelect; //C = C.BuscarFichario(idSelect, "C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); C = C.BuscarFicharioDB(idSelect, "Cliente"); if (C == null) { MessageBox.Show("Identificador não encontrado.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { EscreveFormulario(C); } } } catch (Exception Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } //Fichario F = new Fichario("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); //if (F.status) //{ // List<string> List = new List<string>(); // List = F.BuscarTodos(); // if (F.status) // { // List<List<string>> ListaBusca = new List<List<string>> (); // for (int i = 0; i <= List.Count - 1; i++) // { // Cliente.Unit C = Cliente.DesSerializedClassUnit(List[i]); // ListaBusca.Add(new List<string> { C.Id, C.Nome }); // } // Frm_Busca FForm = new Frm_Busca(ListaBusca); // FForm.ShowDialog(); // if (FForm.DialogResult == DialogResult.OK) // { // var idSelect = FForm.idSelect; // string clienteJson = F.Buscar(idSelect); // Cliente.Unit C = new Cliente.Unit(); // C = Cliente.DesSerializedClassUnit(clienteJson); // EscreveFormulario(C); // } // } // else // { // MessageBox.Show("ERR " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} //else //{ // MessageBox.Show("ERR: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} }
private void ApagatoolStripButton_Click(object sender, EventArgs e) { string codigoCliente = Txt_Codigo.Text; if (codigoCliente == "") { MessageBox.Show("Código do Cliente vazio.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { Cliente.Unit cliente = new Cliente.Unit(); cliente = cliente.BuscarFichario(codigoCliente, "D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); if (cliente == null) { MessageBox.Show("Identificador não encontrado.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { EscreveFormulario(cliente); Frm_Questao db = new Frm_Questao("icons8-question-mark-96", "Excluir o cliente?"); if (db.ShowDialog() == DialogResult.Yes) { try { cliente.ApagarFichario("D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); LimparFormulario(); MessageBox.Show($"OK: Identificador apagado com sucesso.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } //Fichario f = new Fichario("D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); //if (f.Status) //{ // string clienteJson = f.Buscar(codigoCliente); // if (f.Status) // { // Cliente.Unit cliente = Cliente.DeserializeClassUnit(clienteJson); // EscreveFormulario(cliente); // Frm_Questao db = new Frm_Questao("icons8-question-mark-96", "Excluir o cliente?"); // if (db.ShowDialog() == DialogResult.Yes) // { // f.Apagar(codigoCliente); // if (f.Status) // { // LimparFormulario(); // MessageBox.Show($"OK: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); // } // else // { // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // } // } // else // { // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} //else //{ // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } }
private void Btn_Busca_Click(object sender, EventArgs e) { try { Cliente.Unit cliente = new Cliente.Unit(); List <string> lista = cliente.ListaFichario("D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); if (lista.Count == 0) { MessageBox.Show("Base de dados vazia. Nenhum identificador cadastrado.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { List <List <string> > ListaBusca = new List <List <string> >(); foreach (var item in lista) { cliente = Cliente.DeserializeClassUnit(item); ListaBusca.Add(new List <string> { cliente.Id, cliente.Nome }); } Frm_Busca form = new Frm_Busca(ListaBusca); if (form.ShowDialog() == DialogResult.OK) { cliente = cliente.BuscarFichario(form.IdSelected, "D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); if (cliente == null) { MessageBox.Show("Identificador não encontrado.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { EscreveFormulario(cliente); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } //Fichario f = new Fichario("D:\\Windows Forms com C# - Manipulando os Dados do Cliente\\CursoWindowsForms\\Fichario"); //if (f.Status) //{ // List<string> lista = f.BuscarTodos(); // if (f.Status) // { // List<List<string>> ListaBusca = new List<List<string>>(); // foreach (var item in lista) // { // Cliente.Unit cliente = Cliente.DeserializeClassUnit(item); // ListaBusca.Add(new List<string> { cliente.Id, cliente.Nome }); // } // Frm_Busca form = new Frm_Busca(ListaBusca); // if (form.ShowDialog() == DialogResult.OK) // { // string clienteJson = f.Buscar(form.IdSelected); // if (f.Status) // { // Cliente.Unit cliente = Cliente.DeserializeClassUnit(clienteJson); // EscreveFormulario(cliente); // } // else // { // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // } // } // else // { // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} //else //{ // MessageBox.Show($"ERR: {f.Mensagem}", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} }
private void ApagatoolStripButton_Click(object sender, EventArgs e) { if (Txt_Codigo.Text == "") { MessageBox.Show("Código do Cliente vazio.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { try { Cliente.Unit C = new Cliente.Unit(); //C = C.BuscarFichario(Txt_Codigo.Text, "C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); C = C.BuscarFicharioDB(Txt_Codigo.Text, "Cliente"); if (C == null) { MessageBox.Show("Identificador não encontrado.", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { EscreveFormulario(C); Frm_Questao Db = new Frm_Questao("icons8_question_mark_961", "Você quer excluir o cliente?"); Db.ShowDialog(); if (Db.DialogResult == DialogResult.Yes) { //C.ApagarFichario("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); C.ApagarFicharioDB("Cliente"); MessageBox.Show("OK: Indentificador apagado com sucesso", "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); LimparFormulario(); } } } catch (Exception Ex) { MessageBox.Show(Ex.Message, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); } //Fichario F = new Fichario("C:\\WindowsForms\\Curso\\CursoWindowsForms\\Fichario"); //if (F.status) //{ // string clienteJson = F.Buscar(Txt_Codigo.Text); // Cliente.Unit C = new Cliente.Unit(); // C = Cliente.DesSerializedClassUnit(clienteJson); // EscreveFormulario(C); // Frm_Questao Db = new Frm_Questao("icons8_question_mark_961", "Você quer excluir o cliente?"); // Db.ShowDialog(); // if (Db.DialogResult == DialogResult.Yes) // { // F.Apagar(Txt_Codigo.Text); // if (F.status) // { // MessageBox.Show("OK: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Information); // LimparFormulario(); // } // else // { // MessageBox.Show("ERR: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // } //} //else //{ // MessageBox.Show("ERR: " + F.mensagem, "ByteBank", MessageBoxButtons.OK, MessageBoxIcon.Error); //} } }