NoteDA.cs
上传用户:autodoor
上传日期:2022-08-04
资源大小:9973k
文件大小:3k
- using System;
- using System.Data;
- using System.Data.SqlClient;
- namespace qminoa.DA.Schedule
- {
- public class NoteDA
- {
- private String conn=System.Configuration.ConfigurationSettings.AppSettings.Get("ConnectionString");
- private SqlDataAdapter objadapter = new SqlDataAdapter();
- private DataSet objdataset = new DataSet();
- public NoteDA()
- {
- }
-
- public DataSet noteread(int EmpID)
- {
- SqlCommand objcommand = new SqlCommand();
- objadapter.SelectCommand = new SqlCommand();
- objadapter.SelectCommand.Connection = new SqlConnection(conn);
- objcommand = objadapter.SelectCommand;
- objcommand.CommandText = "cpNoteBind";
- objcommand.CommandType = CommandType.StoredProcedure;
- SqlParameter param = new SqlParameter("@EmpID", SqlDbType.Int);
- param.Value = EmpID;
- objcommand.Parameters.Add(param);
- objadapter.Fill(objdataset,"note5");
- return objdataset;
- }
- public SqlCommand notefill(int NoteID)
- {
- SqlCommand objcommand = new SqlCommand();
- objadapter.SelectCommand = new SqlCommand();
- objadapter.SelectCommand.Connection = new SqlConnection(conn);
- objcommand = objadapter.SelectCommand;
- objcommand.CommandText = "cpNoteRead";
- objcommand.CommandType = CommandType.StoredProcedure;
- objcommand.Parameters.Add(new SqlParameter("@NoteID", SqlDbType.Int));
- objcommand.Parameters["@NoteID"].Value=NoteID;
- return objcommand;
- }
-
- public void notedelete(int NoteID)
- {
- SqlCommand objcommand = new SqlCommand();
- objcommand.Connection =new SqlConnection(conn);
- objcommand.CommandText = "cpNoteDel";
- objcommand.CommandType = CommandType.StoredProcedure;
- objcommand.Parameters.Add(new SqlParameter("@NoteID",SqlDbType.Int));
- objcommand.Parameters["@NoteID"].Value=NoteID;
- objcommand.Connection.Open();
- objcommand.ExecuteNonQuery();
- objcommand.Connection.Close();
- }
- public void noteaddup(int NoteID,int EmpID,string Content,DateTime CDate)
- {
- SqlCommand objcommand = new SqlCommand();
- objcommand.Connection =new SqlConnection(conn);
- objcommand.CommandText = "cpNoteAddUp";
- objcommand.CommandType = CommandType.StoredProcedure;
- objcommand.Parameters.Add(new SqlParameter("@NoteID",SqlDbType.Int));
- objcommand.Parameters["@NoteID"].Value=NoteID;
- objcommand.Parameters.Add(new SqlParameter("@EmpID",SqlDbType.Int));
- objcommand.Parameters["@EmpID"].Value=EmpID;
- objcommand.Parameters.Add(new SqlParameter("@Content",SqlDbType.NVarChar,100));
- objcommand.Parameters["@Content"].Value=Content;
- objcommand.Parameters.Add(new SqlParameter("@CDate",SqlDbType.DateTime));
- objcommand.Parameters["@CDate"].Value=CDate;
- objcommand.Connection.Open();
- objcommand.ExecuteNonQuery();
- objcommand.Connection.Close();
- }
- }
- }