Esempio n. 1
0
        protected void saveButton(object sender, EventArgs e)
        {
            Modelo.Authors aAuthors;
            DAL.DALAuthors aDALAuthor;

            aAuthors = new Modelo.Authors(codigo.Text, nome.Text, lName.Text, phone.Text, address.Text, city.Text, state.Text);

            aDALAuthor = new DAL.DALAuthors();

            aDALAuthor.Insert(aAuthors);

            Response.Redirect("~\\WebFormAuthors.aspx");
        }
        protected void Deleted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            string codigo;

            Modelo.Authors aAuthors;
            DAL.DALAuthors aDALAuthors;

            codigo = Detalhes.Rows[0].Cells[1].Text;

            aAuthors           = new Modelo.Authors();
            aAuthors.author_id = codigo;

            aDALAuthors = new DAL.DALAuthors();

            aDALAuthors.Delete(aAuthors);

            Response.Redirect("~\\WebFormAuthors.aspx");
        }