コード例 #1
0
ファイル: JobForm.cs プロジェクト: huaminglee/yousoftbath
        //构造函数
        public JobForm(BathDBDataContext dc, Job job)
        {
            db = dc;
            if (job != null)
            {
                newJob = false;
                m_job = job;
            }

            InitializeComponent();
            ComboJobList.Items.Add("");
            ComboJobList.Items.AddRange(db.Job.Select(x => x.name).ToArray());
            ComboJobList.SelectedIndex = 0;

            ComboDeparts.Items.AddRange((db.Department.Select(x => x.name).ToArray()));
        }
コード例 #2
0
        private void create_one_node(Job job, List<int> jobs, TreeNode pNode)
        {
            jobs.Add(job.id);
            var jobName = job.name;
            var node1 = new TreeNode(jobName);
            node1.Name = jobName;
            node1.Text = jobName;
            node1.ImageIndex = 1;
            node1.SelectedImageIndex = 1;

            if (pNode != null)
                pNode.Nodes.Add(node1);

            var childs = db.Job.Where(x => x.leaderId == job.id);
            if (childs.Any())
            {
                create_one_node(childs.FirstOrDefault(), jobs, node1);
            }

            var job_next = db.Job.FirstOrDefault(x => !jobs.Contains(x.id) &&
                ((job.leaderId==null && x.leaderId==null) || (job.leaderId != null && x.leaderId==job.leaderId)));
            if (job_next == null)
                return;

            create_one_node(job_next, jobs, pNode);
        }
コード例 #3
0
 partial void DeleteJob(Job instance);
コード例 #4
0
 partial void UpdateJob(Job instance);
コード例 #5
0
 partial void InsertJob(Job instance);