Esempio n. 1
0
    /// <summary>
    /// 删除请求的新闻
    /// </summary>
    public void deleteRequestAssistant()
    {
        string           id               = Request.QueryString["id"];
        Assistants       assistant        = AssistantHandler.getAssistantById(id);
        AssistantHandler assistantHandler = new AssistantHandler(assistant);

        assistantHandler.Delete();
    }
Esempio n. 2
0
        public void getAssistantByIdTest()
        {
            Assistants a = new Assistants {
                ID = "test", name = "test", password = "******"
            };

            AssistantHandler.DB.Assistants.InsertOnSubmit(a);
            AssistantHandler.DB.SubmitChanges();

            Assistants expected = AssistantHandler.DB.Assistants.First(assistant => assistant.ID == "test");
            Assistants actual   = AssistantHandler.getAssistantById("test");

            AssistantHandler.DB.Assistants.DeleteOnSubmit(a);
            AssistantHandler.DB.SubmitChanges();
            Assert.AreSame(expected, actual);
        }