private void bindYearsToDropDownList() { string exception = ""; Dictionary <string, string> idYearDic = new Dictionary <string, string>(); string evaluatedID = Request.QueryString["id"]; if (EvaluationManagementCtrl.GetEvaluationYears(ref idYearDic, ref exception)) { foreach (string id in idYearDic.Keys) { DropDownList_Year.Items.Add(idYearDic[id], id); } } //else //{ // Alert.ShowInTop("获取年份信息失败!/n原因:" + exception, MessageBoxIcon.Error); //} }
private void bindEvaluatedToGrid() { string exception = ""; DataTable table = new DataTable(); string evaluatorID = Session["UserID"].ToString(); if (EvaluationManagementCtrl.GetEvaluatedByEvaluator(ref table, evaluatorID, ref exception)) { Grid1.DataSource = table; Grid1.DataBind(); } else { //Alert.ShowInTop("获取被考评人信息失败!\n原因:" + exception, MessageBoxIcon.Error); table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); } }
/// <summary> /// 绑定被考评人信息到Grid /// </summary> private void bindEvaluatedToGrid() { string exception = ""; DataTable table = new DataTable(); string depart = Session["Depart"].ToString(); if (EvaluationManagementCtrl.GetAllByDepart(ref table, depart, ref exception)) { table = dataTableFilter(table); Grid1.DataSource = table; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); } }
protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e) { string exception = ""; if (e.CommandName == "Stop") { object[] keys = Grid1.DataKeys[e.RowIndex]; string id = (string)keys[0]; if (EvaluationManagementCtrl.StopEvaluation(id, ref exception)) { Alert.ShowInTop("设置成功!", MessageBoxIcon.Information); } else { Alert.ShowInTop("设置失败!\n原因:" + exception, MessageBoxIcon.Error); } bindEvaluatedToGrid(); } }
/// <summary> /// 绑定被考评人信息到Grid /// </summary> private void bindEvaluatedToGrid() { string exception = ""; DataTable table = new DataTable(); if (DropDownList1.SelectedValue == "所有部门") { if (EvaluationManagementCtrl.GetAll(ref table, ref exception)) { table = dataTableFilter(table); Grid1.DataSource = table; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); } } else { string depart = DropDownList1.SelectedValue; if (EvaluationManagementCtrl.GetAllByDepart(ref table, depart, ref exception)) { table = dataTableFilter(table); Grid1.DataSource = table; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); } } }
protected void Button_Export_Click(object sender, EventArgs e) { string exception = ""; string evaluatedID = Request.QueryString["id"]; string evaluatedName = Request.QueryString["name"]; EvaluationResult evaluationResult; if (EvaluationManagementCtrl.GetEvaluationResultByEvaluatedAndYear(out evaluationResult, evaluatedID, DropDownList_Year.SelectedValue, ref exception)) { string filename = ""; if (ExportManagementCtrl.ExportEvaluationResultForIndividual(ref filename, evaluatedName, evaluationResult, ref exception)) { Response.ClearContent(); Response.ContentType = "application/excel"; Response.AddHeader("content-disposition", "attachment;filename=" + Server.UrlEncode(filename)); string path = Server.MapPath("..\\..\\downloadfiles\\" + filename); Response.TransmitFile(path); } } else { Alert.ShowInTop("导出失败!\n原因:" + exception, MessageBoxIcon.Error); } }
private void bindEvaluatedToGrid() { string exception = ""; DataTable table = new DataTable(); if (DropDownList1.SelectedValue == "0") { if (EvaluationManagementCtrl.GetEvaluatedThisYear(ref table, ref exception)) { Grid1.DataSource = table; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); //Alert.ShowInTop("查询被考评人信息失败!\n原因:" + exception, MessageBoxIcon.Error); } } else { if (EvaluationManagementCtrl.GetEvaluatedAll(ref table, ref exception)) { Grid1.DataSource = table; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); //Alert.ShowInTop("查询被考评人信息失败!\n原因:" + exception, MessageBoxIcon.Error); } } }
protected void Button_Submit_Click(object sender, EventArgs e) { if (CheckScores()) //检查分数是否合格 { List <string> scores = new List <string>(); int sumScore = 0; int tempSumScore = 0; int tempWeight = 0; for (int i = 0; i < Grid1.Rows.Count; i++) { GridRow row = Grid1.Rows[i]; System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score1") as System.Web.UI.WebControls.TextBox; tempSumScore += Convert.ToInt32(tb.Text.Trim()); } for (int i = 0; i < Grid2.Rows.Count; i++) { GridRow row = Grid2.Rows[i]; System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score2") as System.Web.UI.WebControls.TextBox; tempSumScore += Convert.ToInt32(tb.Text.Trim()); } for (int i = 0; i < Grid3.Rows.Count; i++) { GridRow row = Grid3.Rows[i]; System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score3") as System.Web.UI.WebControls.TextBox; tempSumScore += Convert.ToInt32(tb.Text.Trim()); } //计算关键指标的平均分 tempWeight = Convert.ToInt32(ViewState["KeyWeight"].ToString()); tempSumScore = (int)(tempSumScore / (Grid1.Rows.Count + Grid2.Rows.Count + Grid3.Rows.Count)); sumScore += tempSumScore * tempWeight / 100; scores.Add(tempSumScore.ToString()); tempSumScore = 0; for (int i = 0; i < Grid4.Rows.Count; i++) { GridRow row = Grid4.Rows[i]; System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score4") as System.Web.UI.WebControls.TextBox; tempSumScore += Convert.ToInt32(tb.Text.Trim()); } //计算岗位职责指标的平均分 tempWeight = Convert.ToInt32(ViewState["QualifyWeight"].ToString()); tempSumScore = (int)(tempSumScore / (Grid4.Rows.Count)); sumScore += tempSumScore * tempWeight / 100; scores.Add(tempSumScore.ToString()); tempSumScore = 0; for (int i = 0; i < Grid5.Rows.Count; i++) { GridRow row = Grid5.Rows[i]; System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score5") as System.Web.UI.WebControls.TextBox; tempSumScore += Convert.ToInt32(tb.Text.Trim()); } //计算岗位胜任能力指标的平均分 tempWeight = Convert.ToInt32(ViewState["QualifyWeight"].ToString()); tempSumScore = (int)(tempSumScore / (Grid5.Rows.Count)); sumScore += tempSumScore * tempWeight / 100; scores.Add(tempSumScore.ToString()); tempSumScore = 0; for (int i = 0; i < Grid6.Rows.Count; i++) { GridRow row = Grid6.Rows[i]; System.Web.UI.WebControls.TextBox tb = row.FindControl("TextBox_Score6") as System.Web.UI.WebControls.TextBox; tempSumScore += Convert.ToInt32(tb.Text.Trim()); } //计算工作态度指标的平均分 tempWeight = Convert.ToInt32(ViewState["AttitudeWeight"].ToString()); tempSumScore = (int)(tempSumScore / (Grid5.Rows.Count)); sumScore += tempSumScore * tempWeight / 100; scores.Add(tempSumScore.ToString()); tempSumScore = 0; if (Grid7.Rows.Count != 0) { GridRow gridRow = Grid7.Rows[0]; System.Web.UI.WebControls.DropDownList ddl = gridRow.FindControl("DropDownList_Reject") as System.Web.UI.WebControls.DropDownList; tempSumScore = Convert.ToInt32(ddl.SelectedValue); } //计算否决指标的得分 scores.Add(tempSumScore.ToString()); if (tempSumScore == 100) { sumScore = 0; } scores.Add(sumScore.ToString()); string[] scoreArray = scores.ToArray(); string exception = ""; string evaluatedID = Request.QueryString["id"]; string evaluatorID = Session["UserID"].ToString(); if (EvaluationManagementCtrl.UpdateScore(evaluatedID, evaluatorID, scores.ToArray(), ref exception)) { Alert.ShowInTop("提交成功!\n页面即将关闭", MessageBoxIcon.Information); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } else { Alert.ShowInTop("提交失败!\n原因:" + exception, MessageBoxIcon.Error); } } else { Alert.ShowInTop("请输入正确的分数!", MessageBoxIcon.Error); } }
private void bindEvaluateTableToGrid() { string exception = ""; EvaluateTable evaluateTable = new EvaluateTable(); string evaluatedID = Request.QueryString["id"]; if (EvaluationManagementCtrl.GetEvaluateTable(evaluatedID, ref evaluateTable, ref exception)) { ViewState["KeyWeight"] = evaluateTable.KeyWeight; ViewState["ResponseWeight"] = evaluateTable.KeyWeight; ViewState["QualifyWeight"] = evaluateTable.QualifyWeitht; ViewState["AttitudeWeight"] = evaluateTable.AttitudeWeight; ViewState["RejectWeight"] = evaluateTable.RejectWeight; Label_EvaluatedName.Text = evaluateTable.EvaluatedName; Label_PostName.Text = evaluateTable.PostName; Label_LaborDep.Text = evaluateTable.LaborDep; Label_LaborUnit.Text = evaluateTable.LaborUnit; RadioButtonList_Relation.SelectedValue = Request.QueryString["relation"]; Label_Period.Text = evaluateTable.StartTime + " ~ " + evaluateTable.StopTime; //关键岗位职责指标 DataTable table1 = new DataTable(); table1.Columns.Add("Title"); table1.Columns.Add("Quota"); foreach (Quota item in evaluateTable.KeyResponse) { table1.Rows.Add(item.Title, item.Content[0]); } Grid1.DataSource = table1; Grid1.DataBind(); //关键岗位胜任能力指标 DataTable table2 = new DataTable(); table2.Columns.Add("Title"); table2.Columns.Add("Quota1"); table2.Columns.Add("Quota2"); table2.Columns.Add("Quota3"); table2.Columns.Add("Quota4"); foreach (Quota item in evaluateTable.KeyQualify) { table2.Rows.Add(item.Title, item.Content[0], item.Content[1], item.Content[2], item.Content[3]); } Grid2.DataSource = table2; Grid2.DataBind(); //关键岗位工作态度指标 DataTable table3 = new DataTable(); table3.Columns.Add("Title"); table3.Columns.Add("Quota1"); table3.Columns.Add("Quota2"); table3.Columns.Add("Quota3"); table3.Columns.Add("Quota4"); foreach (Quota item in evaluateTable.KeyAttitude) { table3.Rows.Add(item.Title, item.Content[0], item.Content[1], item.Content[2], item.Content[3]); } Grid3.DataSource = table3; Grid3.DataBind(); //岗位职责指标 DataTable table4 = new DataTable(); table4.Columns.Add("Title"); table4.Columns.Add("Quota"); foreach (Quota item in evaluateTable.Response) { table4.Rows.Add(item.Title, item.Content[0]); } Grid4.DataSource = table4; Grid4.DataBind(); //岗位胜任能力指标 DataTable table5 = new DataTable(); table5.Columns.Add("Title"); table5.Columns.Add("Quota1"); table5.Columns.Add("Quota2"); table5.Columns.Add("Quota3"); table5.Columns.Add("Quota4"); foreach (Quota item in evaluateTable.Qualify) { table5.Rows.Add(item.Title, item.Content[0], item.Content[1], item.Content[2], item.Content[3]); } Grid5.DataSource = table5; Grid5.DataBind(); //岗位工作态度指标 DataTable table6 = new DataTable(); table6.Columns.Add("Title"); table6.Columns.Add("Quota1"); table6.Columns.Add("Quota2"); table6.Columns.Add("Quota3"); table6.Columns.Add("Quota4"); foreach (Quota item in evaluateTable.Attitude) { table6.Rows.Add(item.Title, item.Content[0], item.Content[1], item.Content[2], item.Content[3]); } Grid6.DataSource = table6; Grid6.DataBind(); //否决指标 DataTable table7 = new DataTable(); table7.Columns.Add("Title"); table7.Columns.Add("Quota"); table7.Rows.Add("严重违反规章制度", "累计旷工3天以上的;\n严重失职,营私舞弊,给本单位造成3000元以上经济损失或者其它严重后果的;\n同时与其他用人单位建立劳动关系,对完成本单位工作任务造成严重影响,或者经本单位提出,拒不改正的;\n违背职业道德,行贿、受贿价值超过3000元以上的;\n被依法追究刑事责任的;"); table7.Rows.Add(evaluateTable.Reject[0].Title, evaluateTable.Reject[0].Content[0]); Grid7.DataSource = table7; Grid7.DataBind(); System.Web.UI.WebControls.DropDownList ddl = Grid7.Rows[1].FindControl("DropDownList_Reject") as System.Web.UI.WebControls.DropDownList; ddl.Visible = false; } }