Example #1
0
        // you should delete the info in Manager.Department
        // you need finish it
        // delete the Access db
        public static bool DeleteAccessDb(string dbName)
        {
            //  delete from the info in department
            DepartmentDao dao  = new DepartmentDao();
            Department    bean = dao.loadByName(dbName);

            dao.delete(bean.Id);


            // delete the access file
            string url_path = ConfigurationManager.AppSettings["path"].ToString();

            string path = url_path + "" + dbName + ".accdb";

            // if the file is exist,then,delete it
            if (File.Exists(path))
            {
                File.Delete(path);
            }


            return(true);
        }
Example #2
0
        /// <summary>
        /// 删除部门
        /// </summary>
        /// <param name="id">id</param>
        /// <returns></returns>
        public Boolean delete(int id)
        {
            DepartmentDao dd = new DepartmentDao();

            return(dd.delete <department>(id));
        }