protected void btnExcluir_Click(object sender, EventArgs e) { FerramentaController fc = new FerramentaController(); Ferramenta fer = fc.BuscarPorMatricula(int.Parse(txtRMatricula.Text)); if (fer != null) { txtResultMatricula.Text = fer.Matricula; txtRDiametro.Text = fer.Diametro; //Convert.ToInt32(txtRlote.Text) = fer.LoteId; fc.Excluir(fer); } LimparCampo(); CarregarGridFerramentas(); }
protected void btnBuscar_Click(object sender, EventArgs e) { FerramentaController fc = new FerramentaController(); Ferramenta fer = fc.BuscarPorMatricula(int.Parse(txtRMatricula.Text)); if (fer != null) { //txtRMatricula.Text = fer.Matricula; txtResultMatricula.Text = fer.Matricula; txtRDiametro.Text = fer.Diametro; txtRlote.Text = fer.LoteId.ToString(); lblNExiste.Text = string.Empty; } else { lblNExiste.Text = "* Ferramenta procurada não existe!!!"; LimparCampo(); } }
protected void btnAlterar_Click(object sender, EventArgs e) { FerramentaController fc = new FerramentaController(); Ferramenta fer = fc.BuscarPorMatricula(int.Parse(txtRMatricula.Text)); if (fer != null) { fer.Matricula = txtResultMatricula.Text; fer.Diametro = txtRDiametro.Text; fer.LoteId = int.Parse(txtRlote.Text); fc.Editar(fer); lblNExiste.Text = "* Ferramenta Alterada!!!"; } else { lblNExiste.Text = "* Ferramenta procurada não existe!!!"; LimparCampo(); } CarregarGridFerramentas(); // LimparCampo(); }