using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;


namespace HRManagerSystem
{
    public partial class DD_SelStaddInfo : Form
    {
        public DD_SelStaddInfo()
        {
            InitializeComponent();
        }
        DataDataContext ddc = new DataDataContext();
        StaffRemoveForm spf = new StaffRemoveForm();
        DataTable DT = new DataTable();
        #region LINQ操作方法
        public void LINQOPT()
        {
            DT.Columns.Add("编号", typeof(string));
            DT.Columns.Add("员工编号", typeof(string));
            DT.Columns.Add("名称", typeof(string));
            DT.Columns.Add("旧部门", typeof(string));
            DT.Columns.Add("新部门", typeof(string));
            DT.Columns.Add("旧职务", typeof(string));
            DT.Columns.Add("新职务", typeof(string));
            DT.Columns.Add("调动时间", typeof(string));
            foreach (var v in ddc.T_DiaoDu)
            {
                DT.Rows.Add(v.DiaoDu_ID, v.Staff_ID, v.T_StaffRecords.Staff_Name, v.T_Department.Depart_Name, v.T_Department1.Depart_Name, v.T_Jobs.Job_Name, v.T_Jobs1.Job_Name, v.DiaoDu_Time);
            }

        } 
        #endregion
        private void DD_SelStaddInfo_Load(object sender, EventArgs e)
        {
            this.LINQOPT();
            DD_SelstaInfoDGV.DataSource = DT;//填充当前窗体数据
        }

        #region 查询员工信息
        private void SureBt_Click(object sender, EventArgs e)
        {
            DD_SelstaInfoDGV.DataSource = ddc.P_DiaoDuByStaffname(DD_selnameTB.Text);
        } 
        #endregion
    }
}
