Example #1
0
        public void TestCreateAndFetchEmployeeAndWorkFolder()
        {
            ClsTblEmployee   e  = (ClsTblEmployee)m_Context.CreateObject(typeof(ClsTblEmployee));
            ClsTblWorkFolder wf = (ClsTblWorkFolder)m_Context.CreateObject(typeof(ClsTblWorkFolder));

            e.FirstName      = "Mats";
            e.LastName       = "Helander";
            e.Salary         = 2000;
            e.EmploymentDate = DateTime.Now;
            wf.Name          = "My First Folder";
            wf.Person        = e;
            wf.Employee      = e;
            wf.WorkType      = "Boring";
            m_Context.Commit();
            m_Context2 = GetContext();
            m_Context2.ExecutingSql += new ExecutingSqlEventHandler(this.m_Context2_ExecutingSql);
            ClsTblEmployee e2 = (ClsTblEmployee )m_Context2.GetObject(e.Id, typeof(ClsTblEmployee));

            Assert.AreEqual("Mats", e2.FirstName);
            Assert.AreEqual("Helander", e2.LastName);
            Assert.AreEqual(2000, e2.Salary);
            ClsTblWorkFolder wf2 = (ClsTblWorkFolder)m_Context2.GetObject(wf.Id, typeof(ClsTblWorkFolder));

            Assert.AreEqual("Boring", wf2.WorkType);
            Assert.AreEqual("Mats", wf2.Employee.FirstName);
            m_Context2.Dispose();
        }
Example #2
0
        public void TestCreateEmployee()
        {
            ClsTblEmployee e = (ClsTblEmployee)m_Context.CreateObject(typeof(ClsTblEmployee));

            e.FirstName      = "Mats";
            e.LastName       = "Helander";
            e.Salary         = 2000;
            e.EmploymentDate = DateTime.Now;
            m_Context.Commit();
        }
Example #3
0
        public void TestCreateEmployeeAndFolder()
        {
            ClsTblEmployee e = (ClsTblEmployee)m_Context.CreateObject(typeof(ClsTblEmployee));
            ClsTblFolder   f = (ClsTblFolder)m_Context.CreateObject(typeof(ClsTblFolder));

            e.FirstName      = "Mats";
            e.LastName       = "Helander";
            e.Salary         = 2000;
            e.EmploymentDate = DateTime.Now;
            f.Name           = "My First Folder";
            f.Person         = e;
            m_Context.Commit();
        }
Example #4
0
        public void TestCreateAndFetchEmployee()
        {
            ClsTblEmployee e = (ClsTblEmployee)m_Context.CreateObject(typeof(ClsTblEmployee));

            e.FirstName      = "Mats";
            e.LastName       = "Helander";
            e.Salary         = 2000;
            e.EmploymentDate = DateTime.Now;
            m_Context.Commit();
            m_Context2 = GetContext();
            m_Context2.ExecutingSql += new ExecutingSqlEventHandler(this.m_Context2_ExecutingSql);
            ClsTblEmployee e2 = (ClsTblEmployee)m_Context2.GetObject(e.Id, typeof(ClsTblEmployee));

            Assert.AreEqual("Mats", e2.FirstName);
            Assert.AreEqual("Helander", e2.LastName);
            Assert.AreEqual(2000, e2.Salary);
            m_Context2.Dispose();
        }
 public void CreateObject()
 {
     ClsTblEmployee emp = (ClsTblEmployee)m_Context.CreateObject(typeof(ClsTblEmployee));
 }