Exemplo n.º 1
0
        protected override void PageLoad()
        {
            base.PageLoad();
            base.Title = "×ÛºÏÄÜÁ¦ÆÀ¹À";

            base.CheckUserPower("AddEvaluate", PowerCheckType.Single);

            if (companyID <= 0)
            {
                companyID = base.UserCompanyID;
            }

            if (evaluateNameId > 0 && userId > 0)
            {
                UserInfo user = UserBLL.ReadUser(userId);
                companyID = user.CompanyID;
                userName  = user.RealName;
                KPIEvaluateSearchInfo kpievaluateSearch = new KPIEvaluateSearchInfo();
                kpievaluateSearch.EvaluateNameId = evaluateNameId;
                kpievaluateSearch.UserId         = userId.ToString();
                kpievaluateSearch.PostId         = "0";
                kpievaluateSearch.EvaluateUserId = evaluateUserId;
                scoreStr = KPIEvaluateBLL.ReadStaffEvaluateData(kpievaluateSearch);
            }
        }
Exemplo n.º 2
0
        protected override void PageLoad()
        {
            base.PageLoad();
            base.Title = "个人评估列表";

            if (userId > 0)
            {
                KPIEvaluateSearchInfo kpiEvaluateSearch = new KPIEvaluateSearchInfo();
                kpiEvaluateSearch.UserId = userId.ToString();

                //限制在未删除的岗位范围内
                string workingPostIdStr = string.Empty;
                WorkingPostSearchInfo workingPostSearch = new WorkingPostSearchInfo();
                workingPostSearch.CompanyId = base.UserCompanyID.ToString();
                workingPostSearch.IsPost    = 1;
                foreach (WorkingPostInfo info in WorkingPostBLL.SearchWorkingPostList(workingPostSearch))
                {
                    if (string.IsNullOrEmpty(workingPostIdStr))
                    {
                        workingPostIdStr = info.ID.ToString();
                    }
                    else
                    {
                        workingPostIdStr += "," + info.ID.ToString();
                    }
                }
                kpiEvaluateSearch.PostId = workingPostIdStr;

                reportList = KPIEvaluateBLL.KPIEvaluateReportList(kpiEvaluateSearch);
                base.BindPageControl(ref base.CommonPager);
            }
        }
Exemplo n.º 3
0
 public void PrepareCondition(MssqlCondition mssqlCondition, KPIEvaluateSearchInfo kpiEvaluateSearch)
 {
     mssqlCondition.Add("[KPIId]", kpiEvaluateSearch.KPIdStr, ConditionType.In);
     mssqlCondition.Add("[UserId]", kpiEvaluateSearch.UserId, ConditionType.In);
     mssqlCondition.Add("[EvaluateDate]", kpiEvaluateSearch.EvaluateDate, ConditionType.Equal);
     mssqlCondition.Add("[EvaluateNameId]", kpiEvaluateSearch.EvaluateNameId, ConditionType.Equal);
     mssqlCondition.Add("[EvaluateUserId]", kpiEvaluateSearch.EvaluateUserId, ConditionType.Equal);
     mssqlCondition.Add("[PostId]", kpiEvaluateSearch.PostId, ConditionType.In);
     mssqlCondition.Add(kpiEvaluateSearch.Condition);
 }
Exemplo n.º 4
0
        //public List<KPIEvaluateReportInfo> KPIEvaluateReportList(int userId, int postId)
        //{
        //    List<KPIEvaluateReportInfo> reportList = new List<KPIEvaluateReportInfo>();
        //    SqlParameter[] pt = new SqlParameter[] {
        //        new SqlParameter("@userId", SqlDbType.Int),
        //        new SqlParameter("@postId", SqlDbType.Int)
        //    };
        //    pt[0].Value = userId;
        //    pt[1].Value = postId;

        //    using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "KPIEvaluateReport", pt))
        //    {
        //        while (dr.Read())
        //        {
        //            KPIEvaluateReportInfo info = new KPIEvaluateReportInfo();
        //            {
        //                if (postId > 0)
        //                {
        //                    info.PostId = postId;
        //                    info.UserId = int.Parse(dr["UserId"].ToString());
        //                }
        //                else
        //                {
        //                    info.PostId = int.Parse(dr["PostId"].ToString());
        //                    info.UserId = userId;
        //                }
        //                info.TempNum = int.Parse(dr["TempNum"].ToString());
        //                info.FixedNum = int.Parse(dr["FixedNum"].ToString());
        //                info.EvaluationName = dr["EvaluateName"].ToString();
        //            }
        //            reportList.Add(info);
        //        }
        //    }
        //    return reportList;
        //}

        public List <KPIEvaluateInfo> SearchKPIEvaluateList(KPIEvaluateSearchInfo kpiEvaluateSearch)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, kpiEvaluateSearch);
            List <KPIEvaluateInfo> kpiEvaluateList = new List <KPIEvaluateInfo>();

            SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) };
            pt[0].Value = mssqlCondition.ToString();
            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchKPIEvaluateList", pt))
            {
                this.PrepareModel(dr, kpiEvaluateList);
            }
            return(kpiEvaluateList);
        }
