示例#1
0
文件: Case.cs 项目: jblackett/RJLou
 internal void DeleteDocument(Document doc)
 {
     doc.Delete();
 }
示例#2
0
        public static Document Get(int id)
        {
            string dsn = ConfigurationManager.ConnectionStrings["RJLouEntities"].ToString();

            string sql = "SELECT * FROM DOCUMENT WHERE Document_ID = @ID";

            using (SqlConnection conn = new SqlConnection(dsn))
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand(sql, conn);
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.AddWithValue("ID", id);

                SqlDataReader read = cmd.ExecuteReader();

                if (read.Read())
                {
                    Document result = new Document()
                    {
                        DocumentID = Convert.ToInt32(read["Document_ID"]),
                        CaseID = Convert.ToInt32(read["Case_ID"]),
                        PersonWhoModified = InternalUser.Get(Convert.ToInt32(read["Person_ID"])),
                        FileLocation = read["File_Location"].ToString()
                    };

                    return result;
                }
            }

            return null;
        }
示例#3
0
文件: Case.cs 项目: jblackett/RJLou
 internal void AddDocument(Document doc)
 {
     Document.Add(doc.CaseID, doc.PersonWhoModified.PersonID, doc.FileLocation);
 }