using BLL; using System; using System.Linq; namespace FineUIPro.Web.Perfomance { public partial class PerfomanceRecordView : PageBase { #region 加载 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); initContent(); string perfomanceRecordId = Request.Params["PerfomanceRecordId"]; if (!string.IsNullOrEmpty(perfomanceRecordId)) { Model.Perfomance_PerfomanceRecord perfomanceRecord = BLL.PerfomanceRecordService.GetPerfomanceRecordById(perfomanceRecordId); if (perfomanceRecord != null) { this.txtPerfomanceRecordCode.Text = CodeRecordsService.ReturnCodeByDataId(perfomanceRecordId); if (!string.IsNullOrEmpty(perfomanceRecord.UnitId)) { var unit = BLL.UnitService.GetUnitByUnitId(perfomanceRecord.UnitId); if (unit != null) { this.txtUnitName.Text = unit.UnitName; } } this.txtSubContractNum.Text = perfomanceRecord.SubContractNum; if (perfomanceRecord.EvaluationDate != null) { this.txtEvaluationDate.Text = string.Format("{0:yyyy-MM-dd}", perfomanceRecord.EvaluationDate); } this.txtEvaluationDef.Text = perfomanceRecord.EvaluationDef; if (!string.IsNullOrEmpty(perfomanceRecord.RewardOrPunish)) { if (perfomanceRecord.RewardOrPunish == "1") { this.txtRewardOrPunish.Text = "奖励"; } else if (perfomanceRecord.RewardOrPunish == "2") { this.txtRewardOrPunish.Text = "处罚"; } } if (perfomanceRecord.RPMoney != null) { this.txtRPMoney.Text = Convert.ToString(perfomanceRecord.RPMoney); } this.txtAssessmentGroup.Text = perfomanceRecord.AssessmentGroup; this.txtBehavior_1.Text = perfomanceRecord.Behavior_1; this.txtBehavior_2.Text = perfomanceRecord.Behavior_2; this.txtBehavior_3.Text = perfomanceRecord.Behavior_3; this.txtBehavior_4.Text = perfomanceRecord.Behavior_4; this.txtBehavior_5.Text = perfomanceRecord.Behavior_5; this.txtBehavior_6.Text = perfomanceRecord.Behavior_6; this.txtBehavior_7.Text = perfomanceRecord.Behavior_7; this.txtBehavior_8.Text = perfomanceRecord.Behavior_8; this.txtBehavior_9.Text = perfomanceRecord.Behavior_9; this.txtBehavior_10.Text = perfomanceRecord.Behavior_10; this.txtBehavior_11.Text = perfomanceRecord.Behavior_11; this.txtBehavior_12.Text = perfomanceRecord.Behavior_12; this.txtBehavior_13.Text = perfomanceRecord.Behavior_13; this.txtBehavior_14.Text = perfomanceRecord.Behavior_14; this.txtBehavior_15.Text = perfomanceRecord.Behavior_15; this.txtBehavior_16.Text = perfomanceRecord.Behavior_16; this.txtBehavior_17.Text = perfomanceRecord.Behavior_17; this.txtBehavior_18.Text = perfomanceRecord.Behavior_18; this.txtBehavior_19.Text = perfomanceRecord.Behavior_19; this.txtBehavior_20.Text = perfomanceRecord.Behavior_20; this.txtScore_1.Text = Convert.ToString(perfomanceRecord.Score_1); this.txtScore_2.Text = Convert.ToString(perfomanceRecord.Score_2); this.txtScore_3.Text = Convert.ToString(perfomanceRecord.Score_3); this.txtScore_4.Text = Convert.ToString(perfomanceRecord.Score_4); this.txtScore_5.Text = Convert.ToString(perfomanceRecord.Score_5); this.txtScore_6.Text = Convert.ToString(perfomanceRecord.Score_6); this.txtScore_7.Text = Convert.ToString(perfomanceRecord.Score_7); this.txtScore_8.Text = Convert.ToString(perfomanceRecord.Score_8); this.txtScore_9.Text = Convert.ToString(perfomanceRecord.Score_9); this.txtScore_10.Text = Convert.ToString(perfomanceRecord.Score_10); this.txtScore_11.Text = Convert.ToString(perfomanceRecord.Score_11); this.txtScore_12.Text = Convert.ToString(perfomanceRecord.Score_12); this.txtScore_13.Text = Convert.ToString(perfomanceRecord.Score_13); this.txtScore_14.Text = Convert.ToString(perfomanceRecord.Score_14); this.txtScore_15.Text = Convert.ToString(perfomanceRecord.Score_15); this.txtScore_16.Text = Convert.ToString(perfomanceRecord.Score_16); this.txtScore_17.Text = Convert.ToString(perfomanceRecord.Score_17); this.txtScore_18.Text = Convert.ToString(perfomanceRecord.Score_18); this.txtScore_19.Text = Convert.ToString(perfomanceRecord.Score_19); this.txtScore_20.Text = Convert.ToString(perfomanceRecord.Score_20); this.txtTotalJudging.Text = perfomanceRecord.TotalJudging; this.txtTotalScore.Text = Convert.ToString(perfomanceRecord.TotalScore); this.divFile1.InnerHtml = BLL.UploadAttachmentService.ShowAttachment("../", perfomanceRecord.AttachUrl); } } ///初始化审核菜单 this.ctlAuditFlow.MenuId = BLL.Const.PerfomanceRecordMenuId; this.ctlAuditFlow.DataId = perfomanceRecordId; } } #endregion protected void initContent() { var contents = Funs.DB.Perfomance_PerfomanceContent.Where(x => x.PerfomanceType == 1).OrderBy(x => x.ShowIndex).ToList(); int i = 1; foreach (var content in contents) { switch (i) { case 1: row1.Hidden = false; txtValue_1.Text = content.PerfomanceValue; txtContent_1.Text = content.PerfomanceContent; txtScore_1.MaxValue = double.Parse(content.PerfomanceValue); break; case 2: row2.Hidden = false; txtValue_2.Text = content.PerfomanceValue; txtContent_2.Text = content.PerfomanceContent; txtScore_2.MaxValue = double.Parse(content.PerfomanceValue); break; case 3: row3.Hidden = false; txtValue_3.Text = content.PerfomanceValue; txtContent_3.Text = content.PerfomanceContent; txtScore_3.MaxValue = double.Parse(content.PerfomanceValue); break; case 4: row4.Hidden = false; txtValue_4.Text = content.PerfomanceValue; txtContent_4.Text = content.PerfomanceContent; txtScore_4.MaxValue = double.Parse(content.PerfomanceValue); break; case 5: row5.Hidden = false; txtValue_5.Text = content.PerfomanceValue; txtContent_5.Text = content.PerfomanceContent; txtScore_5.MaxValue = double.Parse(content.PerfomanceValue); break; case 6: row6.Hidden = false; txtValue_6.Text = content.PerfomanceValue; txtContent_6.Text = content.PerfomanceContent; txtScore_6.MaxValue = double.Parse(content.PerfomanceValue); break; case 7: row7.Hidden = false; txtValue_7.Text = content.PerfomanceValue; txtContent_7.Text = content.PerfomanceContent; txtScore_7.MaxValue = double.Parse(content.PerfomanceValue); break; case 8: row8.Hidden = false; txtValue_8.Text = content.PerfomanceValue; txtContent_8.Text = content.PerfomanceContent; txtScore_8.MaxValue = double.Parse(content.PerfomanceValue); break; case 9: row9.Hidden = false; txtValue_9.Text = content.PerfomanceValue; txtContent_9.Text = content.PerfomanceContent; txtScore_9.MaxValue = double.Parse(content.PerfomanceValue); break; case 10: row10.Hidden = false; txtValue_10.Text = content.PerfomanceValue; txtContent_10.Text = content.PerfomanceContent; txtScore_10.MaxValue = double.Parse(content.PerfomanceValue); break; case 11: row11.Hidden = false; txtValue_11.Text = content.PerfomanceValue; txtContent_11.Text = content.PerfomanceContent; txtScore_11.MaxValue = double.Parse(content.PerfomanceValue); break; case 12: row12.Hidden = false; txtValue_12.Text = content.PerfomanceValue; txtContent_12.Text = content.PerfomanceContent; txtScore_12.MaxValue = double.Parse(content.PerfomanceValue); break; case 13: row13.Hidden = false; txtValue_13.Text = content.PerfomanceValue; txtContent_13.Text = content.PerfomanceContent; txtScore_13.MaxValue = double.Parse(content.PerfomanceValue); break; case 14: row14.Hidden = false; txtValue_14.Text = content.PerfomanceValue; txtContent_14.Text = content.PerfomanceContent; txtScore_14.MaxValue = double.Parse(content.PerfomanceValue); break; case 15: row15.Hidden = false; txtValue_15.Text = content.PerfomanceValue; txtContent_15.Text = content.PerfomanceContent; txtScore_15.MaxValue = double.Parse(content.PerfomanceValue); break; case 16: row16.Hidden = false; txtValue_16.Text = content.PerfomanceValue; txtContent_16.Text = content.PerfomanceContent; txtScore_16.MaxValue = double.Parse(content.PerfomanceValue); break; case 17: row17.Hidden = false; txtValue_17.Text = content.PerfomanceValue; txtContent_17.Text = content.PerfomanceContent; txtScore_17.MaxValue = double.Parse(content.PerfomanceValue); break; case 18: row18.Hidden = false; txtValue_18.Text = content.PerfomanceValue; txtContent_18.Text = content.PerfomanceContent; txtScore_18.MaxValue = double.Parse(content.PerfomanceValue); break; case 19: row19.Hidden = false; txtValue_19.Text = content.PerfomanceValue; txtContent_19.Text = content.PerfomanceContent; txtScore_19.MaxValue = double.Parse(content.PerfomanceValue); break; case 20: row20.Hidden = false; txtValue_20.Text = content.PerfomanceValue; txtContent_20.Text = content.PerfomanceContent; txtScore_20.MaxValue = double.Parse(content.PerfomanceValue); break; } i++; } } } }