Exemplo n.º 1
0
 public Author(tbl_Author dbAuthor)
 {
     this.ID        = dbAuthor.ID;
     this.Name      = dbAuthor.Name;
     this.Birthdate = dbAuthor.Birthdate.Value;
     this.Address   = dbAuthor.Address;
 }
Exemplo n.º 2
0
        public void Add()
        {
            LibraryDBDataContext db = new LibraryDBDataContext();
            tbl_Author           a  = new tbl_Author();

            a.Name      = this.Name;
            a.Address   = this.Address;
            a.Birthdate = this.Birthdate;
            db.tbl_Authors.InsertOnSubmit(a);
            db.SubmitChanges();
            ID = a.ID;
        }