protected void Button_ExportExcel_Click(object sender, EventArgs e) { string exception = ""; string evaluatedID = Request.QueryString["id"]; string evaluatedName = Request.QueryString["name"]; PostBook postBook = new PostBook(); if (PostBookManagementCtrl.GetPostBook(ref postBook, evaluatedID, ref exception)) { string filename = ""; if (ExportManagementCtrl.ExportPostBook(ref filename, evaluatedName, postBook, 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); } } else { Alert.ShowInTop("导出失败!\n原因:" + exception, MessageBoxIcon.Error); } }
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); } } }
protected void Button_Submit_Click(object sender, EventArgs e) { string exception = ""; if (!checkNull()) //检查项是否有空 { Alert.ShowInTop("有未填项,请检查!", MessageBoxIcon.Error); return; } PostBook pb = getPostBook(); if (pb.WorkContentRequest.Count < 6) //工作内容与要求至少需要6项 { Alert.ShowInTop("请填写至少6项工作内容与要求!"); return; } foreach (string[] item in pb.WorkContentRequest) //检查是否存在工作内容与要求中填写了标题却没填其他项(考核要点不检查) { if (item[0] == "" || item[1] == "" || item[2] == "") { Alert.ShowInTop("工作内容与要求中尚有未填写项!"); return; } } List <string> tempTitleList = new List <string>(); //检查工作内容与要求中的标题是否有重复项 foreach (string[] item in pb.WorkContentRequest) { if (tempTitleList.Contains(item[0])) { Alert.ShowInTop("工作内容与要求中有重复项,请重新填写", MessageBoxIcon.Error); return; } tempTitleList.Add(item[0]); } DocStatus curStatus = (DocStatus)Convert.ToInt32(Request.QueryString["status"]); DocStatus nextStatus = GetNextDocStatus(curStatus, DocOperation.submit); pb.Status = nextStatus; //填写下一个状态域 if (PostBookManagementCtrl.UpdatePostBook(pb, ref exception)) { Alert.ShowInTop("提交成功!\n窗口即将关闭", MessageBoxIcon.Information); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInTop("提交失败!\n原因:" + exception, MessageBoxIcon.Error); } }
/// <summary> /// 将岗位责任书已提交的被考评人姓名id字典绑定到下拉列表 /// </summary> private void bindPostBookSubmittedNameIdDicToDropDownList() { string exception = ""; Dictionary <string, string> nameIdDic = new Dictionary <string, string>(); string depart = (string)Session["Depart"]; if (PostBookManagementCtrl.GetSubmittedNameIdDic(ref nameIdDic, depart, ref exception)) { foreach (string name in nameIdDic.Keys) { DropDownList_Template.Items.Add(name, nameIdDic[name]); } } }
protected void Button_Pass_Click(object sender, EventArgs e) { string exception = ""; string evaluatedID = Request.QueryString["id"]; if (PostBookManagementCtrl.SetPass(evaluatedID, ref exception)) { Alert.ShowInTop("设置成功!\n窗口即将关闭", MessageBoxIcon.Information); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { Alert.ShowInTop("设置失败!\n原因:" + exception, MessageBoxIcon.Error); } }
private void bindEvaluatedToGrid() { string exception = ""; DataTable table = new DataTable(); if (DropDownList_Depart.SelectedValue == "0") { if (PostBookManagementCtrl.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 (PostBookManagementCtrl.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_Save_Click(object sender, EventArgs e) { string exception = ""; PostBook pb = getPostBook(); DocStatus curStatus = (DocStatus)Convert.ToInt32(Request.QueryString["status"]); DocStatus nextStatus = GetNextDocStatus(curStatus, DocOperation.save); pb.Status = nextStatus; //填写下一个状态域 if (PostBookManagementCtrl.UpdatePostBook(pb, ref exception)) { Alert.ShowInTop("保存成功!", MessageBoxIcon.Information); } else { Alert.ShowInTop("保存失败!\n原因:" + exception, MessageBoxIcon.Error); } }
/// <summary> /// 绑定被考评人信息到Grid /// </summary> private void bindEvaluatedToGrid() { string exception = ""; string depart = (string)Session["Depart"]; DataTable table = new DataTable(); if (PostBookManagementCtrl.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(); } }
/// <summary> /// 载入岗位责任书 /// </summary> private void loadPostBook(string id) { string exception = ""; string evaluatedID = ""; if (id == "" || id == "0") { evaluatedID = Request.QueryString["id"]; } else { evaluatedID = id; } string name = Request.QueryString["name"]; Panel1.Title = name + "的岗位责任书"; PostBook pb = new PostBook(); Label_Depart.Text = Request.QueryString["depart"]; Radio_PostType.SelectedValue = Request.QueryString["posttype"]; Radio_Employer.SelectedValue = Request.QueryString["company"]; if (PostBookManagementCtrl.GetPostBook(ref pb, evaluatedID, ref exception)) { foreach (string[] content in pb.WorkContentRequest) { if (content.Length != 4) { return; } } string evaluatedName = Request.QueryString["name"]; Label_Comment.Text = pb.Comment; TextBox_LaborDepart.Text = pb.LaborDepart; Label_PostName.Text = pb.PostName; TextArea_EduBg.Text = pb.EduBg; TextArea_Certificate.Text = pb.Certificate; TextArea_Experience.Text = pb.Experience; TextArea_Skill.Text = pb.Skill; TextArea_Personality.Text = pb.Personality; TextArea_PhyCond.Text = pb.PhyCond; TextArea_WorkOutline.Text = pb.WorkOutline; TextArea_Power.Text = pb.Power; TextArea_Response.Text = pb.Response; TextBox_DirectLeader.Text = pb.DirectLeader; TextBox_Subordinate.Text = pb.Subordinate; TextBox_Colleague.Text = pb.Colleague; TextBox_Services.Text = pb.Services; TextBox_Relations.Text = pb.Relations; TextArea_WorkEnter.Text = pb.WorkEnter; TextArea_PostAssess.Text = pb.PostAssess; TextArea_Others.Text = pb.Others; addWorkContentRequest(pb.WorkContentRequest); } else { TextBox_LaborDepart.Text = Request.QueryString["labordepart"]; Label_PostName.Text = Request.QueryString["postname"]; } }