Exemplo n.º 5
0
        public List <KPIEvaluateReportInfo> KPIEvaluateReportList(KPIEvaluateSearchInfo kpiEvaluateSearch)
        {
            List <KPIEvaluateReportInfo> reportList = new List <KPIEvaluateReportInfo>();
            MssqlCondition mssqlCondition           = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, kpiEvaluateSearch);
            SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) };
            pt[0].Value = mssqlCondition.ToString();
            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "NewKPIEvaluateReport", pt))
            {
                while (dr.Read())
                {
                    KPIEvaluateReportInfo info = new KPIEvaluateReportInfo();
                    {
                        info.EvaluateNameId = int.Parse(dr["EvaluateNameId"].ToString());
                        //if (dr["UserId"].ToString() == null)
                        //    info.EvaluationName = string.Empty;
                        //else
                        info.EvaluateName = dr["EvaluateName"].ToString();
                        info.UserId       = int.Parse(dr["UserId"].ToString());
                        info.UserName     = dr["UserName"].ToString();
                        info.PostId       = int.Parse(dr["PostId"].ToString());
                        info.PostName     = dr["PostName"].ToString();
                        info.CompleteNum  = int.Parse(dr["CompleteNum"].ToString());
                        if (dr["WorkingPostKPINum"] == null)
                        {
                            info.WorkingPostKPINum = 0;
                            info.Rate = 0;
                        }
                        else
                        {
                            info.WorkingPostKPINum = int.Parse(dr["WorkingPostKPINum"].ToString());
                            info.Rate = info.CompleteNum * 100 / info.WorkingPostKPINum;
                        }
                        info.TempNum    = int.Parse(dr["TempKPINum"].ToString());
                        info.FixedNum   = int.Parse(dr["FixKPINum"].ToString());
                        info.TotalScore = int.Parse(dr["TotalScore"].ToString());
                    }
                    reportList.Add(info);
                }
            }
            return(reportList);
        }
Exemplo n.º 6
0
        public List <KPIEvaluateInfo> SearchKPIEvaluateList(KPIEvaluateSearchInfo kpiEvaluateSearch, int currentPage, int pageSize, ref int count)
        {
            List <KPIEvaluateInfo> kpiEvaluateList = new List <KPIEvaluateInfo>();
            ShopMssqlPagerClass    class2          = new ShopMssqlPagerClass();

            class2.TableName   = ShopMssqlHelper.TablePrefix + "KPIEvaluate";
            class2.Fields      = "*";
            class2.CurrentPage = currentPage;
            class2.PageSize    = pageSize;
            class2.OrderField  = "[Id]";
            class2.OrderType   = OrderType.Asc;
            this.PrepareCondition(class2.MssqlCondition, kpiEvaluateSearch);
            class2.Count = count;
            count        = class2.Count;
            using (SqlDataReader dr = class2.ExecuteReader())
            {
                this.PrepareModel(dr, kpiEvaluateList);
            }
            return(kpiEvaluateList);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 读取个人综合评估的数据
        /// </summary>
        /// <param name="kpievaluateSearch"></param>
        /// <returns></returns>
        public static string ReadStaffEvaluateData(KPIEvaluateSearchInfo kpievaluateSearch)
        {
            string scoreStr = string.Empty;
            List <KPIEvaluateInfo> kpiEvaluateList = SearchKPIEvaluateList(kpievaluateSearch);

            if (kpiEvaluateList.Count > 0)
            {
                foreach (KPIEvaluateInfo info in kpiEvaluateList)
                {
                    if (string.IsNullOrEmpty(scoreStr))
                    {
                        scoreStr = info.KPIId + ":" + info.Scorse;
                    }
                    else
                    {
                        scoreStr += "," + info.KPIId + ":" + info.Scorse;
                    }
                }
            }
            return(scoreStr);
        }
Exemplo n.º 8
0
        public List <KPIEvaluateInfo> SearchFixedKPIEvaluateList(KPIEvaluateSearchInfo kpiEvaluateSearch)
        {
            MssqlCondition mssqlCondition = new MssqlCondition();

            this.PrepareCondition(mssqlCondition, kpiEvaluateSearch);
            List <KPIEvaluateInfo> kpiEvaluateList = new List <KPIEvaluateInfo>();

            SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@condition", SqlDbType.NVarChar) };
            pt[0].Value = mssqlCondition.ToString();
            using (SqlDataReader dr = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "SearchFixedKPIEvaluateList", pt))
            {
                while (dr.Read())
                {
                    KPIEvaluateInfo info = new KPIEvaluateInfo();
                    {
                        info.KPIId = int.Parse(dr["KPIId"].ToString());
                        info.Rate  = int.Parse(dr["Rate"].ToString());
                    }
                    kpiEvaluateList.Add(info);
                }
            }
            return(kpiEvaluateList);
        }
