Ejemplo n.º 1
0
        private void CreateCustomIndicator(string beUserId, string beUserName, ExamineStage esEnt, ExamineStageDetail esdEnt)
        {
            ExamineIndicator       eiEnt  = ExamineIndicator.Find(esdEnt.ExamineIndicatorId);
            IList <IndicatorFirst> ifEnts = IndicatorFirst.FindAllByProperties(IndicatorFirst.Prop_ExamineIndicatorId, eiEnt.Id, IndicatorFirst.Prop_CustomColumn, "T");

            if (ifEnts.Count > 0)//只有当考核指标下指定了需要自定义的指标后,才有必要创建自定义指标 如果没有直接生成考核任务即可
            {
                IList <IndicatorSecond> isEnts = IndicatorSecond.FindAllByProperty(IndicatorSecond.Prop_IndicatorFirstId, ifEnts[0].Id);
                if (isEnts.Count > 0)
                {
                    CustomIndicator ciEnt = new CustomIndicator();
                    ciEnt.ExamineStageId      = esEnt.Id;
                    ciEnt.CreateId            = beUserId;
                    ciEnt.CreateName          = beUserName;
                    ciEnt.CreateTime          = DateTime.Now;
                    ciEnt.DeptId              = esEnt.LaunchDeptId;
                    ciEnt.DeptName            = esEnt.LaunchDeptName;
                    ciEnt.IndicatorNo         = DataHelper.QueryValue <string>("select BJKY_Examine.dbo.fun_getIndicatorNo()");
                    ciEnt.DeptIndicatorName   = eiEnt.IndicatorName;
                    ciEnt.DeptIndicatorId     = eiEnt.Id;
                    ciEnt.IndicatorSecondId   = isEnts[0].Id;
                    ciEnt.IndicatorSecondName = ifEnts[0].IndicatorFirstName;
                    ciEnt.Weight              = ifEnts[0].MaxScore;
                    ciEnt.Year      = esEnt.Year;
                    ciEnt.StageType = esEnt.StageType;
                    ciEnt.State     = "0";
                    ciEnt.DoCreate();
                }
            }
        }
