Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            ContextDepartmentService deptService = new ContextDepartmentService();
            List <Department>        depList     = deptService.GetList("");

            MessageBox.Show(string.Format("总个数:{0}", depList.Count));
        }
Exemplo n.º 2
0
        private void btnAddDeptList_Click(object sender, EventArgs e)
        {
            ContextDepartmentService deptService = new ContextDepartmentService();

            for (int i = 0; i < 100; i++)
            {
                Department dept = new Department();
                dept.DepartmentID  = deptService.GetMaxId() + 1;
                dept.Administrator = 99 + i;
                dept.Budget        = 100 + i;
                dept.Name          = i.ToString();
                dept.StartDate     = DateTime.Now;
                deptService.Save(dept);
            }
        }
Exemplo n.º 3
0
        private void btnMaxId_Click(object sender, EventArgs e)
        {
            ContextDepartmentService deptService = new ContextDepartmentService();

            MessageBox.Show(deptService.GetMaxId().ToString());
        }