Exemplo n.º 9
0
 public static List <KPIEvaluateInfo> SearchKPIEvaluateList(KPIEvaluateSearchInfo kpiEvaluateSearch, int currentPage, int pageSize, ref int count)
 {
     return(dal.SearchKPIEvaluateList(kpiEvaluateSearch, currentPage, pageSize, ref count));
 }
Exemplo n.º 10
0
 public static List <KPIEvaluateInfo> SearchFixedKPIEvaluateList(KPIEvaluateSearchInfo kpiEvaluateSearch)
 {
     return(dal.SearchFixedKPIEvaluateList(kpiEvaluateSearch));
 }
Exemplo n.º 11
0
 public static List <KPIEvaluateReportInfo> KPIEvaluateReportList(KPIEvaluateSearchInfo kpiEvaluateSearch)
 {
     return(dal.KPIEvaluateReportList(kpiEvaluateSearch));
 }
Exemplo n.º 12
0
        protected override void PageLoad()
        {
            base.PageLoad();
            base.Title = "综合能力评估";
            base.CheckUserPower("ReadTPRReport", PowerCheckType.Single);

            action = Request["Action"];
            if (action == "Detail")
            {
                evaluateNameId = RequestHelper.GetQueryString <int>("EvaluateNameId");
                evaluateType   = RequestHelper.GetQueryString <int>("EvaluateType");
            }
            companyIDString = base.UserCompanyID.ToString();
            if (companyID == 0)
            {
                companyIDString = base.SonCompanyID;
            }
            else if (companyID > 0)
            {
                companyIDString = companyID.ToString();
            }
            if (!base.ExistsSonCompany)
            {
                companyID = base.UserCompanyID;
            }

            if (!string.IsNullOrEmpty(action))
            {
                KPISearchInfo kpiSearch = new KPISearchInfo();
                kpiSearch.ParentId  = evaluateType.ToString();
                kpiSearch.CompanyID = CompanyBLL.SystemCompanyId.ToString() + "," + companyID.ToString();
                List <KPIInfo> kpiList = KPIBLL.SearchKPIList(kpiSearch);
                string         kpiStr  = string.Empty;
                //定义KPIId数组
                ArrayList IdArray = new ArrayList();
                if (kpiList.Count > 0)
                {
                    string[,] kpiArray = new string[kpiList.Count, 3];

                    foreach (KPIInfo info in kpiList)
                    {
                        IdArray.Add(info.ID);
                        if (string.IsNullOrEmpty(kpiStr))
                        {
                            kpiStr = info.ID.ToString();
                        }
                        else
                        {
                            kpiStr += "," + info.ID;
                        }
                        int i = IdArray.IndexOf(info.ID);
                        kpiArray[i, 0] = info.ID.ToString();
                        kpiArray[i, 1] = info.Name;
                        kpiArray[i, 2] = info.EvaluateInfo;
                    }

                    KPIEvaluateSearchInfo kpiEvaluate = new KPIEvaluateSearchInfo();
                    if (action == "Search" && string.IsNullOrEmpty(userIdStr))
                    {
                        //UserSearchInfo userSearch = new UserSearchInfo();
                        //userSearch.InCompanyID = base.UserCompanyID.ToString();
                        //userIdStr = UserBLL.ReadUserIdStr(UserBLL.SearchUserList(userSearch));

                        if (postID > 0 || !string.IsNullOrEmpty(companyIDString))
                        {
                            kpiEvaluate.Condition = "[UserID] in (select id from [_User] where [Status]!=" + (int)UserState.Del;
                            if (postID > 0)
                            {
                                kpiEvaluate.Condition += " And [WorkingPostID] in (" + postID.ToString() + ")";
                            }
                            if (!string.IsNullOrEmpty(companyIDString))
                            {
                                kpiEvaluate.Condition += " And [CompanyId] in (" + companyIDString + ")";
                            }
                            kpiEvaluate.Condition += ")";
                        }
                    }
                    else
                    {
                        user               = UserBLL.ReadUser(int.Parse(userIdStr));
                        evaluateName       = EvaluateNameBLL.ReadEvaluateName(evaluateNameId);
                        kpiEvaluate.UserId = userIdStr;
                    }
                    kpiEvaluate.EvaluateNameId = evaluateNameId;
                    kpiEvaluate.KPIdStr        = kpiStr;
                    List <KPIEvaluateInfo> kpiEvaluateList = KPIEvaluateBLL.SearchKPIEvaluateList(kpiEvaluate);

                    ArrayList userIdArray = new ArrayList();//new ArrayList(userIdStr.Split(','));
                    if (kpiEvaluateList.Count > 0)
                    {
                        foreach (KPIEvaluateInfo info in kpiEvaluateList)
                        {
                            if (!userIdArray.Contains(info.UserId))
                            {
                                userIdArray.Add(info.UserId);
                            }
                        }
                    }
                    string[, ,] dataArray = new string[kpiList.Count + 1, userIdArray.Count, 4];
                    //评估人数组
                    ArrayList evaluateUserIdArray = new ArrayList();
                    if (kpiEvaluateList.Count > 0)
                    {
                        foreach (KPIEvaluateInfo info in kpiEvaluateList)
                        {
                            if (!evaluateUserIdArray.Contains(info.EvaluateUserId))
                            {
                                evaluateUserIdArray.Add(info.EvaluateUserId);
                            }
                            dataArray[IdArray.IndexOf(info.KPIId), userIdArray.IndexOf(info.UserId), evaluateUserIdArray.IndexOf(info.EvaluateUserId)] = info.Scorse.ToString();
                        }
                    }
                    if (action != "Detail")//companyID >= 0
                    {
                        tableContent.Append("<tr><th class=\"project\">项目</th><th class=\"content\">内容</th>");
                        foreach (int item in userIdArray)
                        {
                            tableContent.Append("<th class=\"roll\"><a href=\"?Action=Detail&UserId=" + item + "&EvaluateNameId=" + evaluateNameId + "&EvaluateType=" + evaluateType + "\">" + UserBLL.ReadUser(item).RealName + "</a></th>");
                        }
                        for (int i = 0; i < dataArray.GetLength(0) - 1; i++)
                        {
                            tableContent.Append("<tr><td>" + kpiArray[i, 1] + "</td><td>" + kpiArray[i, 2] + "</td>");
                            for (int j = 0; j < userIdArray.Count; j++)
                            {
                                double totalScore = 0;
                                int    num        = 0;
                                for (int k = 0; k < 4; k++)
                                {
                                    if (!string.IsNullOrEmpty(dataArray[i, j, k]) || dataArray[i, j, k] != null)
                                    {
                                        totalScore += double.Parse(dataArray[i, j, k]);
                                        num++;
                                    }
                                }
                                if (totalScore == 0)
                                {
                                    tableContent.Append("<td>&nbsp;</td>");
                                }
                                else
                                {
                                    tableContent.Append("<td>" + Math.Round((totalScore / num), 1) + "</td>");
                                    if (string.IsNullOrEmpty(dataArray[dataArray.GetLength(0) - 1, j, 0]) || dataArray[dataArray.GetLength(0) - 1, j, 0] == null)
                                    {
                                        dataArray[dataArray.GetLength(0) - 1, j, 0] = Math.Round((totalScore / num), 1).ToString();
                                    }
                                    else
                                    {
                                        dataArray[dataArray.GetLength(0) - 1, j, 0] = (double.Parse(dataArray[dataArray.GetLength(0) - 1, j, 0]) + Math.Round((totalScore / num), 1)).ToString();
                                    }
                                }
                            }
                            tableContent.Append("</tr>");
                        }
                        tableContent.Append("<tr class=\"count\"><td colspan=\"2\">合计</td>");
                        for (int j = 0; j < userIdArray.Count; j++)
                        {
                            //员工综合能力评估合计要除以2
                            if (evaluateType == 530)
                            {
                                tableContent.Append("<td>" + Math.Round(double.Parse(dataArray[dataArray.GetLength(0) - 1, j, 0]) / 2, 1) + "</td>");
                            }
                            else
                            {
                                tableContent.Append("<td>" + dataArray[dataArray.GetLength(0) - 1, j, 0] + "</td>");
                            }
                        }
                        tableContent.Append("</tr>");
                    }
                    else
                    {
                        tableContent.Append("<tr><th class=\"project\">项目</th><th class=\"content\">内容</th>");
                        foreach (int item in evaluateUserIdArray)
                        {
                            tableContent.Append("<th class=\"roll\">评估" + (evaluateUserIdArray.IndexOf(item) + 1) + "</th>");
                        }
                        tableContent.Append("<th class=\"average\">平均分</th></tr>");
                        for (int i = 0; i < dataArray.GetLength(0) - 1; i++)
                        {
                            tableContent.Append("<tr><td>" + kpiArray[i, 1] + "</td><td>" + kpiArray[i, 2] + "</td>");
                            double totalScore = 0;
                            int    num        = 0;
                            for (int j = evaluateUserIdArray.Count - 1; j >= 0; j--)//for (int j = 0; j < evaluateUserIdArray.Count; j++)
                            {
                                if (dataArray[i, 0, j] != null)
                                {
                                    tableContent.Append("<td>" + dataArray[i, 0, j] + "</td>");
                                    totalScore += double.Parse(dataArray[i, 0, j]);
                                    num++;

                                    if (string.IsNullOrEmpty(dataArray[dataArray.GetLength(0) - 1, 0, j]) || dataArray[dataArray.GetLength(0) - 1, 0, j] == null)
                                    {
                                        dataArray[dataArray.GetLength(0) - 1, 0, j] = dataArray[i, 0, j];
                                    }
                                    else
                                    {
                                        dataArray[dataArray.GetLength(0) - 1, 0, j] = (double.Parse(dataArray[dataArray.GetLength(0) - 1, 0, j]) + double.Parse(dataArray[i, 0, j])).ToString();
                                    }
                                }
                                else
                                {
                                    tableContent.Append("<td>&nbsp;</td>");
                                }
                            }
                            if (num == 0)
                            {
                                tableContent.Append("<td>&nbsp;</td>");
                            }
                            else
                            {
                                tableContent.Append("<td>" + Math.Round((totalScore / num), 1) + "</td></tr>");
                            }
                        }
                        //员工综合能力评估合计要除以2
                        if (evaluateType == 530)
                        {
                            tableContent.Append("<tr class=\"count\"><td colspan=\"2\">合计(总分200,除2后取得分数)</td>");
                            for (int j = evaluateUserIdArray.Count - 1; j >= 0; j--)
                            {
                                tableContent.Append("<td>" + Math.Round(double.Parse(dataArray[dataArray.GetLength(0) - 1, 0, j]) / 2, 1) + "</td>");
                            }
                        }
                        else
                        {
                            tableContent.Append("<tr class=\"count\"><td colspan=\"2\">合计</td>");
                            for (int j = evaluateUserIdArray.Count - 1; j >= 0; j--)
                            {
                                tableContent.Append("<td>" + Math.Round(double.Parse(dataArray[dataArray.GetLength(0) - 1, 0, j]), 1) + "</td>");
                            }
                        }
                        tableContent.Append("<td>&nbsp;</td></tr>");
                    }
                }
            }
        }
