protected void Page_Load(object sender, EventArgs e) { switch (RequestActionString) { case "GetResultByUserId": string userId = RequestData.Get <string>("userId"); IList <ExamYearResult> eyrEnts = ExamYearResult.FindAllByProperty("Year", "UserId", userId); IList <EasyDictionary> dics = new List <EasyDictionary>(); foreach (ExamYearResult eyrEnt in eyrEnts) { EasyDictionary dic = new EasyDictionary(); dic.Add("YearQuarter", eyrEnt.Year + "-1"); dic.Add("Score", eyrEnt.FirstQuarterScore); dics.Add(dic); dic = new EasyDictionary(); dic.Add("YearQuarter", eyrEnt.Year + "-2"); dic.Add("Score", eyrEnt.SecondQuarterScore); dics.Add(dic); dic = new EasyDictionary(); dic.Add("YearQuarter", eyrEnt.Year + "-3"); dic.Add("Score", eyrEnt.ThirdQuarterScore); dics.Add(dic); dic = new EasyDictionary(); dic.Add("YearQuarter", eyrEnt.Year + "-4"); dic.Add("Score", eyrEnt.FourthQuarterScore); dics.Add(dic); } PageState.Add("Result", dics); break; default: DoSelect(); break; } }
private void DoSelect() { if (op != "c" && op != "cs") { if (!String.IsNullOrEmpty(id)) { ent = Feedback.Find(id); } SetFormData(ent); } else { ExamYearResult eyrEnt = ExamYearResult.Find(ExamYearResultId); string level = eyrEnt.AdviceLevel; decimal? score = eyrEnt.IntegrationScore; if (!string.IsNullOrEmpty(eyrEnt.ApproveLevel)) { level = eyrEnt.ApproveLevel; } if (!string.IsNullOrEmpty(eyrEnt.AppealLevel)) { level = eyrEnt.AppealLevel; } if (eyrEnt.ApproveScore > 0) { score = eyrEnt.ApproveScore; } if (eyrEnt.AppealScore > 0) { score = eyrEnt.AppealScore; } var obj = new { ExamYearResultId = ExamYearResultId, ExamineStageId = eyrEnt.ExamineStageId, UserId = eyrEnt.UserId, UserName = eyrEnt.UserName, //因为部门级考核没有被考核角色 和名称 所以要判断一下 BeRoleCode = !string.IsNullOrEmpty(eyrEnt.BeRoleCode) ? eyrEnt.BeRoleCode : "", BeRoleName = !string.IsNullOrEmpty(eyrEnt.BeRoleCode) ? SysEnumeration.FindAllByProperty(SysEnumeration.Prop_Code, eyrEnt.BeRoleCode).First <SysEnumeration>().Name : "", DeptId = eyrEnt.DeptId, DeptName = eyrEnt.DeptName, Year = eyrEnt.Year, ExamineGrade = level, IntegrationScore = score, FirstQuarterScore = eyrEnt.FirstQuarterScore, SecondQuarterScore = eyrEnt.SecondQuarterScore, ThirdQuarterScore = eyrEnt.ThirdQuarterScore, YearScore = eyrEnt.FourthQuarterScore }; SetFormData(obj); } }
private void DoSelect() { if (op == "c") { if (!String.IsNullOrEmpty(ExamYearResultId)) { ExamYearResult eyrEnt = ExamYearResult.Find(ExamYearResultId); ExamineStage esEnt = ExamineStage.Find(eyrEnt.ExamineStageId); IList <PersonConfig> pcEnts1 = PersonConfig.FindAllByProperty("GroupCode", "HRAppealAcceptor"); IList <PersonConfig> pcEnts2 = PersonConfig.FindAllByProperty("GroupCode", "HRAppealCharger"); IList <PersonConfig> pcEnts3 = PersonConfig.FindAllByProperty("Id", eyrEnt.DeptId); var obj = new { ExamYearResultId = ExamYearResultId, ExamineStageId = eyrEnt.ExamineStageId, ExamineType = esEnt.ExamineType, AppealUserId = eyrEnt.UserId, AppealUserName = eyrEnt.UserName, OriginalScore = eyrEnt.ApproveScore.HasValue ? eyrEnt.ApproveScore : eyrEnt.IntegrationScore, OriginalLevel = String.IsNullOrEmpty(eyrEnt.ApproveLevel) ? eyrEnt.ApproveLevel : eyrEnt.AdviceLevel, //有可能是部门级考核 没有角色编号和角色名称 BeRoleCode = !string.IsNullOrEmpty(eyrEnt.BeRoleCode) ? eyrEnt.BeRoleCode : "", BeRoleName = !string.IsNullOrEmpty(eyrEnt.BeRoleCode) ? SysEnumeration.FindAllByProperty(SysEnumeration.Prop_Code, eyrEnt.BeRoleCode).First <SysEnumeration>().Name : "", DeptId = eyrEnt.DeptId, DeptName = eyrEnt.DeptName, AppealTime = System.DateTime.Now.ToShortDateString(), AcceptUserId = pcEnts1.Count > 0 ? pcEnts1[0].ClerkIds.Replace(",", "") : "", AcceptUserName = pcEnts1.Count > 0 ? pcEnts1[0].ClerkNames : "", DeptLeaderId = pcEnts3.Count > 0 ? pcEnts3[0].FirstLeaderIds.Replace(",", "") : "", DeptLeaderName = pcEnts3.Count > 0 ? pcEnts3[0].FirstLeaderNames : "", HrUserId = pcEnts2.Count > 0 ? pcEnts2[0].ClerkIds.Replace(",", "") : "", HrUserName = pcEnts2.Count > 0 ? pcEnts2[0].ClerkNames : "" }; SetFormData(obj); } } else { if (!string.IsNullOrEmpty(id)) { ent = ExamineAppeal.Find(id); SetFormData(ent); } } PageState.Add("ExamineLevel", SysEnumeration.GetEnumDict("ExamineLevel")); }
protected void Page_Load(object sender, EventArgs e) { ExamineStageId = RequestData.Get <string>("ExamineStageId"); if (!string.IsNullOrEmpty(ExamineStageId)) { esEnt = ExamineStage.Find(ExamineStageId); } IList <string> YearResultIds = RequestData.GetList <string>("YearResultIds"); switch (RequestActionString) { case "Submit": esEnt.State = 4; esEnt.DoUpdate(); break; case "AutoSave": string id = RequestData.Get <string>("id"); string AdviceLevel = RequestData.Get <string>("AdviceLevel"); if (!string.IsNullOrEmpty(id)) { ExamYearResult eyrEnt = ExamYearResult.Find(id); eyrEnt.AdviceLevel = AdviceLevel; eyrEnt.ApproveLevel = AdviceLevel; eyrEnt.DoUpdate(); } break; case "FindExamineStageResultId": IList <ExamineStageResult> esrEnts = ExamineStageResult.FindAllByProperties("Year", RequestData.Get <string>("Year"), "StageType", RequestData.Get <string>("StageType"), "UserId", RequestData.Get <string>("UserId")); if (esrEnts.Count > 0) { PageState.Add("FindExamineStageResultId", esrEnts[0].Id); } break; default: DoSelect(); break; } }
protected void Page_Load(object sender, EventArgs e) { ExamineStageId = RequestData.Get <string>("ExamineStageId"); if (!string.IsNullOrEmpty(ExamineStageId)) { esEnt = ExamineStage.Find(ExamineStageId); } IList <string> YearResultIds = RequestData.GetList <string>("YearResultIds"); switch (RequestActionString) { case "Submit": esEnt.State = 4; esEnt.DoUpdate(); break; case "AutoSave": string id = RequestData.Get <string>("id"); string AdviceLevel = RequestData.Get <string>("AdviceLevel"); if (!string.IsNullOrEmpty(id)) { ExamYearResult eyrEnt = ExamYearResult.Find(id); eyrEnt.AdviceLevel = AdviceLevel; //副院长和部门员工不需要人力资源部评定等级 if (eyrEnt.BeRoleCode != "BeDeptClerk" && eyrEnt.BeRoleCode != "BeDeputyDirector") { eyrEnt.ApproveLevel = AdviceLevel; } eyrEnt.DoUpdate(); } break; default: DoSelect(); break; } }
private void CaculateYearResult() { IList <EasyDictionary> dics = null; //每次部门内被考核的人员可能有所变动 以最后一阶段的人为准 IList <ExamineStageResult> esrEnts = ExamineStageResult.FindAllByProperty("SortIndex", ExamineStageResult.Prop_ExamineStageId, esEnt.Id); for (int i = 0; i < esrEnts.Count; i++) { ExamYearResult eyrEnt = new ExamYearResult(); eyrEnt.ExamineStageId = esEnt.Id; if (esEnt.ExamineType == "院级考核") { eyrEnt.BeRoleCode = esrEnts[i].BeRoleCode; eyrEnt.BeRoleName = esrEnts[i].BeRoleName; } eyrEnt.UserId = esrEnts[i].UserId; eyrEnt.UserName = esrEnts[i].UserName; eyrEnt.DeptId = esrEnts[i].DeptId; eyrEnt.DeptName = esrEnts[i].DeptName; eyrEnt.Year = esrEnts[i].Year; int quarters = 0;//便于后面统计平均分 //2012 比较特殊直接取部门填报分 因此用2012SQL 首次考完记得去掉 // sql = @"select Score from BJKY_Examine..ExamineStageResult as A left join BJKY_Examine..ExamineStage as B on A.ExamineStageId=B.Id where // A.Year='" + esEnt.Year + "' and A.StageType='1' and A.UserId='" + esrEnts[i].UserId + "' and A.DeptId='" + esrEnts[i].DeptId + "' and B.ExamineType='" + esEnt.ExamineType + "'"; //此SQL加类型限制 是担心院级考核取到该人在部门级考核里第一季度的分 sql = @"select Score from BJKY_Examine..ExamineStageResult where Year='" + esEnt.Year + "' and StageType='1' and UserId='" + esrEnts[i].UserId + "' and DeptId='" + esrEnts[i].DeptId + "'"; dics = DataHelper.QueryDictList(sql); quarters += dics.Count > 0 ? 1 : 0; if (dics.Count > 0) { eyrEnt.FirstQuarterScore = dics[0].Get <decimal>("Score"); } sql = @"select Score from BJKY_Examine..ExamineStageResult where Year='" + esEnt.Year + "' and StageType='2' and UserId='" + esrEnts[i].UserId + "' and DeptId='" + esrEnts[i].DeptId + "'"; dics = DataHelper.QueryDictList(sql); quarters += dics.Count > 0 ? 1 : 0; if (dics.Count > 0) { eyrEnt.SecondQuarterScore = dics[0].Get <decimal>("Score"); } sql = @"select Score from BJKY_Examine..ExamineStageResult where Year='" + esEnt.Year + "' and StageType='3' and UserId='" + esrEnts[i].UserId + "' and DeptId='" + esrEnts[i].DeptId + "'"; dics = DataHelper.QueryDictList(sql); quarters += dics.Count > 0 ? 1 : 0; if (dics.Count > 0) { eyrEnt.ThirdQuarterScore = dics[0].Get <decimal>("Score"); } eyrEnt.FourthQuarterScore = esrEnts[i].Score; eyrEnt.UpLevelScore = esrEnts[i].UpAvgScore; eyrEnt.SameLevelScore = esrEnts[i].SameAvgScore; eyrEnt.DownLevelScore = esrEnts[i].DownAvgScore; int?totalWeight = 0; IList <SysConfig> scEnts = SysConfig.FindAll();//取各角色各阶段类型权重 + if (esEnt.ExamineType == "院级考核") { eyrEnt.IntegrationScore = esrEnts[i].Score; } else { if (quarters > 0) //平均分只有部门级考核有 是针对前三季度算的 { eyrEnt.AvgScore = (eyrEnt.FirstQuarterScore.GetValueOrDefault() + eyrEnt.SecondQuarterScore.GetValueOrDefault() + eyrEnt.ThirdQuarterScore.GetValueOrDefault()) / quarters; } totalWeight = (eyrEnt.AvgScore.HasValue ? scEnts[0].ClerkQuarterWeight : 0) + (eyrEnt.FourthQuarterScore.HasValue ? scEnts[0].ClerkYearWeight : 0); eyrEnt.IntegrationScore = (eyrEnt.AvgScore.GetValueOrDefault()) * (scEnts[0].ClerkQuarterWeight) / totalWeight + (eyrEnt.FourthQuarterScore.GetValueOrDefault()) * (scEnts[0].ClerkYearWeight) / totalWeight; } eyrEnt.DoCreate(); } }
protected void Page_Load(object sender, EventArgs e) { op = RequestData.Get <string>("op"); id = RequestData.Get <string>("id"); ExamYearResultId = RequestData.Get <string>("ExamYearResultId"); string Action = RequestData.Get <string>("Action"); int State = RequestData.Get <int>("State"); switch (RequestActionString) { case "update": ent = GetMergedData <ExamineAppeal>(); if (Action == "Agree") { switch (ent.State) { case 1: ent.AcceptSubmitTime = System.DateTime.Now; if (ent.ExamineType == "院级考核") //如果是院级考核 提交后直接送达人力资源部负责人 { ent.State = 3; } else { ent.State = 2; } break; case 2: ent.DeptLeaderSubmitTime = System.DateTime.Now; ent.State = 3; break; case 3: ent.HrSubmitTime = System.DateTime.Now; ent.State = 4; //按正常流程走完了 ent.Result = "同意"; ExamYearResult eyrEnt = ExamYearResult.Find(ent.ExamYearResultId); eyrEnt.AppealLevel = ent.ModifiedLevel; eyrEnt.AppealScore = ent.ModifiedScore; eyrEnt.DoUpdate(); break; default: ent.AppealTime = System.DateTime.Now; ent.State = 1; break; } } if (Action == "Disagree") { ent.State = 4;//按正常流程走完了 ent.Result = "已打回"; ent.AcceptSubmitTime = System.DateTime.Now; } ent.DoUpdate(); break; case "create": ent = GetPostedData <ExamineAppeal>(); if (Action == "Agree") //创建的时候提交 { ent.State = 1; ent.AppealTime = System.DateTime.Now; } ent.DoCreate(); break; default: DoSelect(); break; } }