private void dgv_User_Leave(object sender, EventArgs e)
        {
            if (_CourseGuid != null)
            {
                if (_ListPlanUser != null)
                {
                    Guid guidCourse = new Guid(_CourseGuid);
                    _ListPlanUser.RemoveAll(k => k.PlanCourseID == guidCourse);

                    foreach (DataGridViewRow dgvr in dgv_User.Rows)
                    {
                        if (Convert.ToBoolean(dgvr.Cells["选"].Value))
                        {
                            View_HR_Train_PlanUser planUser = new View_HR_Train_PlanUser();

                            planUser.PlanCourseID = guidCourse;
                            planUser.岗位           = dgvr.Cells["岗位"].Value.ToString();
                            planUser.员工编号         = dgvr.Cells["员工编号"].Value.ToString();
                            planUser.员工姓名         = dgvr.Cells["员工姓名"].Value.ToString();

                            _ListPlanUser.Add(planUser);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public List <View_HR_Train_PlanUser> GetPlanUserInfoAll(Guid planCourseID, int courseID)
        {
            ITrainBasicInfo service = ServerModuleFactory.GetServerModule <ITrainBasicInfo>();

            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;
            List <string> lstUser          = service.GetCourse_User(courseID);

            List <View_HR_Train_PlanUser> lstResult = new List <View_HR_Train_PlanUser>();

            foreach (string workID in lstUser)
            {
                var varData = from a in ctx.View_HR_PersonnelArchive
                              where a.员工编号 == workID
                              select a;

                if (varData.Count() == 1)
                {
                    View_HR_Train_PlanUser temp = new View_HR_Train_PlanUser();

                    temp.PlanCourseID = planCourseID;

                    temp.岗位   = varData.Single().岗位;
                    temp.员工编号 = workID;
                    temp.员工姓名 = varData.Single().员工姓名;

                    lstResult.Add(temp);
                }
            }

            return(lstResult);
        }