Exemplo n.º 13
0
        protected override void PageLoad()
        {
            base.PageLoad();
            base.Title = "评估结果";

            string tempKPI  = string.Empty; //临时指标ID
            string fixedKPI = string.Empty; //永久指标ID

            if (workPostId > 0)
            {
                KPISearchInfo kpiSearch = new KPISearchInfo();
                kpiSearch.IdStr = WorkingPostBLL.ReadWorkingPostView(workPostId).KPIContent;
                List <KPIInfo> kpiList = KPIBLL.SearchKPIList(kpiSearch);

                List <KPIInfo> tempList1 = new List <KPIInfo>();
                List <KPIInfo> tempList2 = new List <KPIInfo>();
                List <KPIInfo> tempList3 = new List <KPIInfo>();
                foreach (KPIInfo info in kpiList)
                {
                    if (info.Type == KPIType.Fixed)
                    {
                        if (string.IsNullOrEmpty(fixedKPI))
                        {
                            fixedKPI = info.ID.ToString();
                        }
                        else
                        {
                            fixedKPI = fixedKPI + "," + info.ID.ToString();
                        }
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(tempKPI))
                        {
                            tempKPI = info.ID.ToString();
                        }
                        else
                        {
                            tempKPI = tempKPI + "," + info.ID.ToString();
                        }
                    }

                    switch (info.ParentId)
                    {
                    case 1:
                        tempList1.Add(info);
                        break;

                    case 2:
                        tempList2.Add(info);
                        break;

                    case 3:
                        tempList3.Add(info);
                        break;
                    }
                }

                int i = 1;
                foreach (KPIInfo info in tempList1)
                {
                    trHtml.AppendLine("<tr>");
                    if (i == 1)
                    {
                        trHtml.AppendLine("	<td rowspan=\"" + tempList1.Count + "\" class=\"indicator_name\">" + KPIBLL.ReadKPI(info.ParentId).Name + "</td>");
                    }
                    trHtml.AppendLine("	<td>" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                    trHtml.AppendLine("	<td class=\"evaluation_content\" data-id=\"" + info.ID + "\">" + i.ToString() + "." + info.Name + "</td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("</tr>");
                    i++;
                }

                i = 1;
                foreach (KPIInfo info in tempList2)
                {
                    trHtml.AppendLine("<tr>");
                    if (i == 1)
                    {
                        trHtml.AppendLine("	<td rowspan=\"" + tempList2.Count + "\" class=\"indicator_name\">" + KPIBLL.ReadKPI(info.ParentId).Name + "</td>");
                    }
                    trHtml.AppendLine("	<td>" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                    trHtml.AppendLine("	<td class=\"evaluation_content\" data-id=\"" + info.ID + "\">" + i.ToString() + "." + info.Name + "</td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("</tr>");
                    i++;
                }

                i = 1;
                foreach (KPIInfo info in tempList3)
                {
                    trHtml.AppendLine("<tr>");
                    if (i == 1)
                    {
                        trHtml.AppendLine("	<td rowspan=\"" + tempList3.Count + "\" class=\"indicator_name\">" + KPIBLL.ReadKPI(info.ParentId).Name + "</td>");
                    }
                    trHtml.AppendLine("	<td>" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                    trHtml.AppendLine("	<td class=\"evaluation_content\" data-id=\"" + info.ID + "\">" + i.ToString() + "." + info.Name + "</td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("	<td class=\"schedule\"></td>");
                    trHtml.AppendLine("</tr>");
                    i++;
                }
            }

            if (userId > 0)
            {
                KPIEvaluateSearchInfo kpiEvaluate = new KPIEvaluateSearchInfo();
                kpiEvaluate.UserId         = userId.ToString();
                kpiEvaluate.PostId         = workPostId.ToString();
                kpiEvaluate.EvaluateNameId = evaluateNameId;

                //取得永久指标的值
                if (!string.IsNullOrEmpty(fixedKPI))
                {
                    kpiEvaluate.KPIdStr = fixedKPI;
                    foreach (KPIEvaluateInfo info in KPIEvaluateBLL.SearchKPIEvaluateList(kpiEvaluate))//BLLKPIEvaluate.SearchFixedKPIEvaluateList(kpiEvaluate)
                    {
                        if (string.IsNullOrEmpty(kpiIdStr))
                        {
                            kpiIdStr = info.KPIId + ":" + info.Rate;
                        }
                        else
                        {
                            kpiIdStr = kpiIdStr + "," + info.KPIId + ":" + info.Rate;
                        }
                    }
                }

                //取得临时指标的值
                if (!string.IsNullOrEmpty(tempKPI))
                {
                    kpiEvaluate.KPIdStr = tempKPI;
                    foreach (KPIEvaluateInfo info in KPIEvaluateBLL.SearchKPIEvaluateList(kpiEvaluate))
                    {
                        if (string.IsNullOrEmpty(kpiIdStr))
                        {
                            kpiIdStr = info.KPIId + ":" + info.Rate;
                        }
                        else
                        {
                            kpiIdStr = kpiIdStr + "," + info.KPIId + ":" + info.Rate;
                        }
                    }
                }
            }
        }
Exemplo n.º 14
0
        protected override void PageLoad()
        {
            base.PageLoad();
            base.Title = "综合能力评估";
            base.CheckUserPower("ReadTPRReport", PowerCheckType.Single);

            if (qualifiedRate < 0)
            {
                qualifiedRate = 0;
            }
            companyIDString = base.UserCompanyID.ToString();
            if (companyID <= 0)
            {
                companyIDString = base.SonCompanyID;
            }
            else if (companyID > 0)
            {
                companyIDString = companyID.ToString();
            }

            if (!base.ExistsSonCompany)
            {
                companyID = base.UserCompanyID;
            }

            //三者不能同时为空
            if (!string.IsNullOrEmpty(name) || !string.IsNullOrEmpty(postId) || !string.IsNullOrEmpty(postName) || evaluateNameId > 0)
            {
                KPIEvaluateSearchInfo kpiEvaluateSearch = new KPIEvaluateSearchInfo();
                if (!string.IsNullOrEmpty(name) || !string.IsNullOrEmpty(companyIDString))
                {
                    kpiEvaluateSearch.Condition = "[UserID] in (select id from [_User] where Del=0";
                    if (!string.IsNullOrEmpty(name))
                    {
                        kpiEvaluateSearch.Condition += " And [RealName]='" + name + "'";
                    }
                    if (!string.IsNullOrEmpty(companyIDString))
                    {
                        kpiEvaluateSearch.Condition += " And [CompanyId] in (" + companyIDString + ")";
                    }
                    kpiEvaluateSearch.Condition += ")";
                }
                if (!string.IsNullOrEmpty(postId))
                {
                    kpiEvaluateSearch.PostId = postId;
                }
                else
                {
                    //string workingPostIdStr = string.Empty;
                    //WorkingPostSearchInfo workingPostSearch = new WorkingPostSearchInfo();
                    //workingPostSearch.CompanyId = companyIDString;
                    //workingPostSearch.PostName = postName;
                    //workingPostSearch.IsPost = 1;
                    //foreach (WorkingPostInfo info in WorkingPostBLL.SearchWorkingPostList(workingPostSearch))
                    //{
                    //    if (string.IsNullOrEmpty(workingPostIdStr))
                    //        workingPostIdStr = info.ID.ToString();
                    //    else
                    //        workingPostIdStr += "," + info.ID.ToString();
                    //}
                    //kpiEvaluateSearch.PostId = workingPostIdStr;
                    if (!string.IsNullOrEmpty(kpiEvaluateSearch.Condition))
                    {
                        kpiEvaluateSearch.Condition += " And ";
                    }
                    kpiEvaluateSearch.Condition += "[PostId] in (Select [Id] from [_WorkingPost] where [IsPost]=1 and [State]=0";
                    if (!string.IsNullOrEmpty(postName))
                    {
                        kpiEvaluateSearch.Condition += " And [PostName]='" + postName + "'";
                    }
                    if (!string.IsNullOrEmpty(companyIDString))
                    {
                        kpiEvaluateSearch.Condition += " And [CompanyId] in (" + companyIDString + ")";
                    }
                    kpiEvaluateSearch.Condition += ")";
                }
                kpiEvaluateSearch.EvaluateNameId = evaluateNameId;
                foreach (KPIEvaluateReportInfo info in KPIEvaluateBLL.KPIEvaluateReportList(kpiEvaluateSearch))
                {
                    if (info.Rate >= qualifiedRate)
                    {
                        info.CompanyName = CompanyBLL.ReadCompany(UserBLL.ReadUser(info.UserId).CompanyID).CompanySimpleName;
                        reportList.Add(info);
                    }
                }
            }
        }
Exemplo n.º 15
0
        protected override void PageLoad()
        {
            base.PageLoad();
            base.Title = "添加KPI指标";

            base.CheckUserPower("AddEvaluate", PowerCheckType.Single);

            if (companyID <= 0)
            {
                companyID = base.UserCompanyID;
            }

            string tempKPI  = string.Empty; //临时指标ID
            string fixedKPI = string.Empty; //永久指标ID

            //获取岗位ID后,加载岗位KPI列表
            if (Action == "step1")
            {
                if (userId == int.MinValue)
                {
                    userName = RequestHelper.GetForm <string>("UserName");
                    UserSearchInfo user = new UserSearchInfo();
                    user.EqualRealName = userName;
                    user.InCompanyID   = companyID.ToString();
                    List <UserInfo> userList = UserBLL.SearchUserList(user);
                    if (userList.Count > 0)
                    {
                        userId = userList[0].ID;
                    }
                    else
                    {
                        ScriptHelper.Alert("找不到此用户");
                    }
                }
                workPostId     = RequestHelper.GetForm <int>("PostId");
                evaluateNameId = RequestHelper.GetForm <int>("EvaluationName");

                //获取UserId值

                if (workPostId > 0)
                {
                    KPISearchInfo kpiSearch = new KPISearchInfo();
                    kpiSearch.IdStr = WorkingPostBLL.ReadWorkingPostView(workPostId).KPIContent;
                    if (!string.IsNullOrEmpty(kpiSearch.IdStr))
                    {
                        List <KPIInfo> kpiList = KPIBLL.SearchKPIList(kpiSearch);

                        List <KPIInfo> tempList1 = new List <KPIInfo>();
                        List <KPIInfo> tempList2 = new List <KPIInfo>();
                        List <KPIInfo> tempList3 = new List <KPIInfo>();
                        foreach (KPIInfo info in kpiList)
                        {
                            if (info.Type == KPIType.Fixed)
                            {
                                if (string.IsNullOrEmpty(fixedKPI))
                                {
                                    fixedKPI = info.ID.ToString();
                                }
                                else
                                {
                                    fixedKPI = fixedKPI + "," + info.ID.ToString();
                                }
                            }
                            else
                            {
                                if (string.IsNullOrEmpty(tempKPI))
                                {
                                    tempKPI = info.ID.ToString();
                                }
                                else
                                {
                                    tempKPI = tempKPI + "," + info.ID.ToString();
                                }
                            }

                            switch (info.ParentId)
                            {
                            case 1:
                                tempList1.Add(info);
                                break;

                            case 2:
                                tempList2.Add(info);
                                break;

                            case 3:
                                tempList3.Add(info);
                                break;
                            }
                        }

                        int i = 1;
                        foreach (KPIInfo info in tempList1)
                        {
                            trHtml.AppendLine("<tr>");
                            if (i == 1)
                            {
                                trHtml.AppendLine("	<td rowspan=\"" + tempList1.Count + "\" class=\"indicator_name\">" + KPIBLL.ReadKPI(info.ParentId).Name + "</td>");
                            }
                            if (info.Type == KPIType.Fixed)
                            {
                                trHtml.AppendLine("	<td  class=\"forever\">" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                            }
                            else
                            {
                                trHtml.AppendLine("	<td>" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                            }
                            trHtml.AppendLine("	<td class=\"evaluation_content\" data-id=\"" + info.ID + "\">" + i.ToString() + "." + info.Name + "</td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("</tr>");
                            i++;
                        }

                        i = 1;
                        foreach (KPIInfo info in tempList2)
                        {
                            trHtml.AppendLine("<tr>");
                            if (i == 1)
                            {
                                trHtml.AppendLine("	<td rowspan=\"" + tempList2.Count + "\" class=\"indicator_name\">" + KPIBLL.ReadKPI(info.ParentId).Name + "</td>");
                            }
                            if (info.Type == KPIType.Fixed)
                            {
                                trHtml.AppendLine("	<td  class=\"forever\">" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                            }
                            else
                            {
                                trHtml.AppendLine("	<td>" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                            }
                            trHtml.AppendLine("	<td class=\"evaluation_content\" data-id=\"" + info.ID + "\">" + i.ToString() + "." + info.Name + "</td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("</tr>");
                            i++;
                        }

                        i = 1;
                        foreach (KPIInfo info in tempList3)
                        {
                            trHtml.AppendLine("<tr>");
                            if (i == 1)
                            {
                                trHtml.AppendLine("	<td rowspan=\"" + tempList3.Count + "\" class=\"indicator_name\">" + KPIBLL.ReadKPI(info.ParentId).Name + "</td>");
                            }
                            if (info.Type == KPIType.Fixed)
                            {
                                trHtml.AppendLine("	<td  class=\"forever\">" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                            }
                            else
                            {
                                trHtml.AppendLine("	<td>" + EnumHelper.ReadEnumChineseName <KPIType>((int)info.Type) + "</td>");
                            }
                            trHtml.AppendLine("	<td class=\"evaluation_content\" data-id=\"" + info.ID + "\">" + i.ToString() + "." + info.Name + "</td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("	<td class=\"schedule\"></td>");
                            trHtml.AppendLine("</tr>");
                            i++;
                        }
                    }
                }

                if (userId > 0)
                {
                    KPIEvaluateSearchInfo kpiEvaluate = new KPIEvaluateSearchInfo();
                    kpiEvaluate.UserId         = userId.ToString();
                    kpiEvaluate.EvaluateNameId = evaluateNameId;
                    kpiEvaluate.PostId         = workPostId.ToString();

                    //取得临时指标的值
                    if (!string.IsNullOrEmpty(tempKPI))
                    {
                        kpiEvaluate.KPIdStr = tempKPI;
                        foreach (KPIEvaluateInfo info in KPIEvaluateBLL.SearchKPIEvaluateList(kpiEvaluate))
                        {
                            if (string.IsNullOrEmpty(kpiIdStr))
                            {
                                kpiIdStr = info.KPIId + ":" + info.Rate;
                            }
                            else
                            {
                                kpiIdStr = kpiIdStr + "," + info.KPIId + ":" + info.Rate;
                            }
                        }
                    }

                    //取得永久指标的值
                    if (!string.IsNullOrEmpty(fixedKPI))
                    {
                        kpiEvaluate.KPIdStr = fixedKPI;
                        List <KPIEvaluateInfo> fixedKPIEValuateList = KPIEvaluateBLL.SearchKPIEvaluateList(kpiEvaluate);
                        //如果临时指标和永久指标的记录都为空的话,则为新增评估,调取永久指标记录
                        if (string.IsNullOrEmpty(kpiIdStr) && fixedKPIEValuateList.Count <= 0)
                        {
                            kpiEvaluate.EvaluateNameId = int.MinValue;
                            kpiEvaluate.PostId         = string.Empty; //所有岗位的评估记录都有效(包括已删除岗位的评估记录)
                            fixedKPIEValuateList       = KPIEvaluateBLL.SearchFixedKPIEvaluateList(kpiEvaluate);
                        }
                        foreach (KPIEvaluateInfo info in fixedKPIEValuateList)//BLLKPIEvaluate.SearchFixedKPIEvaluateList(kpiEvaluate)
                        {
                            if (string.IsNullOrEmpty(kpiIdStr))
                            {
                                kpiIdStr = info.KPIId + ":" + info.Rate;
                            }
                            else
                            {
                                kpiIdStr = kpiIdStr + "," + info.KPIId + ":" + info.Rate;
                            }
                        }
                    }
                }
            }
            else if (Action == "step2")
            {
                kpiIdStr = RequestHelper.GetForm <string>("kpiidstr");
                //workPostId = RequestHelper.GetForm<int>("PostId");
                string alertMessage = ShopLanguage.ReadLanguage("AddOK");
                base.CheckUserPower("AddEvaluate", PowerCheckType.Single);
                if (!string.IsNullOrEmpty(kpiIdStr))
                {
                    KPIEvaluateBLL.DeleteKPIEvaluate(userId, workPostId, evaluateNameId);
                    foreach (string item in kpiIdStr.Split(','))
                    {
                        KPIEvaluateInfo kpiEvaluate = new KPIEvaluateInfo();
                        kpiEvaluate.KPIId  = int.Parse(item.Split(':')[0]);
                        kpiEvaluate.Scorse = float.Parse(item.Split(':')[1]);
                        kpiEvaluate.UserId = userId;
                        //kpiEvaluate.EvaluateDate = evaluateDate;
                        kpiEvaluate.EvaluateNameId = evaluateNameId;
                        kpiEvaluate.PostId         = workPostId;
                        kpiEvaluate.Rate           = int.Parse(item.Split(':')[1]);

                        int id = KPIEvaluateBLL.AddKPIEvaluate(kpiEvaluate);
                        AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("Evaluate"), id);
                    }
                }
                ScriptHelper.Alert(alertMessage, "EvaluateAdd.aspx");
            }
        }