Exemplo n.º 1
0
        public void InsertTest()
        {
            Assistants a = new Assistants {
                ID = "test", name = "test", password = "******"
            };
            AssistantHandler ah = new AssistantHandler(a);

            ah.Insert();
            Assert.IsTrue(AssistantHandler.DB.Assistants.First(assistant => assistant.ID == "test").Equals(a));

            AssistantHandler.DB.Assistants.DeleteOnSubmit(a);
            AssistantHandler.DB.SubmitChanges();
        }
Exemplo n.º 2
0
    protected bool register(string id, string pwd, string name)
    {
        Assistants a = new Assistants {
            ID = id, name = name, password = pwd
        };
        AssistantHandler ah = new AssistantHandler(a);

        try
        {
            ah.Insert();
        }
        catch (Exception)
        {
            return(false);
        }
        return(true);
    }