protected void DeleteSelected_Click(object sender, EventArgs e) { syncSelectedRowIndexArrayToHiddenField(); string exception = ""; string s = hfSelectedIDS.Text.Trim().TrimStart('[').TrimEnd(']'); if (s == "") { Alert.ShowInTop("请至少选择一项!", MessageBoxIcon.Information); return; } List <string> IDs = new List <string>(); string[] tempIDs = s.Split(','); foreach (string item in tempIDs) { IDs.Add(item.Trim('"')); } if (EvaluatorManagementCtrl.Delete(IDs, ref exception)) { Alert.ShowInTop("删除成功", MessageBoxIcon.Information); } else { Alert.ShowInTop("删除失败\n原因:" + exception, MessageBoxIcon.Error); } bindEvaluatorToGrid(); }
protected void Button_Reject_Click(object sender, EventArgs e) { string exception = ""; if (TextArea_Comment.Text == "") { Alert.Show("请输入审核意见!"); return; } if (TextArea_Comment.Text.Length > 50) { Alert.Show("最多输入50字"); return; } if (Request.QueryString["parent"] == "checkpostbook") { if (PostBookManagementCtrl.SetRejected(Request.QueryString["id"], ref exception) && PostBookManagementCtrl.UpdateComment(TextArea_Comment.Text, Request.QueryString["id"], ref exception)) { Alert.ShowInTop("设置成功!\n窗口即将关闭", MessageBoxIcon.Information); PageContext.RegisterStartupScript(ActiveWindow.GetHideReference()); } else { Alert.ShowInTop("设置失败!\n原因:" + exception, MessageBoxIcon.Error); } } else if (Request.QueryString["parent"] == "checkevaluator") { if (EvaluatorManagementCtrl.SetRejected(Request.QueryString["id"], ref exception) && EvaluatorManagementCtrl.UpdateComment(TextArea_Comment.Text, Request.QueryString["id"], ref exception)) { Alert.ShowInTop("设置成功!\n窗口即将关闭", MessageBoxIcon.Information); PageContext.RegisterStartupScript(ActiveWindow.GetHideReference()); } else { Alert.ShowInTop("设置失败!\n原因:" + exception, MessageBoxIcon.Error); } } else if (Request.QueryString["parent"] == "checkevaluatetable") { if (EvaluateTableManagementCtrl.SetRejected(Request.QueryString["id"], ref exception) && EvaluateTableManagementCtrl.UpdateComment(Request.QueryString["id"], TextArea_Comment.Text, ref exception)) { Alert.ShowInTop("设置成功!\n窗口即将关闭", MessageBoxIcon.Information); PageContext.RegisterStartupScript(ActiveWindow.GetHideReference()); } else { Alert.ShowInTop("设置失败!\n原因:" + exception, MessageBoxIcon.Error); } } }
/// <summary> /// 显示已设置的考评人名单 /// </summary> private void BindSettedEvaluatorToGrid() { string exception = ""; DataTable dt = new DataTable(); string evaluatedID = Request.QueryString["id"]; if (EvaluatorManagementCtrl.GetSettedEvaluator(evaluatedID, ref dt, ref exception)) { Grid2.DataSource = dt; Grid2.DataBind(); } }
/// <summary> /// 查询指定被考评人的考核表是否已通过审核,已通过则返回true,否则返回false /// </summary> /// <returns></returns> private bool isEvaluateTablePassed() { bool returnValue = true; string exception = ""; string id = Request.QueryString["id"]; if (!EvaluatorManagementCtrl.IsEvaluateTablePasswd(id, ref exception)) { returnValue = false; } return(returnValue); }
/// <summary> /// 将已提交的名单显示在页面上 /// </summary> private void SetSubmitted() { string evaluated = Request.QueryString["id"]; string exception = ""; DataTable table = new DataTable(); //int num = 0; if (EvaluatorManagementCtrl.GetEvaluator(ref table, evaluated, ref exception)) { Grid2.DataSource = table; Grid2.DataBind(); } }
private void bindEvaluatedToGrid() { string exception = ""; DataTable table = new DataTable(); if (DropDownList_Depart.SelectedValue == "0") { if (EvaluatorManagementCtrl.GetAll(ref table, ref exception)) { table = dataTableFilter(table); string sortField = Grid1.SortField; string sortDirection = Grid1.SortDirection; DataView dv = table.DefaultView; dv.Sort = String.Format("{0} {1}", sortField, sortDirection); Grid1.DataSource = dv; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); //Alert.ShowInTop("获取被考评人信息失败!/n原因:" + exception, MessageBoxIcon.Error); } } else { string depart = DropDownList_Depart.SelectedValue; if (EvaluatorManagementCtrl.GetAllByDepart(ref table, depart, ref exception)) { table = dataTableFilter(table); string sortField = "Status"; string sortDirection = "ASC"; DataView dv = table.DefaultView; dv.Sort = String.Format("{0} {1}", sortField, sortDirection); Grid1.DataSource = dv; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); //Alert.ShowInTop("获取被考评人信息失败!/n原因:" + exception, MessageBoxIcon.Error); } } }
protected void Button_Set_Click(object sender, EventArgs e) { string exception = ""; string evaluatedID = Request.QueryString["id"]; if (EvaluatorManagementCtrl.RandomGeneEvaluator(evaluatedID, ref exception)) { Alert.ShowInTop("设置成功!", MessageBoxIcon.Information); BindSettedEvaluatorToGrid(); return; } else { Alert.ShowInTop("设置失败!\n原因:" + exception, MessageBoxIcon.Error); return; } }
/// <summary> /// 绑定被考评信息到Grid /// </summary> private void bindEvaluatorToGrid() { DataTable table = new DataTable(); string exception = ""; string depart = Session["Depart"].ToString(); if (EvaluatorManagementCtrl.GetSelectableEvaluatorByDepart(ref table, depart, ref exception)) { Grid1.DataSource = table; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); } }
protected void Button_Submit_Click(object sender, EventArgs e) { string exception = ""; string fileName = Server.MapPath("../../upload/" + ViewState["filename"].ToString()); string depart = (string)Session["Depart"]; if (EvaluatorManagementCtrl.UploadSelectable(fileName, depart, ref exception)) { FileUpload_ExcelFile.Reset(); Alert.ShowInTop("上传成功!", MessageBoxIcon.Information); bindEvaluatorToGrid(); } else { FileUpload_ExcelFile.Reset(); Alert.ShowInTop("上传失败!\n失败原因:" + exception, MessageBoxIcon.Error); } }
private void BindEvaluatorToGrid() { DataTable table = new DataTable(); string exception = ""; string evaluatedID = Request.QueryString["id"]; if (EvaluatorManagementCtrl.GetEvaluator(ref table, evaluatedID, ref exception)) { table.DefaultView.Sort = "Relation ASC"; Grid1.DataSource = table.DefaultView; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); } }
protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e) { string exception = ""; if (e.CommandName == "Delete") { object[] keys = Grid1.DataKeys[e.RowIndex]; List <string> IDs = new List <string>(); IDs.Add((string)keys[0]); if (EvaluatorManagementCtrl.Delete(IDs, ref exception)) { Alert.ShowInTop("删除成功!", MessageBoxIcon.Information); bindEvaluatorToGrid(); } else { Alert.ShowInTop("删除失败!\n原因:" + exception, MessageBoxIcon.Error); } } }
private void bindEvaluatedToGrid() { string exception = ""; string depart = (string)Session["Depart"]; DataTable table = new DataTable(); if (EvaluatorManagementCtrl.GetAllByDepart(ref table, depart, ref exception)) { table = dataTableFilter(table); string sortField = Grid1.SortField; string sortDirection = Grid1.SortDirection; DataView dv = table.DefaultView; dv.Sort = String.Format("{0} {1}", sortField, sortDirection); Grid1.DataSource = dv; Grid1.DataBind(); } else { table.Clear(); Grid1.DataSource = table; Grid1.DataBind(); } }
protected void Button_Submit_Click(object sender, EventArgs e) { SyncSelectedRowIndexArrayToHiddenField(); string exception = ""; string evaluatedID = Request.QueryString["id"]; if (hfSelectedIDS.Text == "{}") { Alert.ShowInTop("请至少选择一项!", MessageBoxIcon.Warning); return; } Dictionary <string, string> dic = (new JavaScriptSerializer()).Deserialize <Dictionary <string, string> >(hfSelectedIDS.Text.Trim()); Dictionary <string, string> idRelationDic = new Dictionary <string, string>(); int leaderNum = 0; int colleagueNum = 0; int subordinateNum = 0; int servicesNum = 0; foreach (string key in dic.Keys) { switch (dic[key]) { case "领导": idRelationDic.Add(key, Convert.ToString((int)Relation.leader)); leaderNum++; break; case "同事": idRelationDic.Add(key, Convert.ToString((int)Relation.colleague)); colleagueNum++; break; case "下属": idRelationDic.Add(key, Convert.ToString((int)Relation.subordinate)); subordinateNum++; break; case "服务对象": idRelationDic.Add(key, Convert.ToString((int)Relation.services)); servicesNum++; break; } } bool is360; if (leaderNum < 4) { Alert.ShowInTop("请至少选择4位领导!", MessageBoxIcon.Error); return; } if (colleagueNum < 4) { Alert.ShowInTop("请至少选择4位同事!", MessageBoxIcon.Error); return; } if (servicesNum < 4) { Alert.ShowInTop("请至少选择4位服务对象!", MessageBoxIcon.Error); return; } if (idRelationDic.Count < 25) { Alert.ShowInTop("请至少选择25位考评人!", MessageBoxIcon.Error); return; } if (idRelationDic.Values.Contains(Convert.ToString((int)Relation.subordinate))) { is360 = true; } else { is360 = false; } if (EvaluatorManagementCtrl.SubmitEvaluator(evaluatedID, idRelationDic, is360, ref exception)) { Alert.ShowInTop("提交成功!\n窗口即将关闭", MessageBoxIcon.Information); PageContext.RegisterStartupScript(ActiveWindow.GetConfirmHidePostBackReference()); } else { Alert.ShowInTop("提交失败!\n原因:" + exception, MessageBoxIcon.Error); return; } }