Ejemplo n.º 2
0
        private void DoBatchDelete()  //批量删除
        {
            IList <object> idList = RequestData.GetList <object>("IdList");

            if (idList != null && idList.Count > 0)
            {
                foreach (string item in idList)
                {
                    IList <IndicatorFirst> ifEnts = IndicatorFirst.FindAllByProperty(IndicatorFirst.Prop_ExamineIndicatorId, item);
                    foreach (IndicatorFirst ifEnt in ifEnts)
                    {
                        IList <IndicatorSecond> isEnts = IndicatorSecond.FindAllByProperty(IndicatorSecond.Prop_IndicatorFirstId, ifEnt.Id);
                        foreach (IndicatorSecond isEnt in isEnts)
                        {
                            IList <ScoreStandard> ssEnts = ScoreStandard.FindAllByProperty(ScoreStandard.Prop_IndicatorSecondId, isEnt.Id);
                            foreach (ScoreStandard ssEnt in ssEnts)
                            {
                                ssEnt.DoDelete();
                            }
                            isEnt.DoDelete();
                        }
                        ifEnt.DoDelete();
                    }
                }
                ExamineIndicator.DoBatchDelete(idList.ToArray());
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     id = RequestData.Get <string>("id");
     if (!string.IsNullOrEmpty(id))
     {
         sql = @"select A.IndicatorSecondName,A.MaxScore,A.SortIndex,A.IndicatorFirstId,B.IndicatorFirstName,
                 B.MaxScore as BMaxScore,B.SortIndex as BSortIndex from BJKY_Examine..IndicatorSecond as A 
             left join BJKY_Examine..IndicatorFirst as B on A.IndicatorFirstId=B.Id where B.ExamineIndicatorId='{0}' order by BSortIndex,A.SortIndex asc";
         sql = string.Format(sql, id);
         PageState.Add("DataList", DataHelper.QueryDictList(sql));
         ExamineIndicator eiEnt = ExamineIndicator.Find(id);
         PageState.Add("BaseInfo", eiEnt.IndicatorName + "-->" + eiEnt.BeRoleName);
     }
 }
Ejemplo n.º 4
0
        private void DoCopy(ExamineIndicator eiNEnt, string oid)
        {
            IList <IndicatorFirst> ifOEnts = IndicatorFirst.FindAllByProperty(IndicatorFirst.Prop_SortIndex, IndicatorFirst.Prop_ExamineIndicatorId, oid);

            foreach (IndicatorFirst ifOEnt in ifOEnts)
            {
                IndicatorFirst ifNEnt = new IndicatorFirst(null, eiNEnt.Id, ifOEnt.IndicatorFirstName, "F", "F", ifOEnt.MaxScore, ifOEnt.SortIndex);
                ifNEnt.DoCreate();
                IList <IndicatorSecond> isOEnts = IndicatorSecond.FindAllByProperty(IndicatorSecond.Prop_SortIndex, IndicatorSecond.Prop_IndicatorFirstId, ifOEnt.Id);
                foreach (IndicatorSecond isOEnt in isOEnts)
                {
                    IndicatorSecond isNEnt = new IndicatorSecond(null, ifNEnt.Id, ifNEnt.IndicatorFirstName, isOEnt.IndicatorSecondName, isOEnt.MaxScore, isOEnt.SortIndex, isOEnt.ToolTip);
                    isNEnt.DoCreate();
                    IList <ScoreStandard> ssOEnts = ScoreStandard.FindAllByProperty(ScoreStandard.Prop_SortIndex, ScoreStandard.Prop_IndicatorSecondId, isOEnt.Id);
                    foreach (ScoreStandard ssOEnt in ssOEnts)
                    {
                        ScoreStandard ssNEnt = new ScoreStandard("", isNEnt.Id, ssOEnt.IndicatorThirdName, ssOEnt.MaxScore, ssOEnt.SortIndex);
                        ssNEnt.DoCreate();
                    }
                }
            }
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            op = RequestData.Get <string>("op");
            id = RequestData.Get <string>("id");
            switch (RequestActionString)
            {
            case "update":
                ent    = GetMergedData <ExamineIndicator>();
                seEnts = SysEnumeration.FindAllByProperty(SysEnumeration.Prop_Value, ent.BeRoleCode);
                if (seEnts.Count > 0)
                {
                    ent.BeRoleName = seEnts[0].Name;
                }
                ent.DoUpdate();
                break;

            case "create":
                ent    = GetPostedData <ExamineIndicator>();
                seEnts = SysEnumeration.FindAllByProperty(SysEnumeration.Prop_Value, ent.BeRoleCode);
                if (seEnts.Count > 0)
                {
                    ent.BeRoleName = seEnts[0].Name;
                }
                ent.DoCreate();
                break;

            case "copy":
                ent = GetPostedData <ExamineIndicator>();
                ExamineIndicator eiNEnt = new ExamineIndicator(null, ent.IndicatorName, ent.BeRoleCode, ent.BeRoleName, ent.BelongDeptId, ent.BelongDeptName, ent.Remark, null, null, null);
                eiNEnt.DoCreate();
                DoCopy(eiNEnt, id);
                break;

            default:
                DoSelect();
                break;
            }
        }
Ejemplo n.º 6
0
        private void DoSelect()
        {
            sql = @"select  Id,GroupName  from BJKY_Examine..PersonConfig where (ClerkIds like '%{0}%' or SecondLeaderIds like '%{0}%' 
            or FirstLeaderIds like '%{0}%') and (GroupType='职能服务部门' or GroupType='经营目标单位')";
            sql = string.Format(sql, UserInfo.UserID);
            EasyDictionary dic1 = DataHelper.QueryDict(sql, "Id", "GroupName");

            PageState.Add("enumDept", dic1);
            //sql = @"select Value,Name from SysEnumeration where Code='' ";
            //EasyDictionary dic2 = DataHelper.QueryDict(sql, "Value", "Name");
            PageState.Add("BeRoleEnum", SysEnumeration.GetEnumDict("BeExamineObject"));
            //            sql = @"select GroupID,Name  from SysGroup where PathLevel='4' and
            //                PatIndex('%'+GroupID+'%',(select Path from SysGroup where GroupID=(select top 1 GroupID from SysUserGroup where UserID='" + UserInfo.UserID + "') ))>0";
            IList <EasyDictionary> dics = DataHelper.QueryDictList(sql);//获取当前登录人部门

            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = ExamineIndicator.Find(id);
                }
                SetFormData(ent);
            }
            else
            {
                var obj = new object();
                if (dics.Count > 0)
                {
                    obj = new
                    {
                        BelongDeptId   = dics[0].Get <string>("Id"),
                        BelongDeptName = dics[0].Get <string>("GroupName")
                    };
                }
                SetFormData(obj);
            }
        }
