Esempio n. 1
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            DepartmentDAO    departmentDAO = new DepartmentDAO();
            UpdateDepartment update        = new UpdateDepartment();

            update.Department.Dname    = dname.Text;
            update.Department.Director = int.Parse(DropDownList1.SelectedValue);
            departmentDAO.Insert(update);
            Response.Redirect("searchDept.aspx");
        }
        public void Insert(string Name, string Address)
        {
            Department dep = new Department();

            dep.Name    = Name;
            dep.Address = Address;
            DepartmentDAO dao = new DepartmentDAO();

            dao.Insert(dep);
        }