Ejemplo n.º 1
0
        protected void GridLivro_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                livroDTO.IdLivro      = int.Parse(e.NewValues[0].ToString());
                livroDTO.IdAutor      = int.Parse(e.NewValues[1].ToString());
                livroDTO.IdEditora    = int.Parse(e.NewValues[2].ToString());
                livroDTO.Titulo       = e.NewValues[3].ToString();
                livroDTO.DataCadastro = Convert.ToDateTime(e.NewValues[4]);
                livroDTO.NumPaginas   = int.Parse(e.NewValues[5].ToString());
                livroDTO.Valor        = double.Parse(e.NewValues[6].ToString());

                livroBLL.update(livroDTO);

                GridLivro.EditIndex = -1;
                PopulateGrid();
            }
            catch (Exception ex)
            {
                messageError.Visible = true;
                messageError.Text    = ex.Message;
            }
        }