Ejemplo n.º 7
0
        private void DoSelect()
        {
            string sequence            = "";
            DeptExamineRelation derEnt = DeptExamineRelation.TryFind(ExamineRelationId);//根据阶段取得部门

            if (derEnt != null)
            {
                sequence = derEnt.BeUserNames;
            }
            if (Index == "0")
            {
                sql = @"select *,CharIndex(BeUserName,'{0}') as SortIndex from BJKY_Examine..ExamineTask where State='1' and
                ExamineStageId='{1}' and  ToUserId='{2}' and  ExamineRelationId='{3}' order by SortIndex ";
                sql = string.Format(sql, sequence, ExamineStageId, UserInfo.UserID, ExamineRelationId);
            }
            if (Index == "1")
            {
                sql = @"select *,CharIndex(BeUserName,'{0}') as SortIndex  from BJKY_Examine..ExamineTask where State='2' and
                ExamineStageId='{1}' and  ToUserId='{2}' and  ExamineRelationId='{3}'";
                sql = string.Format(sql, sequence, ExamineStageId, UserInfo.UserID, ExamineRelationId);
            }
            if (Index == "2")
            {
                sql = @"select *,CharIndex(BeUserName,'{0}') as SortIndex  from BJKY_Examine..ExamineTask  where State='3' and
                ExamineStageId='{1}' and  ToUserId='{2}' and  ExamineRelationId='{3}' order by SortIndex ";
                sql = string.Format(sql, sequence, ExamineStageId, UserInfo.UserID, ExamineRelationId);
            }
            if (!string.IsNullOrEmpty(id))//单任务查看明细
            {
                sql = @"select * from BJKY_Examine..ExamineTask where Id='" + id + "'";
            }

            IList <EasyDictionary> dics = DataHelper.QueryDictList(sql);//找到所有符合条件的任务

            if (dics.Count > 0)
            {
                if (Index != "2")
                {
                    DataTable  dt = new DataTable();
                    DataColumn dc = new DataColumn("Id"); dt.Columns.Add(dc);
                    dc = new DataColumn("BeUserName"); dt.Columns.Add(dc);
                    dc = new DataColumn("BeDeptName"); dt.Columns.Add(dc);
                    dc = new DataColumn("Score"); dt.Columns.Add(dc);
                    dc = new DataColumn("Tag"); dt.Columns.Add(dc);

                    DataTable  dt1 = new DataTable();//这个表专门用来存储一级指标名称和各2级指标数量
                    DataColumn dc1 = new DataColumn("IndicatorFirstName"); dt1.Columns.Add(dc1);
                    dc1 = new DataColumn("SecondCount"); dt1.Columns.Add(dc1);
                    ExamineIndicator       eiEnt  = ExamineIndicator.Find(dics[0].Get <string>("ExamineIndicatorId"));
                    IList <IndicatorFirst> ifEnts = IndicatorFirst.FindAllByProperty("SortIndex", IndicatorFirst.Prop_ExamineIndicatorId, eiEnt.Id);
                    foreach (IndicatorFirst ifEnt in ifEnts)
                    {
                        IList <IndicatorSecond> isEnts = IndicatorSecond.FindAllByProperty("SortIndex", IndicatorSecond.Prop_IndicatorFirstId, ifEnt.Id);
                        DataRow dr1 = dt1.NewRow();
                        dr1["IndicatorFirstName"] = ifEnt.IndicatorFirstName + "(" + ifEnt.MaxScore + ")";
                        dr1["SecondCount"]        = isEnts.Count;
                        if (isEnts.Count > 0)
                        {
                            dt1.Rows.Add(dr1);//防止只有一级指标无2级指标。
                        }
                        foreach (IndicatorSecond isEnt in isEnts)
                        {
                            string standard = "!" + ifEnt.CustomColumn + "#" + isEnt.ToolTip;                                  //加入#号前面的字符是为了验证自定义指标列
                            dc = new DataColumn(isEnt.Id + isEnt.IndicatorSecondName + "(" + isEnt.MaxScore + ")" + standard); //列名有多种信息组合而成。便于前台取对应的值
                            dt.Columns.Add(dc);                                                                                //循环2级指标构建剩余列
                        }
                    }
                    IList <EasyDictionary> secDics = null;
                    if (dics.Count > 0)//通过任务的指标Id找到其下所有 的二级指标
                    {
                        sql     = @"select A.Id,  a.IndicatorSecondName,B.CustomColumn,A.ToolTip,A.MaxScore from  BJKY_Examine..IndicatorSecond A	                           
	                          left join BJKY_Examine..IndicatorFirst B  on  A.IndicatorFirstId=B.Id 
	                          where B.ExamineIndicatorid='{0}' "    ;
                        sql     = string.Format(sql, dics[0].Get <string>("ExamineIndicatorId"));
                        secDics = DataHelper.QueryDictList(sql);
                    }
                    foreach (EasyDictionary dic in dics)//通过任务构建行记录
                    {
                        DataRow dr = dt.NewRow();
                        dr["Id"]         = dic.Get <string>("Id");
                        dr["BeUserName"] = dic.Get <string>("BeUserName");
                        dr["BeDeptName"] = dic.Get <string>("BeDeptName");
                        dr["Score"]      = dic.Get <string>("Score");
                        dr["Tag"]        = dic.Get <string>("Tag");
                        foreach (EasyDictionary secDic in secDics)
                        {
                            string standard = "!" + secDic.Get <string>("CustomColumn") + "#" + secDic.Get <string>("ToolTip");
                            IList <IndicatorScore> insEnts = IndicatorScore.FindAllByProperties(IndicatorScore.Prop_ExamineTaskId, dic.Get <string>("Id"), IndicatorScore.Prop_IndicatorSecondId, secDic.Get <string>("Id"));
                            if (insEnts.Count > 0)
                            {
                                dr[secDic.Get <string>("Id") + secDic.Get <string>("IndicatorSecondName") + "(" + secDic.Get <string>("MaxScore") + ")" + standard] = insEnts[0].SubScore;
                            }
                        }
                        dt.Rows.Add(dr);
                    }
                    PageState.Add("DataList", dt);
                    PageState.Add("ColumnData", dt.Columns);
                    PageState.Add("DataList1", dt1);
                }
                else
                {
                    InitialHistoryScore(dics);
                }
                esEnt = ExamineStage.Find(ExamineStageId);
                string stageType = "";
                if (esEnt.StageType != "4")
                {
                    stageType = "第" + esEnt.StageType + "季度";
                }
                else
                {
                    stageType = "年度";
                }
                PageState.Add("Title", esEnt.Year + stageType + "考核评分表");
            }
        }