コード例 #1
0
        protected override void PageLoad()
        {
            base.PageLoad();
            base.CheckUserPower("AddUser,UpdateUser,ReadUser", PowerCheckType.OR);

            ////this.singleUnlimitClass.DataSource = RegionBLL.ReadRegionUnlimitClass();
            ////this.singleUnlimitClass.ClassID = this.user.RegionID;

            string companyPostSetting = CookiesHelper.ReadCookieValue("UserCompanyPostSetting");

            departmentList = PostBLL.ReadParentPostListByPostId(companyPostSetting);
            studyPostList  = workingPostList = PostBLL.ReadPostListByPostId(companyPostSetting);
            //去除新加的培训项目
            if (!StringHelper.CompareString(ParentCompanyID, "779,296,733,770"))
            {
                departmentList  = departmentList.FindAll(delegate(PostInfo tempPost) { return(tempPost.CompanyID == CompanyBLL.SystemCompanyId); });
                workingPostList = workingPostList.FindAll(delegate(PostInfo tempPost) { return(tempPost.CompanyID == CompanyBLL.SystemCompanyId); });
            }
            if (userID > 0)
            {
                this.user  = UserBLL.ReadUser(userID);
                base.Title = "修改员工信息";

                //当前学习岗位课程通过后,销售与非销售之间可以调整,否则不能互调
                if (!PostBLL.IsPassPost(user.CompanyID, user.ID, user.StudyPostID))
                {
                    //公司培训列表信息
                    List <PostInfo> companyTrainingList = studyPostList.FindAll(delegate(PostInfo tempPost) { return(tempPost.CompanyID != CompanyBLL.SystemCompanyId); });

                    PostInfo studyPost = PostBLL.ReadPost(user.StudyPostID);
                    //销售部岗位单独处理
                    if (studyPost.ParentId == 3)
                    {
                        studyPostList = PostBLL.FilterPostListByParentID(studyPostList, 3);
                    }
                    else
                    {
                        studyPostList = studyPostList.FindAll(delegate(PostInfo tempPost) { return(tempPost.ParentId != 3); });
                    }

                    //如果公司培训项目不为空,则罗列出来
                    if (companyTrainingList.Count > 0 && studyPost.CompanyID != user.CompanyID)
                    {
                        studyPostList.AddRange(companyTrainingList);
                    }
                }
            }
            else
            {
                base.Title = "增加员工";
            }
            //powerGroupList = AdminGroupBLL.ReadAdminGroupList(base.CompanyID);
        }
