コード例 #1
0
        public void add(SqlConnection cn, SqlTransaction tc, DepartmentModel department)
        {
            try
            {

                DbHelperSQL.insertModel<DepartmentModel>(department, "Department", cn, tc);
            }
            catch (SqlException)
            {
                throw new DalException("发生了数据库错误,请检查数据库是否正常运行");
            }
        }
コード例 #2
0
        public void update(SqlConnection cn, SqlTransaction tc, DepartmentModel department)
        {
            try
            {

                DbHelperSQL.updateModel<DepartmentModel>(department, "Department", "DepartmentNo", department.DepartmentNo, "'", cn, tc);
            }
            catch (SqlException)
            {
                throw new DalException("发生了数据库错误,请检查数据库是否正常运行");
            }
        }