• 大小: 1.88MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-26
  • 语言: C#
  • 标签: asp.net  公告  系统  

资源简介

公告管理系统 本系统是为办公网站发布公告而设计,各个部门发布自己所在部门的某种类型的公告,给各类不同的用户查看。管理员可以实现对本部门的公告实现增删改等管理. (里面附带有程序编写文档,一份很好的asp.net学习材料)

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using NewsManage.Model;
using NewsManage.DBUtility;

namespace NewsManage.DAL
{
    public class Department
    {
        private const string SQL_INSERT_DEPARTMENT = “INSERT INTO DEPARTMENT(DEPARTMENTNAMEDEPARTMENTBRIEF) VALUES(@DEPARTMENTNAME@DEPARTMENTBRIEF)“;
        private const string SQL_UPDATE_DEPARTMENT = “UPDATE DEPARTMENT SET DEPARTMENTNAME=@DEPARTMENTNAMEDEPARTMENTBRIEF=@DEPARTMENTBRIEF WHERE DEPARTMENTID=@DEPARTMENTID“;
        private const string SQL_SELECT_DEPARTMENT_1 = “SELECT * FROM DEPARTMENT WHERE DEPARTMENTID=@DEPARTMENTID“;
        private const string SQL_SELECT_DEPARTMENT_2 = “SELECT * FROM DEPARTMENT ORDER BY DEPARTMENTID“;
        private const string SQL_DELETE_DEPARTMENT = “DELETE FROM DEPARTMENT WHERE DEPARTMENTID=@DEPARTMENTID“;
        private const string PARM_DEPARTMENT_ID = “@DEPARTMENTID“;
        private const string PARM_DEPARTMENT_NAME = “@DEPARTMENTNAME“;
        private const string PARM_DEPARTMENT_BRIEF = “@DEPARTMENTBRIEF“;


        #region IDepartment 成员

        public void insert(DepartmentInfo department)
        {
            StringBuilder strSQL = new StringBuilder();

            // Get each commands parameter arrays
            SqlParameter[] departmentParms = new SqlParameter[]{
new SqlParameter(PARM_DEPARTMENT_NAME SqlDbType.VarChar 20)
                    new SqlParameter(PARM_DEPARTMENT_BRIEF SqlDbType.VarChar 20)
            };

            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = SQL_INSERT_DEPARTMENT;

            // Set up the parameters
            departmentParms[0].Value = department.DepartmentName;
            departmentParms[1].Value = department.DepartmentBrief;

            foreach (SqlParameter parm in departmentParms)
                cmd.Parameters.Add(parm);

            // Create the connection to the database
            using (SqlConnection conn = new SqlConnection(SqlHelper.ConnectionStringLocalTransaction))
            {
                conn.Open();
                cmd.Connection = conn;
                cmd.ExecuteNonQuery();
            }
        }

        public void delete(int departmentID)
        {
            StringBuilder strSQL = new StringBuilder();

            // Get each commands parameter arrays
            SqlParameter[] departmentParms = new SqlParameter[]{
new SqlParameter(PARM_DEPARTMENT_ID SqlDbType.Int)
            };

            SqlCommand cmd = new SqlCommand();
            cmd.CommandText = SQL_DELETE_DEPARTMENT;

            // Set up the parameters
            departmentParms[0].Value = departmentID;
            foreach (SqlParameter parm in departmentParms)
                cmd.Parameters.Add(parm);

            // Create the connection to the database
            using (SqlConnection conn = new SqlConnection(SqlHelper.C

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      32768  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\bin\Debug\NewsManage.DAL.dll

     文件      36352  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\bin\Debug\NewsManage.DAL.pdb

     文件      20480  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\bin\Debug\NewsManage.DBUtility.dll

     文件      26112  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\bin\Debug\NewsManage.DBUtility.pdb

     文件      20480  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\bin\Debug\NewsManage.Model.dll

     文件      36352  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\bin\Debug\NewsManage.Model.pdb

     文件       2477  2008-11-05 20:56  newsManage\newsManage\DAL\DAL\DAL.csproj

     文件       6152  2008-11-05 20:35  newsManage\newsManage\DAL\DAL\Department.cs

     文件      12053  2008-11-05 20:36  newsManage\newsManage\DAL\DAL\News.cs

     文件       3417  2008-11-05 20:35  newsManage\newsManage\DAL\DAL\NewsType.cs

     文件        298  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\obj\DAL.csproj.FileList.txt

     文件       1009  2008-11-19 20:38  newsManage\newsManage\DAL\DAL\obj\DAL.csproj.FileListAbsolute.txt

     文件      32768  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\obj\Debug\NewsManage.DAL.dll

     文件      36352  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\obj\Debug\NewsManage.DAL.pdb

     文件      20480  2008-11-19 20:17  newsManage\newsManage\DAL\DAL\obj\Debug\Refactor\NewsManage.DAL.dll

     文件      14149  2008-12-15 15:33  newsManage\newsManage\DAL\DAL\obj\Debug\ResolveAssemblyReference.cache

     文件       1325  2008-11-05 20:21  newsManage\newsManage\DAL\DAL\Properties\AssemblyInfo.cs

     文件       3580  2008-11-05 20:35  newsManage\newsManage\DAL\DAL\ViewerType.cs

     文件       5336  2008-11-05 20:56  newsManage\newsManage\DAL\DAL.sln

    ..A..H.     21504  2008-11-05 21:16  newsManage\newsManage\DAL\DAL.suo

     文件        718  2005-11-09 00:00  newsManage\newsManage\DBUtility\AssemblyInfo.cs

     文件      20480  2008-12-15 15:33  newsManage\newsManage\DBUtility\BIN\Debug\NewsManage.DBUtility.dll

     文件      26112  2008-12-15 15:33  newsManage\newsManage\DBUtility\BIN\Debug\NewsManage.DBUtility.pdb

     文件       2195  2008-09-14 02:20  newsManage\newsManage\DBUtility\DBUtility.csproj

     文件        186  2008-12-15 15:33  newsManage\newsManage\DBUtility\OBJ\DBUtility.csproj.FileList.txt

     文件       4702  2008-11-19 20:38  newsManage\newsManage\DBUtility\OBJ\DBUtility.csproj.FileListAbsolute.txt

     文件      20480  2008-12-15 15:33  newsManage\newsManage\DBUtility\OBJ\Debug\NewsManage.DBUtility.dll

     文件      26112  2008-12-15 15:33  newsManage\newsManage\DBUtility\OBJ\Debug\NewsManage.DBUtility.pdb

     文件      16384  2008-10-12 20:55  newsManage\newsManage\DBUtility\OBJ\Debug\Refactor\NewsManage.DBUtility.dll

     文件      16384  2008-09-13 22:22  newsManage\newsManage\DBUtility\OBJ\Debug\Refactor\PetShop.DBUtility.dll

............此处省略124个文件信息

评论

共有 条评论