コード例 #2
0
ファイル: HRReport.cs プロジェクト: xuefuruanjian/ems
        protected void HtmlOut()
        {
            //Table表头在后面插入
            ReportContentHtml.Append(Company.CompanySimpleName);
            ReportContentHtml.Append(" [ 截止到:" + EndDate.ToString("d") + " ]");
            ReportContentHtml.AppendLine("</th></tr>");
            ReportContentHtml.AppendLine("</tr>");
            ReportContentHtml.AppendLine("<tr>");
            ReportContentHtml.AppendLine("<th colspan=\"3\">部门/岗位</th>");

            //岗位数组
            ArrayList postArray = new ArrayList();
            //需要再次展开的岗位
            ArrayList postExpandArray = new ArrayList();

            foreach (PostInfo Info in PostBLL.ReadParentPostListByPostId(Company.Post))
            {
                List <PostInfo> sonPostList  = PostBLL.FilterPostListByParentID(PostList, Info.PostId);
                int             sonPostCount = sonPostList.Count;
                if (sonPostCount > 1)
                {
                    postArray.Add(Info.PostId);
                    postExpandArray.Add(Info.PostId);
                    ReportContentHtml.AppendLine("<th colspan=\"" + sonPostCount.ToString() + "\">" + Info.PostName + "</th>");
                }
                else
                {
                    ReportContentHtml.AppendLine("<th rowspan=\"2\" class=\"outside\"><div class=\"inside\">" + Info.PostName + "</div></th>");
                    if (sonPostCount == 1)
                    {
                        foreach (PostInfo Item in sonPostList)
                        {
                            postArray.Add(Item.PostId);
                        }
                    }
                    else
                    {
                        postArray.Add(Info.PostId);
                    }
                }
            }

            ReportContentHtml.AppendLine("</tr>");
            ReportContentHtml.AppendLine("<tr class=\"hoverwhite\">");
            ReportContentHtml.AppendLine("<td class=\"id\">序号</td>");
            ReportContentHtml.AppendLine("<td class=\"name\">员工名称</td>");
            ReportContentHtml.AppendLine("<td class=\"post\">在职岗位</td>");
            foreach (int item in postExpandArray)
            {
                ArrayList tempArray = new ArrayList();
                foreach (PostInfo info in PostBLL.FilterPostListByParentID(PostList, item))
                {
                    ReportContentHtml.AppendLine("<td class=\"outside\"><div class=\"inside\">" + info.PostName + "</div></td>");
                    tempArray.Add(info.PostId);
                }
                int insertPos = postArray.IndexOf(item);
                postArray.RemoveAt(insertPos);
                postArray.InsertRange(insertPos, tempArray);
            }
            ReportContentHtml.AppendLine("</tr>");

            //取得列数,插入表头
            ReportContentHtml.Insert(0, "<table class=\"evaluation_sheet\"><tr><th colspan=\"" + (3 + postArray.Count) + "\">");

            int PNum = 0;
            //定义一个数组,用来存放每个人通过的岗位数
            string PassPostTotal = "|";

            UserSearchInfo userSearch = new UserSearchInfo();

            userSearch.InCompanyID   = CompanyID.ToString();
            userSearch.InStatus      = (int)UserState.Normal + "," + (int)UserState.Free;
            userSearch.InStudyPostID = PostIdCondition;
            List <UserInfo> userList = UserBLL.SearchReportUserList(userSearch);

            foreach (UserInfo user in userList)
            {
                PNum += 1;

                PostPassInfo postPassSearch = new PostPassInfo();
                postPassSearch.UserId     = user.ID;
                postPassSearch.IsRZ       = 1;
                postPassSearch.CreateDate = ShopCommon.SearchEndDate(EndDate);
                //读取通过的岗位
                string PassPost = PostPassBLL.PassPostString(postPassSearch);
                //读取岗位学完但认证没过的名单
                postPassSearch.IsRZ = 0;
                string NoPassPost = PostPassBLL.PassPostString(postPassSearch);

                string WorkPostName = string.Empty;

                //取得工作岗位
                if (string.IsNullOrEmpty(user.PostName))
                {
                    WorkPostName = PostBLL.ReadPost(user.WorkingPostID).PostName;
                }
                else
                {
                    WorkPostName = user.PostName;
                }

                ReportContentHtml.AppendLine("<tr data-style=\"data\">");
                ReportContentHtml.AppendLine("<td>" + PNum.ToString() + "</td>");
                ReportContentHtml.AppendLine("<td>" + user.RealName + "</td>");
                ReportContentHtml.AppendLine("<td>" + WorkPostName + "</td>");
                int PassPostNum = 0;
                foreach (int Item in postArray)
                {
                    if (StringHelper.CompareSingleString(PassPost, Item.ToString()))
                    {
                        PassPostNum += 1;
                        ReportContentHtml.AppendLine("<td class=\"style1\">●</td>");
                    }
                    else if (StringHelper.CompareSingleString(NoPassPost, Item.ToString()))
                    {
                        ReportContentHtml.AppendLine("<td class=\"style2\">○</td>");
                    }
                    else if (Item.ToString() == user.StudyPostID.ToString())
                    {
                        ReportContentHtml.AppendLine("<td class=\"style3\">○</td>");
                    }
                    else
                    {
                        ReportContentHtml.AppendLine("<td>&nbsp;</td>");
                    }
                }
                if (PassPostNum > 0)
                {
                    PassPostTotal += PassPostNum.ToString() + "|";
                }
                ReportContentHtml.AppendLine("</tr>");
            }
            ReportContentHtml.AppendLine("</table>");

            //统计通过几个岗位的人数
            if (PassPostTotal.Length > 1)
            {
                ReportContentHtml.AppendLine("<table class=\"evaluation_sheet count\">");
                for (int i = 1; i < postArray.Count + 1; i++)
                {
                    if (PassPostTotal.Contains("|" + i + "|"))
                    {
                        ReportContentHtml.AppendLine("<tr>");
                        ReportContentHtml.AppendLine("<td>通过" + i.ToString() + "个岗位的人数为:");
                        int PerNum = 0;
                        foreach (string Item in PassPostTotal.Split('|'))
                        {
                            if (Item == i.ToString())
                            {
                                PerNum += 1;
                            }
                        }
                        ReportContentHtml.AppendLine(PerNum.ToString() + "</td>");
                        ReportContentHtml.AppendLine("</tr>");
                    }
                }
                ReportContentHtml.AppendLine("</table>");
            }
        }
コード例 #3
0
 protected List <PostInfo> FilterPostListByParentID(int parentID)
 {
     return(PostBLL.FilterPostListByParentID(postList, parentID));
 }