Esempio n. 1
0
 /// <summary>
 /// Constructeur
 /// </summary>
 /// <param name="GUID"> GUID</param>
 /// <param name="title">Titre</param>
 /// <param name="releasedate">Date de sortie</param>
 /// <param name="writer">Auteur</param>
 /// <param name="publisher">Editeur</param>
 /// <param name="price">Prix</param>
 /// <param name="type">Genre</param>
 /// <param name="description">Description</param>
 public Book(string GUID, string title, string releasedate, Author writer, Editor publisher,
                 double price, Kind type, string description)
 {
     this._GUID = GUID;
     this._title = title;
     this._releasedate = releasedate;
     this._writer = writer;
     this._publisher = publisher;
     this._price = price;
     this._type = type;
     this._description = description;
 }
 private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
 {
     // realizar cambios
     string id, fname, lname;
     id = e.Item.Cells[0].Text;
     fname = ((TextBox) (e.Item.Cells[1].Controls[0])).Text;
     lname = ((TextBox) (e.Item.Cells[2].Controls[0])).Text;
     Author a = new Author(id);
     a.LastName = lname;
     a.FirstName = lname;
     a.Update();
     DataGrid1.EditItemIndex = -1;
     reloadData();
 }
        private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            string id, fname, lname;

            id = e.Item.Cells[0].Text;
            fname = ((TextBox)(e.Item.Cells[1].Controls[0])).Text;
            lname = ((TextBox)(e.Item.Cells[2].Controls[0])).Text;

            // Creo un autor que esta en Business, pasando el ID
            Author a = new Author(id);
            a.fname = fname;
            a.lname = lname;
            a.Update();

            DataGrid1.EditItemIndex = -1;
            ReloadData();
        }
        private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            //realizar cambios
            string id;
            //Como el campo no es editable no tengo controls con lo que puedo consultar
            //directamente el text.
            id = e.Item.Cells[0].Text;
            string fname = ((TextBox) (e.Item.Cells[1].Controls[0])).Text;
            string lname = ((TextBox) (e.Item.Cells[2].Controls[0])).Text;

            //Clase a nivel business
            //AuthorManager.GetAuthor(id);
            Author a = new Author();
            a.Id = id;
            a.LastName = lname;
            a.FirstName = fname;
            a.Update();

            DataGrid1.EditItemIndex = -1;
            reloadData();
        }
Esempio n. 5
0
 /// <summary>
 /// Permet de modifier un livre dans la base de donnée
 /// </summary>
 /// <param name="GUID">GUID</param>
 /// <param name="titre">Titre</param>
 /// <param name="prix">Prix</param>
 /// <param name="aut">Author</param>
 /// <param name="ed">Editeur</param>
 /// <param name="genre">Genre</param>
 public void UpdateBookDB(string GUID, string titre, double prix, Author aut, Editor ed, Kind genre)
 {
     dataBase.UpdateBook(GUID, titre, prix, aut.GUID, ed.GUID, genre.GUID);
 }
Esempio n. 6
0
 /// <summary>
 /// Permet de transformer une liste d'Authors "Base de donnée" en 
 /// Authors utilisables dans la couche métier
 /// </summary>
 /// <param name="db"> Liste BDD d'Authors</param>
 public void AuthorAdaptor(List<AuthorDB> db)
 {
     Author Author;
     foreach (AuthorDB autDB in db)
     {
         Author = new Author(autDB.GUID, autDB.Name, autDB.FirstName, autDB.LastName);
         _authors.Add(Author);
     }
 }